Quellcode durchsuchen

Add "share a link" to non-tracim-user feature

Guénaël Muller vor 6 Jahren
Ursprung
Commit
fa193be0fa

+ 9 - 0
tracim/tracim/controllers/jitsi_meet.py Datei anzeigen

@@ -25,9 +25,18 @@ class JitsiMeetController(TIMRestController):
25 25
         except NoResultFound:
26 26
             abort(404)
27 27
 
28
+
28 29
     @tg.require(current_user_is_reader())
29 30
     @expose('tracim.templates.videoconf.jitsi_meet')
30 31
     def get(self):
32
+        return self._process()
33
+
34
+    @tg.require(current_user_is_reader())
35
+    @expose('tracim.templates.videoconf.invite')
36
+    def invite(self):
37
+        return self._process()
38
+
39
+    def _process(self):
31 40
         cfg = CFG.get_instance()
32 41
         if not cfg.JITSI_MEET_ACTIVATED:
33 42
             abort(404)

+ 22 - 0
tracim/tracim/templates/videoconf/invite.mak Datei anzeigen

@@ -0,0 +1,22 @@
1
+<%namespace name="TIM" file="tracim.templates.pod"/>
2
+<%namespace name="ICON" file="tracim.templates.widgets.icon"/>
3
+<%def name="title()">${_('Invite someone to video-conference')}</%def>
4
+
5
+<%def name="content(jitsi_meet_room)">
6
+    <div class="modal-header">
7
+        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
8
+        <h4 class="modal-title">${ICON.FA('fa-share')}  ${self.title()}</h4>
9
+    </div>
10
+    <div class="modal-body">
11
+        <p>
12
+        ${_('To invite someone from outside of tracim into this conference, share this link. This link is available for 5 minutes.')}
13
+        </p>
14
+        <textarea readonly=readonly wrap="off" style="width: 100%;">${jitsi_meet_room.generate_url()}</textarea>
15
+    </div>
16
+    <div class="modal-footer">
17
+        <button type="button" class="btn btn-default" data-dismiss="modal">${_('Close')}</button>
18
+    </div>
19
+        </form>
20
+</%def>
21
+${self.content(jitsi_meet_room)}
22
+

+ 6 - 0
tracim/tracim/templates/videoconf/jitsi_meet.mak Datei anzeigen

@@ -93,3 +93,9 @@
93 93
     </script>
94 94
 </div>
95 95
 
96
+<div id="videoconf-invite-modal-dialog" class="modal bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
97
+  <div class="modal-dialog">
98
+    <div class="modal-content">
99
+    </div>
100
+  </div>
101
+</div>

+ 2 - 2
tracim/tracim/templates/videoconf/toolbar.mak Datei anzeigen

@@ -7,9 +7,9 @@
7 7
     ## SIDEBAR RIGHT
8 8
     <div>
9 9
         <div class="btn-group btn-group-vertical">
10
-            <a title="${_('Full-size')}" class="btn btn-default" href="${jitsi_meet_room.generate_url()}" >${ICON.FA('fa-arrows-alt fa-fw t-less-visible')} ${_('Full-size')}</a>
10
+            <a title="${_('Invite by sharing a link')}" class="btn btn-default" data-toggle="modal" data-target="#videoconf-invite-modal-dialog" data-remote="${tg.url('/workspaces/{}/videoconf/invite'.format(result.workspace.id))}" >${ICON.FA('fa-share fa-fw t-less-visible')} ${_('Invite')}</a>
11 11
         </div>
12 12
         <p></p>
13 13
     </div> <!-- # End of side bar right -->
14 14
     ## SIDEBAR RIGHT [END]
15
-</%def>
15
+</%def>