浏览代码

improve user interface for calendar

Damien ACCORSI 9 年前
父节点
当前提交
3421ed7160

+ 2 - 2
tracim/tracim/model/serializers.py 查看文件

963
     result['label'] = workspace.label
963
     result['label'] = workspace.label
964
     result['description'] = workspace.description
964
     result['description'] = workspace.description
965
     result['member_nb'] = len(workspace.roles)
965
     result['member_nb'] = len(workspace.roles)
966
+    result['calendar_enabled'] = workspace.calendar_enabled
967
+    result['calendar_url'] = workspace.calendar_url
966
 
968
 
967
-    #    roles = serializableObject.roles
968
-    #    result['users'] = context.toDict(serializableObject.roles)
969
     return result
969
     return result
970
 
970
 
971
 
971
 

+ 15 - 3
tracim/tracim/templates/admin/workspace_getall.mak 查看文件

45
                                         <label for="workspaceDescription">${_('Description')}</label>
45
                                         <label for="workspaceDescription">${_('Description')}</label>
46
                                         <textarea name="description" class="form-control" id="workspaceDescription" placeholder="${_('You may add a description of the workspace')}"></textarea>
46
                                         <textarea name="description" class="form-control" id="workspaceDescription" placeholder="${_('You may add a description of the workspace')}"></textarea>
47
                                     </div>
47
                                     </div>
48
-                                    <div class="form-group">
49
-                                        <label for="workspaceCalendarEnabled">${_('Calendar enabled')}</label>
50
-                                        <input id="workspaceCalendarEnabled" name="calendar_enabled" class="form-control" type="checkbox" checked />
48
+                                    <div class="checkbox form-group">
49
+                                        <label for="workspaceCalendarEnabled">
50
+                                            <input id="workspaceCalendarEnabled" name="calendar_enabled" type="checkbox" checked >
51
+                                            <b>${_('Activate associated calendar')}</b>
52
+                                        </label>
51
                                     </div>
53
                                     </div>
54
+
52
                                     <div class="form-group">
55
                                     <div class="form-group">
53
                                         <p class="form-control-static">${_('<u>Note</u>: members will be added during next step.')|n}</p>
56
                                         <p class="form-control-static">${_('<u>Note</u>: members will be added during next step.')|n}</p>
54
                                     </div>
57
                                     </div>
80
                                     <th>${_('Workspace')}</th>
83
                                     <th>${_('Workspace')}</th>
81
                                     <th>${_('Description')}</th>
84
                                     <th>${_('Description')}</th>
82
                                     <th>${_('User Nb')}</th>
85
                                     <th>${_('User Nb')}</th>
86
+                                    <th>${_('Calendar')}</th>
83
                                 </tr>
87
                                 </tr>
84
                             </thead>
88
                             </thead>
85
                             % for workspace in result.workspaces:
89
                             % for workspace in result.workspaces:
88
                                     <td><a href="${tg.url('/admin/workspaces/{}'.format(workspace.id))}">${workspace.label}</a></td>
92
                                     <td><a href="${tg.url('/admin/workspaces/{}'.format(workspace.id))}">${workspace.label}</a></td>
89
                                     <td>${workspace.description}</td>
93
                                     <td>${workspace.description}</td>
90
                                     <td>${workspace.member_nb}</td>
94
                                     <td>${workspace.member_nb}</td>
95
+                                    <td class="text-center">
96
+                                        % if workspace.calendar_enabled:
97
+                                            ${ICON.FA('fa-check-square-o fa-lg t-enabled-color')}
98
+                                        % else:
99
+                                            ${ICON.FA('fa-square-o fa-lg t-disabled-color')}
100
+                                        % endif
101
+
102
+                                    </td>
91
                                 </tr>
103
                                 </tr>
92
                             % endfor
104
                             % endfor
93
                         </table>
105
                         </table>

+ 16 - 0
tracim/tracim/templates/admin/workspace_getone.mak 查看文件

48
             </div>
48
             </div>
49
 
49
 
50
             <div class="row">
50
             <div class="row">
51
+                % if not result.workspace.calendar_enabled:
52
+                    <div class="col-sm-7 col-md-offset-3">
53
+                        ${_('The calendar is disabled.')}
54
+                    </div>
55
+                % else:
56
+                    <div class="col-sm-7 col-md-offset-3">
57
+                        ${TITLE.H3(_('Calendar'), 'fa-calendar', 'workspace-members')}
58
+                        <p>${_('This workspace offers a calendar that you can configure in your software: Outlook, Thunderbird, etc.')}</p>
59
+                        <p>${_('The url to configure is the following one:')}</p>
60
+                        <p class="form-control">${result.workspace.calendar_url}"</p>
61
+
62
+                    </div>
63
+                % endif
64
+            </div>
65
+
66
+            <div class="row">
51
                 <div class="col-sm-7 col-md-offset-3">
67
                 <div class="col-sm-7 col-md-offset-3">
52
                     <div>
68
                     <div>
53
                         <% potential_new_user_nb = sum(1 for user in fake_api.users if user.id not in (user.id for user in result.workspace.members)) %>
69
                         <% potential_new_user_nb = sum(1 for user in fake_api.users if user.id not in (user.id for user in result.workspace.members)) %>

+ 21 - 4
tracim/tracim/templates/workspace/edit.mak 查看文件

17
             <label for="workspaceDescription">${_('Description')}</label>
