Преглед на файлове

Fix: hide buttons when not editable

Bastien Sevajol (Algoo) преди 7 години
родител
ревизия
249ee9c934
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      tracim/tracim/templates/file/toolbar.mak
  2. 2 2
      tracim/tracim/templates/folder/toolbar.mak

+ 1 - 1
tracim/tracim/templates/file/toolbar.mak Целия файл

29
     </div>
29
     </div>
30
     <p></p>
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
         ## if the user can see the toolbar, it means he is the workspace manager.
33
         ## if the user can see the toolbar, it means he is the workspace manager.
34
         ## So now, we need to know if he alsa has right to delete workspaces
34
         ## So now, we need to know if he alsa has right to delete workspaces
35
         <div class="btn-group btn-group-vertical">
35
         <div class="btn-group btn-group-vertical">

+ 2 - 2
tracim/tracim/templates/folder/toolbar.mak Целия файл

36
         <p></p>
36
         <p></p>
37
     % endif
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
         <div class="btn-group btn-group-vertical">
40
         <div class="btn-group btn-group-vertical">
41
             ## This action is allowed for content managers only
41
             ## This action is allowed for content managers only
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>
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
         <p></p>
44
         <p></p>
45
     % endif
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
         ## if the user can see the toolbar, it means he is the workspace manager.
48
         ## if the user can see the toolbar, it means he is the workspace manager.
49
         ## So now, we need to know if he alsa has right to delete workspaces
49
         ## So now, we need to know if he alsa has right to delete workspaces
50
         <div class="btn-group btn-group-vertical">
50
         <div class="btn-group btn-group-vertical">