Sfoglia il codice sorgente

added design for deleted/archived content in content list + added msg for deleted/archived element in content page + design filter on content list

Come 7 anni fa
parent
commit
f31224fe2f

+ 12 - 0
tracim/tracim/public/assets/css/dashboard.css Vedi File

@@ -390,3 +390,15 @@ span.info.readonly {
390 390
 .threads-history-reverse > i {
391 391
   font-size: 12px;
392 392
 }
393
+
394
+.folder__filter {
395
+  font-size: 14px;
396
+}
397
+.folder__filter a.btn {
398
+  font-size: 14px;
399
+}
400
+.folder__list__item__status {
401
+  float: right;
402
+  font-size: 13px;
403
+  color: #999;
404
+}

+ 21 - 1
tracim/tracim/templates/file/getone.mak Vedi File

@@ -57,6 +57,26 @@
57 57
     </div>
58 58
 </div>
59 59
 
60
+% if (result.file.is_archived) :
61
+<div class="row alert alert-info" role="alert">
62
+    <div class="col-sm-7 col-sm-offset-3">
63
+        <p>
64
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
65
+            Vous consultez <b>une version archivée</b> de la page courante.
66
+        </p>
67
+    </div>
68
+</div>
69
+% elif (result.file.is_deleted) :
70
+<div class="row alert alert-info" role="alert">
71
+    <div class="col-sm-7 col-sm-offset-3">
72
+        <p>
73
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
74
+            Vous consultez <b>une version supprimée</b> de la page courante.
75
+        </p>
76
+    </div>
77
+</div>
78
+% endif
79
+
60 80
 % if result.file.selected_revision!='latest':
61 81
     <div class="row alert alert-warning" role="alert">
62 82
         <div class="col-sm-7 col-sm-offset-3">
@@ -145,7 +165,7 @@
145 165
                 ${WIDGETS.SECURED_SECTION_TITLE(fake_api.current_user, result.file.workspace, 'file-revisions', _('File revisions'))}
146 166
                 <p>${_('This file contains {} revision(s)').format(sum(1 for revision in result.file.revisions if revision.action.id=='revision'))}</p>
147 167
             % else:
148
-                % if h.user_role(fake_api.current_user, result.file.workspace)>1:
168
+                % if (h.user_role(fake_api.current_user, result.file.workspace)>1 and not result.file.is_archived and not result.file.is_deleted):
149 169
                     ${BUTTON.DATA_TARGET_AS_TEXT('new-file-revision', _('upload a new revision and/or comment...'), 'btn btn-success t-spacer-below')}
150 170
                     ${FORMS.NEW_FILE_REVISION_WITH_COMMENT_FORM('new-file-revision', result.file.workspace.id, result.file.parent.id, result.file.id)}
151 171
                 % endif

+ 27 - 5
tracim/tracim/templates/folder/getone.mak Vedi File

@@ -56,6 +56,26 @@
56 56
     </div>
57 57
 </div>
58 58
 
59
+% if (result.folder.is_archived) :
60
+<div class="row alert alert-info" role="alert">
61
+    <div class="col-sm-7 col-sm-offset-3">
62
+        <p>
63
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
64
+            Vous consultez <b>une version archivée</b> de la page courante.
65
+        </p>
66
+    </div>
67
+</div>
68
+% elif (result.folder.is_deleted) :
69
+<div class="row alert alert-info" role="alert">
70
+    <div class="col-sm-7 col-sm-offset-3">
71
+        <p>
72
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
73
+            Vous consultez <b>une version supprimée</b> de la page courante.
74
+        </p>
75
+    </div>
76
+</div>
77
+% endif
78
+
59 79
 <div class="row">
60 80
     <div class="col-sm-7 col-sm-offset-3">
61 81
 
@@ -64,10 +84,12 @@
64 84
         <div class="t-spacer-above">
65 85
             % if user_role > 1:
66 86
                 <div class="btn-group" role="group">
67
-                    <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
68
-                        <i class="fa fa-plus"></i> ${_('New ...')}
69
-                        <span class="caret"></span>
70
-                    </button>
87
+                    % if (not result.folder.is_archived and not result.folder.is_deleted) :
88
+                        <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
89
+                            <i class="fa fa-plus"></i> ${_('New ...')}
90
+                            <span class="caret"></span>
91
+                        </button>
92
+                    % endif
71 93
                     <ul class="dropdown-menu" role="menu">
72 94
                         % for content_type in result.folder.allowed_content_types:
73 95
                             % if content_type.id != 'folder' or user_role > 2:
@@ -183,4 +205,4 @@
183 205
     });
184 206
 </script>
185 207
 
186
-</div>
208
+</div>

+ 20 - 0
tracim/tracim/templates/page/getone.mak Vedi File

@@ -55,6 +55,26 @@
55 55
     </div>
56 56
 </div>
57 57
 
58
+% if (result.page.is_archived) :
59
+<div class="row alert alert-info" role="alert">
60
+    <div class="col-sm-7 col-sm-offset-3">
61
+        <p>
62
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
63
+            Vous consultez <b>une version archivée</b> de la page courante.
64
+        </p>
65
+    </div>
66
+</div>
67
+% elif (result.page.is_deleted) :
68
+<div class="row alert alert-info" role="alert">
69
+    <div class="col-sm-7 col-sm-offset-3">
70
+        <p>
71
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
72
+            Vous consultez <b>une version supprimée</b> de la page courante.
73
+        </p>
74
+    </div>
75
+</div>
76
+% endif
77
+
58 78
 % if result.page.selected_revision!='latest':
