Ver código fonte

Fix: hide buttons when not editable

Bastien Sevajol (Algoo) 7 anos atrás
pai
commit
249ee9c934

+ 1 - 1
tracim/tracim/templates/file/toolbar.mak Ver arquivo

@@ -29,7 +29,7 @@
29 29
     </div>
30 30
     <p></p>
31 31
 
32
-    % if user.profile.id>=3 or h.user_role(user, workspace)>=4 and file.is_editable:
32
+    % if (user.profile.id>=3 or h.user_role(user, workspace)>=4) and file.is_editable:
33 33
         ## if the user can see the toolbar, it means he is the workspace manager.
34 34
         ## So now, we need to know if he alsa has right to delete workspaces
35 35
         <div class="btn-group btn-group-vertical">

+ 2 - 2
tracim/tracim/templates/folder/toolbar.mak Ver arquivo

@@ -36,7 +36,7 @@
36 36
         <p></p>
37 37
     % endif
38 38
     
39
-    % if user.profile.id>=3 or h.user_role(user, workspace)>=4 and folder.is_editable:
39
+    % if (user.profile.id>=3 or h.user_role(user, workspace)>=4) and folder.is_editable:
40 40
         <div class="btn-group btn-group-vertical">
41 41
             ## This action is allowed for content managers only
42 42
             <a title="${_('Move current folder')}" class="btn btn-default ${move_disabled}" data-toggle="modal" data-target="#folder-move-modal-dialog" data-remote="${tg.url('/workspaces/{}/folders/{}/location/{}/edit'.format(folder.workspace.id, folder.id, folder.id))}" ><i class="fa fa-arrows fa-fw tracim-less-visible"></i> ${_('Move')}</a>
@@ -44,7 +44,7 @@
44 44
         <p></p>
45 45
     % endif
46 46
 
47
-    % if user.profile.id>=3 or h.user_role(user, workspace)>=4 and folder.is_editable:
47
+    % if (user.profile.id>=3 or h.user_role(user, workspace)>=4) and folder.is_editable:
48 48
         ## if the user can see the toolbar, it means he is the workspace manager.
49 49
         ## So now, we need to know if he alsa has right to delete workspaces
50 50
         <div class="btn-group btn-group-vertical">