Browse Source

Merge branch 'master' of github.com:tracim/tracim

Bastien Sevajol (Algoo) 8 years ago
parent
commit
20e8023bf8

+ 7 - 3
tracim/tracim/controllers/content.py View File

527
 
527
 
528
     @tg.require(current_user_is_reader())
528
     @tg.require(current_user_is_reader())
529
     @tg.expose('tracim.templates.thread.getone')
529
     @tg.expose('tracim.templates.thread.getone')
530
-    def get_one(self, thread_id):
530
+    def get_one(self, thread_id, inverted: str=''):
531
         thread_id = int(thread_id)
531
         thread_id = int(thread_id)
532
         user = tmpl_context.current_user
532
         user = tmpl_context.current_user
533
         workspace = tmpl_context.workspace
533
         workspace = tmpl_context.workspace
543
         fake_api = Context(CTX.FOLDER).toDict(fake_api_content)
543
         fake_api = Context(CTX.FOLDER).toDict(fake_api_content)
544
 
544
 
545
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
545
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
546
-        return DictLikeClass(result = dictified_thread, fake_api=fake_api)
546
+
547
+        if inverted:
548
+          dictified_thread.thread.history = reversed(dictified_thread.thread.history)
549
+
550
+        return DictLikeClass(result=dictified_thread, fake_api=fake_api, inverted=inverted)
547
 
551
 
548
 
552
 
549
 
553
 
949
             back_url = self._parent_url.format(item.workspace_id, item.parent_id)
953
             back_url = self._parent_url.format(item.workspace_id, item.parent_id)
950
             msg = _('{} not un-deleted: {}').format(self._item_type_label, str(e))
954
             msg = _('{} not un-deleted: {}').format(self._item_type_label, str(e))
951
             tg.flash(msg, CST.STATUS_ERROR)
955
             tg.flash(msg, CST.STATUS_ERROR)
952
-            tg.redirect(back_url)
956
+            tg.redirect(back_url)

+ 4 - 0
tracim/tracim/i18n/fr/LC_MESSAGES/tracim.po View File

1965
 msgid "Post a reply..."
1965
 msgid "Post a reply..."
1966
 msgstr "Poster une réponse..."
1966
 msgstr "Poster une réponse..."
1967
 
1967
 
1968
+#: tracim/templates/thread/getone.mak:97
1969
+msgid "Invert order"
1970
+msgstr "Inverser l'ordre"
1971
+
1968
 #: tracim/templates/thread/toolbar.mak:16
1972
 #: tracim/templates/thread/toolbar.mak:16
1969
 msgid "Edit current thread"
1973
 msgid "Edit current thread"
1970
 msgstr "Modifier le sujet de discussion"
1974
 msgstr "Modifier le sujet de discussion"

+ 8 - 0
tracim/tracim/public/assets/css/dashboard.css View File

382
 .no-padding {
382
 .no-padding {
383
     padding: 0px;
383
     padding: 0px;
384
 }
384
 }
385
+.threads-history-reverse {
386
+  float: right;
387
+  padding: 10px 15px 0 0;
388
+  font-size: 16px;
389
+}
390
+.threads-history-reverse > i {
391
+  font-size: 12px;
392
+}

+ 4 - 4
tracim/tracim/templates/file/toolbar.mak View File

11
 
11
 
12
     <% download_url = tg.url('/workspaces/{}/folders/{}/files/{}/download?revision_id={}'.format(result.file.workspace.id, result.file.parent.id,result.file.id,result.file.selected_revision)) %>
12
     <% download_url = tg.url('/workspaces/{}/folders/{}/files/{}/download?revision_id={}'.format(result.file.workspace.id, result.file.parent.id,result.file.id,result.file.selected_revision)) %>
13
     <% edit_disabled = ('', 'disabled')[file.selected_revision!='latest' or file.status.id[:6]=='closed'] %>
13
     <% edit_disabled = ('', 'disabled')[file.selected_revision!='latest' or file.status.id[:6]=='closed'] %>
14
-    <% delete_or_archive_disabled = ('', 'disabled')[file.selected_revision!='latest'] %> 
14
+    <% delete_or_archive_disabled = ('', 'disabled')[file.selected_revision!='latest'] %>
15
     % if h.user_role(user, workspace)>1:
15
     % if h.user_role(user, workspace)>1:
16
         <div class="btn-group btn-group-vertical">
16
         <div class="btn-group btn-group-vertical">
17
             <a title="${_('Edit current file')}" class="btn btn-default ${edit_disabled}" data-toggle="modal" data-target="#file-edit-modal-dialog" data-remote="${tg.url('/workspaces/{}/folders/{}/files/{}/edit'.format(file.workspace.id, file.parent.id, file.id))}" >${ICON.FA_FW('fa fa-edit t-less-visible')} ${_('Edit')}</a>
17
             <a title="${_('Edit current file')}" class="btn btn-default ${edit_disabled}" data-toggle="modal" data-target="#file-edit-modal-dialog" data-remote="${tg.url('/workspaces/{}/folders/{}/files/{}/edit'.format(file.workspace.id, file.parent.id, file.id))}" >${ICON.FA_FW('fa fa-edit t-less-visible')} ${_('Edit')}</a>
18
         </div>
18
         </div>
19
         <p></p>
19
         <p></p>
20
     % endif
20
     % endif
21
-    
21
+
22
     <div class="btn-group btn-group-vertical">
