<% # encoding: utf-8 # # Redmine plugin for Document Management System "Features" # # Copyright © 2011 Vít Jonáš # Copyright © 2012 Daniel Munn # Copyright © 2011-20 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. %> <% html_title(l(:dmsf)) %>
<% if @file_manipulation_allowed %> <% if @file.locked_for_user? %> <% if User.current.allowed_to?(:force_file_unlock, @project) %> <%= link_to_if(@file.unlockable?, l(:button_unlock), unlock_dmsf_files_path(id: @file), title: l(:title_unlock_file), class: 'icon icon-unlock')%> <% end %> <% else %> <% if @file.locked? %> <%= link_to_if(@file.unlockable?, l(:button_unlock), unlock_dmsf_files_path(id: @file), title: l(:title_unlock_file), class: 'icon icon-unlock') %> <% else %> <%= link_to(l(:button_lock), lock_dmsf_files_path(id: @file), title: l(:title_lock_file), class: 'icon icon-lock') %> <% end %> <% if @file.notification %> <%= link_to(l(:label_notifications_off), notify_deactivate_dmsf_files_path(id: @file), title: l(:title_notifications_active_deactivate), class: 'icon icon-email') %> <% else %> <%= link_to(l(:label_notifications_on), notify_activate_dmsf_files_path(id: @file), title: l(:title_notifications_not_active_activate), class: 'icon icon-email-add') %> <% end %> <%= link_to(l(:label_link_to), new_dmsf_link_path(project_id: @project.id, dmsf_folder_id: @file.dmsf_folder ? @file.dmsf_folder.id : nil, dmsf_file_id: @file.id, type: 'link_to'), title: l(:title_create_link), class: 'icon icon-link') %> <%= link_to("#{l(:button_copy)}/#{l(:button_move)}", copy_file_path(id: @file), title: l(:title_copy), class: 'icon icon-copy') %> <%= delete_link(dmsf_file_path(id: @file, details: true)) if @file_delete_allowed %> <% end %> <% end %>
<%= render(partial: '/dmsf/path', locals: { folder: @file.dmsf_folder, filename: @file.title, title: nil}) %> <% if @file_manipulation_allowed && !@file.locked_for_user? %> <%= error_messages_for('file') %> <%= error_messages_for('revision') %> <%= render(partial: 'file_new_revision') %> <% end %>
<%= label_tag('', l(:label_document)) %> #<%= "#{@file.id}" %>

<%= l(:heading_revisions) %>

<% @file.dmsf_file_revisions.visible[@revision_pages.offset, @revision_pages.per_page].each do |revision| %>
<%= link_to_function image_tag('group.png'), "$('#revision_access-#{revision.id}').toggle()", title: l(:title_download_entries) %> <%= link_to image_tag('download.png'), view_dmsf_file_path(@file, download: revision), title: l(:title_title_version_version_download, title: h(revision.title), version: revision.version) %> <%= link_to image_tag('close_hl.png'), obsolete_revision_path(revision), data: { confirm: l(:text_are_you_sure) }, title: l(:title_obsolete_revision) if @file_manipulation_allowed && (revision.workflow == DmsfWorkflow::STATE_APPROVED) %> <%= link_to image_tag('delete.png'), delete_revision_path(revision), data: { confirm: l(:text_are_you_sure) }, title: l(:title_delete_revision) if @file_delete_allowed && (@file.dmsf_file_revisions.visible.count > 1) %>
<%= l(:info_revision, rev: revision.id) %> <%= (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)).downcase %> <%= l(:info_changed_by_user, :changed => format_time(revision.updated_at)) %> <%= link_to(revision.user.name, user_path(revision.user)) if revision.user %>
<%= content_tag :div, l(:label_title), class: 'label' %> <%= content_tag :div, h(revision.title), class: 'value' %>
<% if revision.description.present? %>
<%= content_tag :div, l(:label_description), class: 'label' %> <% text = clean_wiki_text(textilizable(h revision.description)) %> <%= content_tag :div, text.html_safe, class: 'value wiki' %>
<% end %>
<%= content_tag :div, l(:label_dmsf_version), class: 'label' %> <%= content_tag :div, "#{revision.version}", class: 'value' %>
<%= content_tag :div, l(:label_size), class: 'label' %> <%= content_tag :div, number_to_human_size(revision.size), class: 'value' %>
<% wf = DmsfWorkflow.find_by(id: revision.dmsf_workflow_id) %> <% if wf %>
<%= content_tag :div, l(:label_workflow), class: 'label' %>
<%= "#{wf.name} - " %> <%= link_to(revision.workflow_str(false), log_dmsf_workflow_path(project_id: @project.id, id: wf.id, dmsf_file_revision_id: revision.id), title: revision.workflow_tooltip, remote: true) %>
<% end %> <% if revision.comment.present? %>
<%= content_tag :div, l(:label_comment), class: 'label' %> <% text = clean_wiki_text(textilizable(h revision.comment)) %> <%= content_tag :div, text.html_safe, class: 'value wiki' %>
<% end %>
<%= content_tag :div, l(:label_file), class: 'label' %>
<% path = "#{revision.dmsf_file.dmsf_folder.dmsf_path_str}/" if revision.dmsf_file.dmsf_folder %> <%= h("#{path}#{revision.name}") %>
<%= content_tag :div, l(:label_mime), class: 'label' %> <%= content_tag :div, revision.mime_type, class: 'value' %>
<% if revision.digest.present? %>
<%= content_tag :div, l(:field_digest), class: 'label' %> <%= content_tag :div, "#{revision.digest_type}: #{revision.digest}", class: 'value wiki' %>
<% end %> <%= render 'dmsf/custom_fields', object: revision %>
" style="display:none"> <% if @file_manipulation_allowed %> <%= render partial: 'revision_access', locals: { revision: revision, query: @query, revision_access_count: @revision_access_count, revision_access_pages: @revision_access_pages } %> <% end %>

<% end %> <%= pagination_links_full @revision_pages, @file.dmsf_file_revisions.visible.count %> <%= late_javascript_tag do %> $('.dmsf_controls').show(); $('#browser').show(); $('a.delete-revision').click(function(event) { if(!window.confirm('<%= l(:text_are_you_sure) %>')) { event.preventDefault(); } }); $('a.delete-entry').click(function(event) { if(!window.confirm('<%= l(:text_are_you_sure) %>')) { event.preventDefault(); } }); $('#file_upload_box').change(function() { if($("input[name='version']:checked").val() == '0') { $('#version_1').prop('checked', true); } $('#version_0').prop('disabled', true); }); $('#newRevisionFormContentToggle').click(function() { if($('#newRevisionFormContent').is(':visible')) { $(this).text('[+]'); $('#newRevisionFormContent').hide(); } else { $(this).text('[-]'); $('#newRevisionFormContent').show(); } }); $('.dmsf_list').dataTable({ language: { url: "<%= plugin_asset_path(:redmine_dmsf, 'javascripts', json_url) %>" }, oLanguage: { sSearch: "<%= l(:description_filter) %>:" } }); <% end %> <% if @revision.valid? && @file.valid? %> <%= late_javascript_tag do %> $('#newRevisionFormContentToggle').text('[+]'); $('#newRevisionFormContent').hide(); <% end %> <% end %> <% content_for :header_tags do %> <%= stylesheet_link_tag 'jquery.dataTables/datatables.min.css', plugin: :redmine_dmsf %> <%= javascript_include_tag 'jquery.dataTables/datatables.min.js', plugin: :redmine_dmsf, defer: true %> <% end %>