Browse Source

Fix template erreor when user see read only file

Bastien Sevajol (Algoo) 7 years ago
parent
commit
15e012958b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tracim/tracim/templates/file/getone.mak

+ 1 - 1
tracim/tracim/templates/file/getone.mak View File

151
     % else:
151
     % else:
152
         % if h.user_role(fake_api.current_user, result.file.workspace)<=1: # User must be a contributor to be allowed to upload files
152
         % if h.user_role(fake_api.current_user, result.file.workspace)<=1: # User must be a contributor to be allowed to upload files
153
             ${WIDGETS.SECURED_SECTION_TITLE(fake_api.current_user, result.file.workspace, 'file-revisions', _('File revisions'))}
153
             ${WIDGETS.SECURED_SECTION_TITLE(fake_api.current_user, result.file.workspace, 'file-revisions', _('File revisions'))}
154
-            <p>${_('This file contains {} revision(s)').format(sum(1 for revision in result.file.revisions if revision.action.id=='revision'))}</p>
154
+            <p>${_('This file contains {} revision(s)').format(result.file.revision_nb)}</p>
155
         % else:
155
         % else:
156
             % if (h.user_role(fake_api.current_user, result.file.workspace)>1 and not result.file.is_archived and not result.file.is_deleted):
156
             % if (h.user_role(fake_api.current_user, result.file.workspace)>1 and not result.file.is_archived and not result.file.is_deleted):
157
                 ${BUTTON.DATA_TARGET_AS_TEXT('new-file-revision', _('upload a new revision and/or comment...'), 'btn btn-success t-spacer-below')}
157
                 ${BUTTON.DATA_TARGET_AS_TEXT('new-file-revision', _('upload a new revision and/or comment...'), 'btn btn-success t-spacer-below')}