浏览代码

better jitsi-meet template integration

Guénaël Muller 7 年前
父节点
当前提交
32cc9681da

+ 5 - 2
tracim/tracim/controllers/jitsi_meet.py 查看文件

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

+ 0 - 0
tracim/tracim/templates/videoconf/__init__.py 查看文件


tracim/tracim/templates/videoconf.mak → tracim/tracim/templates/videoconf/jitsi_meet.mak 查看文件

4
 <%namespace name="TABLE_ROW" file="tracim.templates.widgets.table_row"/>
4
 <%namespace name="TABLE_ROW" file="tracim.templates.widgets.table_row"/>
5
 <%namespace name="LEFT_MENU" file="tracim.templates.widgets.left_menu"/>
5
 <%namespace name="LEFT_MENU" file="tracim.templates.widgets.left_menu"/>
6
 <%namespace name="P" file="tracim.templates.widgets.paragraph"/>
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
 <%def name="title()">
9
 <%def name="title()">
10
     ${_('VideoConf')}
10
     ${_('VideoConf')}
11
 </%def>
11
 </%def>
12
 
12
 
13
 <%def name="TITLE_ROW()">
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
 </%def>
22
 </%def>
18
 
23
 
19
 <%def name="SIDEBAR_RIGHT_CONTENT()">
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
 </%def>
26
 </%def>
22
 
27
 
23
 
28
 
24
 <%def name="SIDEBAR_LEFT_CONTENT()">
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
 </%def>
31
 </%def>
28
 
32
 
29
 <%def name="REQUIRED_DIALOGS()">
33
 <%def name="REQUIRED_DIALOGS()">
30
-    ${TIM.MODAL_DIALOG('user-edit-modal-dialog')}
31
-    ${TIM.MODAL_DIALOG('user-edit-password-modal-dialog')}
32
 </%def>
34
 </%def>
33
 
35
 
34
 <div class="content__home">
36
 <div class="content__home">
50
             roomName : '${jitsi_meet_room.room}',
52
             roomName : '${jitsi_meet_room.room}',
51
             parentNode: document.querySelector('#jitsi'),
53
             parentNode: document.querySelector('#jitsi'),
52
 	    // has external API use iframe, height is a problem
54
 	    // has external API use iframe, height is a problem
53
-            height: 800,
55
+            height: 700,
54
             no_SSL: true,
56
             no_SSL: true,
55
             configOverwrite: {
57
             configOverwrite: {
56
                  enableWelcomePage: false,
58
                  enableWelcomePage: false,
89
         // We can override also avatar.
91
         // We can override also avatar.
90
         api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647');
92
         api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647');
91
     </script>
93
     </script>
92
-    ${jitsi_meet_room.generate_url()}
93
 </div>
94
 </div>
94
 
95
 

+ 15 - 0
tracim/tracim/templates/videoconf/toolbar.mak 查看文件

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>