22
     <div class="btn-group btn-group-vertical">
23
         <a href="${download_url}" role="button" class="btn btn-default" data-toggle="modal" title="${_('Download the file')}">${ICON.FA('fa fa-download t-less-visible')} ${_('Download')}</a>
23
         <a href="${download_url}" role="button" class="btn btn-default" data-toggle="modal" title="${_('Download the file')}">${ICON.FA('fa fa-download t-less-visible')} ${_('Download')}</a>
24
         <a href="#file-versions" role="button" class="btn btn-default" data-toggle="modal" title="${_('View versions of the file')}">${ICON.FA('fa fa-history t-less-visible')} ${_('Revisions')}</a>
24
         <a href="#file-versions" role="button" class="btn btn-default" data-toggle="modal" title="${_('View versions of the file')}">${ICON.FA('fa fa-history t-less-visible')} ${_('Revisions')}</a>
25
 ## RESTORE LINKS IF REQUIRED        <a href="#file-associated-links" role="button" class="btn btn-default" data-toggle="modal" title="${_('View all links')}">${TIM.ICO(32, 'apps/internet-web-browser')}</a>
25
 ## RESTORE LINKS IF REQUIRED        <a href="#file-associated-links" role="button" class="btn btn-default" data-toggle="modal" title="${_('View all links')}">${TIM.ICO(32, 'apps/internet-web-browser')}</a>
26
     </div>
26
     </div>
27
     <p></p>
27
     <p></p>
28
-    
28
+
29
     % if user.profile.id>=3 or h.user_role(user, workspace)>=4:
29
     % if user.profile.id>=3 or h.user_role(user, workspace)>=4:
30
         ## if the user can see the toolbar, it means he is the workspace manager.
30
         ## if the user can see the toolbar, it means he is the workspace manager.
31
         ## So now, we need to know if he alsa has right to delete workspaces
31
         ## So now, we need to know if he alsa has right to delete workspaces
32
         <div class="btn-group btn-group-vertical">
32
         <div class="btn-group btn-group-vertical">
33
             ## SHOW_ARCHIVE_BUTTON__BUG_#81
33
             ## SHOW_ARCHIVE_BUTTON__BUG_#81
34
             <a title="${_('Archive file')}" class="btn btn-default ${delete_or_archive_disabled}" href="${tg.url('/workspaces/{}/folders/{}/files/{}/put_archive'.format(file.workspace.id, file.parent.id, file.id))}">
34
             <a title="${_('Archive file')}" class="btn btn-default ${delete_or_archive_disabled}" href="${tg.url('/workspaces/{}/folders/{}/files/{}/put_archive'.format(file.workspace.id, file.parent.id, file.id))}">
35
-                ${ICON.FA_FW('fa fa-archive t-less-visible')} ${_('Archive')}test
35
+                ${ICON.FA_FW('fa fa-archive t-less-visible')} ${_('Archive')}
36
             </a>
36
             </a>
37
             <a title="${_('Delete file')}" class="btn btn-default ${delete_or_archive_disabled}" href="${tg.url('/workspaces/{}/folders/{}/files/{}/put_delete'.format(file.workspace.id, file.parent.id, file.id))}">
37
             <a title="${_('Delete file')}" class="btn btn-default ${delete_or_archive_disabled}" href="${tg.url('/workspaces/{}/folders/{}/files/{}/put_delete'.format(file.workspace.id, file.parent.id, file.id))}">
38
                 ${ICON.FA_FW('fa fa-trash t-less-visible')} ${_('Delete')}
38
                 ${ICON.FA_FW('fa fa-trash t-less-visible')} ${_('Delete')}

+ 12 - 0
tracim/tracim/templates/thread/getone.mak View File

85
 
85
 
86
 <div class="row">
86
 <div class="row">
87
     <div class="col-sm-7 col-sm-offset-3">
87
     <div class="col-sm-7 col-sm-offset-3">
88
+        <div class="threads-history-reverse">
89
+        % if inverted:
90
+            <a href="${tg.url('/workspaces/{}/folders/{}/threads/{}'.format(result.thread.workspace.id, result.thread.parent.id, result.thread.id))}">
91
+                <i class="fa fa-chevron-down" aria-hidden="true"></i>
92
+        % else:
93
+            <a href="${tg.url('/workspaces/{}/folders/{}/threads/{}?inverted=1'.format(result.thread.workspace.id, result.thread.parent.id, result.thread.id))}">
94
+                <i class="fa fa-chevron-up" aria-hidden="true"></i>
95
+        % endif
96
+                ${_('Invert order')}
97
+            </a>
98
+        </div>
88
         % if h.user_role(fake_api.current_user, result.thread.workspace)<=1:
99
         % if h.user_role(fake_api.current_user, result.thread.workspace)<=1:
89
             ## READONLY USER
100
             ## READONLY USER
90
             <% a = 'b' %>
101
             <% a = 'b' %>
101
     </div>
112
     </div>
102
 </div>
113
 </div>
103
 
114
 
115
+<!-- % for event in reversed(result.thread.history): -->
104
 % for event in result.thread.history:
116
 % for event in result.thread.history:
105
     ## TODO - D.A. - 2015-08-20
117
     ## TODO - D.A. - 2015-08-20
106
     ## Allow to show full history (with status change and archive/unarchive)
118
     ## Allow to show full history (with status change and archive/unarchive)