Browse Source

better jitsi-meet template integration

Guénaël Muller 6 years ago
parent
commit
32cc9681da

+ 5 - 2
tracim/tracim/controllers/jitsi_meet.py View File

@@ -26,7 +26,7 @@ class JitsiMeetController(TIMRestController):
26 26
             abort(404)
27 27
 
28 28
     @tg.require(current_user_is_reader())
29
-    @expose('tracim.templates.videoconf')
29
+    @expose('tracim.templates.videoconf.jitsi_meet')
30 30
     def get(self):
31 31
         cfg = CFG.get_instance()
32 32
         if not cfg.JITSI_MEET_ACTIVATED:
@@ -36,9 +36,11 @@ class JitsiMeetController(TIMRestController):
36 36
         current_user_content = Context(CTX.CURRENT_USER).toDict(user)
37 37
         fake_api = Context(CTX.CURRENT_USER).toDict(
38 38
             {'current_user': current_user_content,
39
-             'workspace': workspace,
40 39
              }
41 40
         )
41
+        dictified_workspace = Context(CTX.WORKSPACE).toDict(workspace,
42
+                                                            'workspace')
43
+
42 44
         label = unidecode(workspace.label)
43 45
         parsed_label = ''.join(e for e in label if e.isalnum())
44 46
         # TODO - G.M - 18-01-2017 -
@@ -64,4 +66,5 @@ class JitsiMeetController(TIMRestController):
64 66
             token_config=token)
65 67
 
66 68
         return DictLikeClass(fake_api=fake_api,
69
+                             result=dictified_workspace,
67 70
                              jitsi_meet_room=jitsi_meet_room)

+ 0 - 0
tracim/tracim/templates/videoconf/__init__.py View File


tracim/tracim/templates/videoconf.mak → tracim/tracim/templates/videoconf/jitsi_meet.mak View File

@@ -4,31 +4,33 @@
4 4
 <%namespace name="TABLE_ROW" file="tracim.templates.widgets.table_row"/>
5 5
 <%namespace name="LEFT_MENU" file="tracim.templates.widgets.left_menu"/>
6 6
 <%namespace name="P" file="tracim.templates.widgets.paragraph"/>
7
-<%namespace name="TOOLBAR" file="tracim.templates.user_toolbars"/>
7
+<%namespace name="TOOLBAR" file="tracim.templates.videoconf.toolbar"/>
8 8
 
9 9
 <%def name="title()">
10 10
     ${_('VideoConf')}
11 11
 </%def>
12 12
 
13 13
 <%def name="TITLE_ROW()">
14
-    ##<div class="content__title">
15
-    ##    ${ROW.TITLE_ROW(_('My Dashboard'), 'fa-home', 'content__title__subtitle-home-hidden-xs', 't-user-color', _('Welcome to your home, {username}.').format(username=fake_api.current_user.name))}
16
-    ##</div>
14
+    <div class="content__title">
15
+    ${ROW.TITLE_ROW(
16
+    _('Video conference'),
17
+    'fa-video-camera', 'content__title__subtitle-home-hidden-xs',
18
+    't-user-color', _('Welcome to video conference of {workspace}, {username}.').format(workspace=
19
+    result.workspace.label,
20
+    username=fake_api.current_user.name))}
21
+    </div>
17 22
 </%def>
18 23
 
19 24
 <%def name="SIDEBAR_RIGHT_CONTENT()">
20
-   ## ${TOOLBAR.USER_ME(fake_api.current_user)}
25
+    ${TOOLBAR.JITSIMEETROOM(fake_api.current_user, result.workspace, jitsi_meet_room)}
21 26
 </%def>
22 27
 
23 28
 
24 29
 <%def name="SIDEBAR_LEFT_CONTENT()">
25
-    ## This is the default left sidebar implementation
26
-    ##${LEFT_MENU.TREEVIEW('sidebar-left-menu', '__')}
30
+    ${LEFT_MENU.TREEVIEW('sidebar-left-menu', 'workspace_{}__'.format(result.workspace.id))}
27 31
 </%def>
28 32
 
29 33
 <%def name="REQUIRED_DIALOGS()">
30
-    ${TIM.MODAL_DIALOG('user-edit-modal-dialog')}
31
-    ${TIM.MODAL_DIALOG('user-edit-password-modal-dialog')}
32 34
 </%def>
33 35
 
34 36
 <div class="content__home">
@@ -50,7 +52,7 @@
50 52
             roomName : '${jitsi_meet_room.room}',
51 53
             parentNode: document.querySelector('#jitsi'),
52 54
 	    // has external API use iframe, height is a problem
53
-            height: 800,
55
+            height: 700,
54 56
             no_SSL: true,
55 57
             configOverwrite: {
56 58
                  enableWelcomePage: false,
@@ -89,6 +91,5 @@
89 91
         // We can override also avatar.
90 92
         api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647');
91 93
     </script>
92
-    ${jitsi_meet_room.generate_url()}
93 94
 </div>
94 95
 

+ 15 - 0
tracim/tracim/templates/videoconf/toolbar.mak View File

@@ -0,0 +1,15 @@
1
+<%namespace name="ICON" file="tracim.templates.widgets.icon"/>
2
+
3
+<%namespace name="TIM" file="tracim.templates.pod"/>
4
+
5
+
6
+<%def name="JITSIMEETROOM(current_user, workspace,jitsi_meet_room)">
7
+    ## SIDEBAR RIGHT
8
+    <div>
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>
11
+        </div>
12
+        <p></p>
13
+    </div> <!-- # End of side bar right -->
14
+    ## SIDEBAR RIGHT [END]
15
+</%def>