59 79
     <div class="row alert alert-warning" role="alert">
60 80
         <div class="col-sm-7 col-sm-offset-3">

+ 27 - 5
tracim/tracim/templates/thread/getone.mak Vedi File

@@ -57,6 +57,26 @@
57 57
     </div>
58 58
 </div>
59 59
 
60
+% if (result.thread.is_archived) :
61
+<div class="row alert alert-info" role="alert">
62
+    <div class="col-sm-7 col-sm-offset-3">
63
+        <p>
64
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
65
+            Vous consultez <b>une version archivée</b> de la page courante.
66
+        </p>
67
+    </div>
68
+</div>
69
+% elif (result.thread.is_deleted) :
70
+<div class="row alert alert-info" role="alert">
71
+    <div class="col-sm-7 col-sm-offset-3">
72
+        <p>
73
+            <span class="pull-left"><i class="fa fa-fw fa-2x fa-warning" alt="" title=""></i></span>
74
+            Vous consultez <b>une version supprimée</b> de la page courante.
75
+        </p>
76
+    </div>
77
+</div>
78
+% endif
79
+
60 80
 % if result.thread.status.id=='closed-deprecated':
61 81
     <div class="row alert alert-warning" role="alert">
62 82
         <div class="col-sm-7 col-sm-offset-3">
@@ -106,10 +126,12 @@
106 126
             % if result.thread.status.id!='open':
107 127
                 <p class="tracim-less-visible">${_('<b>Note</b>: In case you\'d like to post a reply, you must first open again the thread')|n}</p>
108 128
             % else:
109
-                <p class="t-half-spacer-below">
110
-                    ${BUTTON.DATA_TARGET_AS_TEXT('new-comment', _('Post a reply...'), 'btn btn-link')}
111
-                    ${FORMS.NEW_COMMENT_IN_THREAD('new-comment', result.thread.workspace.id, result.thread.parent.id, result.thread.id)}
112
-                </p>
129
+                % if (not result.thread.is_archived and not result.thread.is_deleted) :
130
+                    <p class="t-half-spacer-below">
131
+                        ${BUTTON.DATA_TARGET_AS_TEXT('new-comment', _('Post a reply...'), 'btn btn-link')}
132
+                        ${FORMS.NEW_COMMENT_IN_THREAD('new-comment', result.thread.workspace.id, result.thread.parent.id, result.thread.id)}
133
+                    </p>
134
+                % endif
113 135
             % endif
114 136
         % endif
115 137
     </div>
@@ -129,4 +151,4 @@
129 151
 ## % endfor
130 152
 ##
131 153
 
132
-</div>
154
+</div>

+ 18 - 2
tracim/tracim/templates/widgets/table_row.mak Vedi File

@@ -55,9 +55,17 @@
55 55
 </%def>
56 56
 
57 57
 <%def name="CONTENT(content)">
58
-    <tr class="t-table-row-${content.type.type} ${'archived' if content.is_archived else ''} ${'deleted' if content.is_deleted else ''}">
58
+    <tr class="t-table-row-${content.type.type}">
59 59
         <td>
60
-            <span class="${content.type.color}"><i class="fa-fw ${content.type.icon}"></i> ${content.type.label}</span>
60
+            <span class="${content.type.color}">
61
+                <i class="fa-fw ${content.type.icon}"></i>
62
+                % if (content.is_archived) :
63
+                    <i class="fa fa-archive fa-fw tracim-less-visible" title="Archivé"></i>
64
+                % elif (content.is_deleted) :
65
+                    <i class="fa fa-trash-o fa-fw tracim-less-visible" title="Supprimé"></i>
66
+                % endif
67
+                ${content.type.label}
68
+            </span>
61 69
 
62 70
             ## <span class="tracim-less-visible"><i class="fa fa-file-text-o fa-tw"></i> ${content}</span>
63 71
         </td>
@@ -77,7 +85,15 @@
77 85
                 % else:
78 86
                     <i class="fa fa-fw fa-close"></i>
79 87
                 % endif
88
+
80 89
                 <span class="t-less-visible">${content.status.label}</span>
90
+
91
+
92
+                % if (content.is_archived) :
93
+                    <div class="folder__list__item__status archived">Archivé</div>
94
+                % elif (content.is_deleted) :
95
+                    <div class="folder__list__item__status deleted">Supprimé</div>
96
+                % endif
81 97
             </td>
82 98
         % endif
83 99
         <td><span class="t-less-visible">${content.notes|n}</span></td>

+ 1 - 1
tracim/tracim/templates/widgets/ui.mak Vedi File

@@ -1,7 +1,7 @@
1 1
 <%namespace name="BUTTON" file="tracim.templates.widgets.button"/>
2 2
 
3 3
 <%def name="GENERIC_DISPLAY_VIEW_BUTTONS_CONTAINER(base_url)">
4
-    <div class="btn-group" role="group" aria-label="...">
4
+    <div class="btn-group folder__filter" role="group" aria-label="...">
5 5
         ${BUTTON.TEXT('', 'btn btn-default disabled', _('display...'))}
6 6
 
7 7
         <% show_deleted_param = 1 %>