17
             <label for="workspaceDescription">${_('Description')}</label>
18
             <textarea name="description" class="form-control" id="workspaceDescription" placeholder="${_('You may add a description of the workspace')}">${result.workspace.description}</textarea>
18
             <textarea name="description" class="form-control" id="workspaceDescription" placeholder="${_('You may add a description of the workspace')}">${result.workspace.description}</textarea>
19
         </div>
19
         </div>
20
-        <div class="form-group">
21
-            <label for="workspaceCalendarEnabled">${_('Calendar enabled')}</label>
22
-            <input id="workspaceCalendarEnabled" name="calendar_enabled" class="form-control" type="checkbox" ${'checked' if result.workspace.calendar_enabled else ''} />
20
+        <div class="checkbox form-group">
21
+            <label for="workspaceCalendarEnabled">
22
+                <input id="workspaceCalendarEnabled" name="calendar_enabled" type="checkbox" checked >
23
+                <b>${_('Activate associated calendar')}</b>
24
+            </label>
23
         </div>
25
         </div>
26
+        <script>
27
+            $('#workspaceCalendarEnabled').click(function() {
28
+                console.log('Value is' + $(this).val());
29
+                if($(this).is(':checked')) {
30
+                    console.log('hide url');
31
+                    $('.calendar-url').css('display', 'block');
32
+                } else {
33
+                    console.log('show url');
34
+                    $('.calendar-url').css('display', 'none');
35
+                }
36
+            });
37
+        </script>
24
         <div class="form-group calendar-url">
38
         <div class="form-group calendar-url">
25
-            <label for="workspaceCalendarUrl">${_('Calendar URL')}</label>
39
+            <label for="workspace-name1">${_('Calendar Url')}</label>
26
             <input id="workspaceCalendarUrl" type="text" class="form-control"  disabled="disabled" value="${result.workspace.calendar_url}" />
40
             <input id="workspaceCalendarUrl" type="text" class="form-control"  disabled="disabled" value="${result.workspace.calendar_url}" />
41
+            <p>
42
+                ${_('This url is the one to configure in your calendar software: Outlook, Thunderbird, etc.')}
43
+            </p>
27
         </div>
44
         </div>
28
     </div>
45
     </div>
29
     <div class="modal-footer">
46
     <div class="modal-footer">

+ 25 - 19
tracim/tracim/templates/workspace/getone.mak 查看文件

59
         % else:
59
         % else:
60
             <p class="t-less-visible">${_('No description available')}</p>
60
             <p class="t-less-visible">${_('No description available')}</p>
61
         % endif
61
         % endif
62
-        % if result.workspace.calendar_enabled:
63
-            <p>
64
-                ${_('Calendar URL')}: ${result.workspace.calendar_url}
65
-            </p>
66
-        % endif
67
 
62
 
68
         <% member_nb = len(result.workspace.members) %>
63
         <% member_nb = len(result.workspace.members) %>
69
         % if member_nb<=0:
64
         % if member_nb<=0:
75
                 % else:
70
                 % else:
76
                     ${_('This workspace has {a_open}{member_nb} members{a_close}').format(a_open='<a data-toggle="collapse" href="#memberList" aria-expanded="false" aria-controls="memberList">', member_nb=member_nb, a_close='</a>')|n}
71
                     ${_('This workspace has {a_open}{member_nb} members{a_close}').format(a_open='<a data-toggle="collapse" href="#memberList" aria-expanded="false" aria-controls="memberList">', member_nb=member_nb, a_close='</a>')|n}
77
                 % endif
72
                 % endif
78
-                </p>
79
-                <div class="collapse" id="memberList">
80
-                    <table class="table">
81
-                        % for member in result.workspace.members:
82
-                            <tr>
83
-                                <td><strong>${member.name}</strong></td>
84
-                                <td>
85
-                                    ${TIM.ICO_FA_BADGED('fa fa-fw fa-flag', member.role_description, member.style)}
86
-                                    ${member.role_description}
87
-                                </td>
88
-                            </tr>
89
-                        % endfor
90
-                    </table>
91
-                </div>
92
             </p>
73
             </p>
74
+            <div class="collapse" id="memberList">
75
+                <table class="table">
76
+                    % for member in result.workspace.members:
77
+                        <tr>
78
+                            <td><strong>${member.name}</strong></td>
79
+                            <td>
80
+                                ${TIM.ICO_FA_BADGED('fa fa-fw fa-flag', member.role_description, member.style)}
81
+                                ${member.role_description}
82
+                            </td>
83
+                        </tr>
84
+                    % endfor
85
+                </table>
86
+            </div>
87
+        % endif
88
+
89
+        % if result.workspace.calendar_enabled:
90
+            <p>
91
+                ${_('This workspace has {a_open}an associated calendar{a_close}').format(a_open='<a data-toggle="collapse" href="#calendarConfig" aria-expanded="false" aria-controls="calendarConfig">', a_close='</a>')|n}
92
+            </p>
93
+            <div class="collapse" id="calendarConfig">
94
+                <p>${_('You can access the calendar using your own software: Outlook, Thunderbird, etc.')}</p>
95
+                <p>${_('The url to setup is the following one:')}</p>
96
+                <p class="form-control">${result.workspace.calendar_url}"</p>
97
+            </div>
93
         % endif
98
         % endif
99
+
94
     </div>
100
     </div>
95
 </div>
101
 </div>
96
 
102