From 35dd8ff850ff8fe3d626bc0fae94fa8b35888c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Thu, 30 Jan 2020 17:05:11 +0100 Subject: [PATCH] #1080 Context menu --- .../dmsf_context_menus_controller.rb | 65 +++++++++++++---- app/models/dmsf_folder.rb | 8 ++- app/views/dmsf/_dir.html.erb | 46 +----------- app/views/dmsf/_dir_trash.html.erb | 21 +----- app/views/dmsf/_file.html.erb | 53 +------------- app/views/dmsf/_file_trash.html.erb | 15 +--- app/views/dmsf/_tree_view.erb | 2 +- app/views/dmsf/_url.html.erb | 16 +---- app/views/dmsf/_url_trash.html.erb | 10 +-- app/views/dmsf/edit.html.erb | 2 +- app/views/dmsf/show.html.erb | 3 +- .../_approval_workflow.html.erb | 52 ++++++++++++++ app/views/dmsf_context_menus/_file.html.erb | 72 +++++++++++++++++++ .../dmsf_context_menus/_file_trash.html.erb | 33 +++++++++ app/views/dmsf_context_menus/_folder.html.erb | 65 +++++++++++++++++ .../dmsf_context_menus/_folder_trash.html.erb | 33 +++++++++ .../dmsf_context_menus/_multiple.html.erb | 37 ++++++++++ .../_multiple_trash.html.erb | 31 ++++++++ app/views/dmsf_context_menus/_url.html.erb | 26 +++++++ app/views/dmsf_context_menus/dmsf.html.erb | 48 +++++-------- app/views/dmsf_context_menus/trash.html.erb | 20 +++--- app/views/dmsf_files/_link.html.erb | 2 +- .../_approval_workflow_button.html.erb | 2 +- assets/stylesheets/redmine_dmsf.css | 9 ++- config/locales/cs.yml | 3 +- config/locales/de.yml | 3 +- config/locales/en.yml | 3 +- config/locales/es.yml | 3 +- config/locales/fr.yml | 3 +- config/locales/hu.yml | 3 +- config/locales/it.yml | 3 +- config/locales/ja.yml | 3 +- config/locales/ko.yml | 3 +- config/locales/nl.yml | 3 +- config/locales/pl.yml | 3 +- config/locales/pt-BR.yml | 3 +- config/locales/ru.yml | 3 +- config/locales/sl.yml | 3 +- config/locales/zh-TW.yml | 3 +- config/locales/zh.yml | 3 +- .../hooks/views/issue_view_hooks.rb | 2 +- 41 files changed, 465 insertions(+), 256 deletions(-) create mode 100644 app/views/dmsf_context_menus/_approval_workflow.html.erb create mode 100644 app/views/dmsf_context_menus/_file.html.erb create mode 100644 app/views/dmsf_context_menus/_file_trash.html.erb create mode 100644 app/views/dmsf_context_menus/_folder.html.erb create mode 100644 app/views/dmsf_context_menus/_folder_trash.html.erb create mode 100644 app/views/dmsf_context_menus/_multiple.html.erb create mode 100644 app/views/dmsf_context_menus/_multiple_trash.html.erb create mode 100644 app/views/dmsf_context_menus/_url.html.erb diff --git a/app/controllers/dmsf_context_menus_controller.rb b/app/controllers/dmsf_context_menus_controller.rb index b37a9aac..0fdcfbc9 100644 --- a/app/controllers/dmsf_context_menus_controller.rb +++ b/app/controllers/dmsf_context_menus_controller.rb @@ -25,17 +25,48 @@ class DmsfContextMenusController < ApplicationController before_action :find_project before_action :find_folder - before_action :find_file, :except => [:trash] + before_action :find_dmsf_file + before_action :find_dmsf_folder def dmsf - @disabled = params[:ids].blank? - render :layout => false + if @dmsf_file + @locked = @dmsf_file.locked? + @unlockable = @dmsf_file.unlockable? && (!@dmsf_file.locked_for_user?) && + User.current.allowed_to?(:force_file_unlock, @project) + @allowed = User.current.allowed_to? :file_manipulation, @project + @email_allowed = User.current.allowed_to?(:email_documents, @project) + elsif @dmsf_folder + @locked = @dmsf_folder.locked? + @unlockable = @dmsf_folder.unlockable? && (!@dmsf_folder.locked_for_user?) && + User.current.allowed_to?(:force_file_unlock, @project) + @allowed = User.current.allowed_to?(:folder_manipulation, @project) + @email_allowed = User.current.allowed_to?(:email_documents, @project) + elsif @dmsf_link + @allowed = User.current.allowed_to? :file_manipulation, @project + else + @allowed = User.current.allowed_to?(:folder_manipulation, @project) && + User.current.allowed_to?(:file_delete, @project) + @email_allowed = User.current.allowed_to?(:email_documents, @project) + end + render layout: false rescue ActiveRecord::RecordNotFound render_404 end def trash - render :layout => false + if @dmsf_file + @allowed_restore = User.current.allowed_to? :file_manipulation, @project + @allowed_delete = User.current.allowed_to? :file_delete, @project + elsif @dmsf_folder + @allowed = User.current.allowed_to?(:folder_manipulation, @project) + elsif @dmsf_link + @allowed_restore = User.current.allowed_to? :file_manipulation, @project + @allowed_delete = User.current.allowed_to? :file_delete, @project + else + @allowed = User.current.allowed_to?(:folder_manipulation, @project) && + User.current.allowed_to?(:file_manipulation, @project) + end + render layout: false rescue ActiveRecord::RecordNotFound render_404 end @@ -50,16 +81,24 @@ class DmsfContextMenusController < ApplicationController render_404 end - def find_file - if params[:ids].present? - selected_files = params[:ids].select{ |x| x =~ /file-\d+/ }.map{ |x| $1.to_i if x =~ /file-(\d+)/ } - selected_file_links = params[:ids].select{ |x| x =~ /file-link-\d+/ }.map{ |x| $1.to_i if x =~ /file-link-(\d+)/ } - selected_file_links.each do |id| - target_id = DmsfLink.where(id: id).pluck(:target_id).first - selected_files << target_id if target_id && !selected_files.include?(target_id) + def find_dmsf_file + if (params[:ids].size == 1) && (!@dmsf_folder) + if params[:ids][0] =~ /file-(\d+)/ + @dmsf_file = DmsfFile.find_by(id: $1) + elsif params[:ids][0] =~ /(file|url)-link-(\d+)/ + @dmsf_link = DmsfLink.find_by(id: $2) + @dmsf_file = DmsfFile.find_by(id: @dmsf_link.target_id) if @dmsf_link && @dmsf_link.target_type != 'DmsfUrl' end - if (selected_files.size == 1) && (params[:ids].size == 1) - @file = DmsfFile.find_by(id: selected_files[0]) + end + end + + def find_dmsf_folder + if (params[:ids].size == 1) && (!@dmsf_file) + if params[:ids][0] =~ /folder-(\d+)/ + @dmsf_folder = DmsfFolder.find_by(id: $1) + elsif params[:ids][0] =~ /folder-link-(\d+)/ + @dmsf_link = DmsfLink.find_by(id: $1) + @dmsf_folder = DmsfFolder.find_by(id: @dmsf_link.target_id) if @dmsf_link end end end diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb index f1f9aff0..3aa9ab12 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -139,7 +139,7 @@ class DmsfFolder < ActiveRecord::Base if locked? errors[:base] << l(:error_folder_is_locked) return false - elsif !dmsf_folders.visible.empty? || !dmsf_files.visible.empty? || !dmsf_links.visible.empty? + elsif !empty? errors[:base] << l(:error_folder_is_not_empty) return false end @@ -152,6 +152,10 @@ class DmsfFolder < ActiveRecord::Base end end + def empty? + !(dmsf_folders.visible.exists? || dmsf_files.visible.exists? || dmsf_links.visible.exists?) + end + def deleted? deleted == STATUS_DELETED end @@ -163,7 +167,7 @@ class DmsfFolder < ActiveRecord::Base end self.deleted = STATUS_ACTIVE self.deleted_by_user = nil - save! + save end def dmsf_path diff --git a/app/views/dmsf/_dir.html.erb b/app/views/dmsf/_dir.html.erb index 0db29774..b0b90fca 100644 --- a/app/views/dmsf/_dir.html.erb +++ b/app/views/dmsf/_dir.html.erb @@ -79,51 +79,7 @@ <% end %> <% end %> - - <% if @folder_manipulation_allowed && !(subfolder && subfolder.system) %> - <% if subfolder && subfolder.locked? %> - - <% if subfolder.unlockable? && (!subfolder.locked_for_user? || @force_file_unlock_allowed) %> - <%= link_to('', unlock_dmsf_path(:id => project, :folder_id => subfolder), - :title => subfolder.get_locked_title, - :class => 'icon-only icon-unlock') %> - <% else %> - - <% end %> - <% else %> - <% if subfolder %> - <%= link_to('', edit_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:link_edit, :title => h(subfolder.title)), - :class => 'icon-only icon-edit') %> - <% else %> - <%= link_to('', edit_root_dmsf_path(:id => @project), - :title => l(:link_edit, :title => l(:link_documents)), - :class => 'icon-only icon-edit') %> - <% end %> - <% if subfolder %> - <%= link_to('', lock_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_lock_file), - :class => 'icon-only icon-lock') %> - <% else %> - - <% end %> - <% if (subfolder && subfolder.notification) || (!subfolder && project.dmsf_notification) %> - <%= link_to('', notify_deactivate_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_notifications_active_deactivate), - :class => 'icon-only icon-email') %> - <% else %> - <%= link_to('', notify_activate_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_notifications_not_active_activate), - :class => 'icon-only icon-email-add') %> - <% end %> - <%= link_to('', link ? dmsf_link_path(link) : delete_dmsf_path(:id => project, :folder_id => subfolder), - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete), - :method => :delete, - :class => 'icon-only icon-del') %> - <% end %> - <% end %> - +<%= link_to_context_menu %> <%= position %> 0 <%= subfolder.modified.to_i if subfolder %> diff --git a/app/views/dmsf/_dir_trash.html.erb b/app/views/dmsf/_dir_trash.html.erb index d785ca6f..d612721b 100644 --- a/app/views/dmsf/_dir_trash.html.erb +++ b/app/views/dmsf/_dir_trash.html.erb @@ -63,26 +63,7 @@ <% end %> <% end %> - - <% if @folder_manipulation_allowed %> - <%= link_to('', link ? restore_dmsf_link_path(:id => link) : restore_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_restore), - :class => 'icon-only icon-cancel') %> - <% if link %> - <%= link_to('', dmsf_link_path(:id => link, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete), - :class => 'icon-only icon-del') %> - <% else %> - <%= link_to('', delete_dmsf_path(:id => project, :folder_id => subfolder, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete), - :method => :delete, - :class => 'icon-only icon-del') %> - <% end %> - <% end %> - +<%= link_to_context_menu %> 0 0 <%= subfolder.modified.to_i if subfolder %> diff --git a/app/views/dmsf/_file.html.erb b/app/views/dmsf/_file.html.erb index f394c0d3..fd5a706c 100644 --- a/app/views/dmsf/_file.html.erb +++ b/app/views/dmsf/_file.html.erb @@ -83,58 +83,7 @@ <% end %> <% end %> - - <% if @file_manipulation_allowed %> - <%= link_to('', dmsf_file_path(:id => file), - :title => l(:link_details, :title => h(file.last_revision.title)), - :class => 'icon-only icon-edit') %> - <% if !file.locked? %> - <%= link_to('', lock_dmsf_files_path(:id => file), - :title => l(:title_lock_file), - :class => 'icon-only icon-lock') %> - <% elsif file.unlockable? && (!file.locked_for_user? || @force_file_unlock_allowed) %> - <%= link_to('', unlock_dmsf_files_path(:id => file), - :title => file.get_locked_title, - :class => 'icon-only icon-unlock') %> - <% else %> - - <% end %> - <% if !file.locked? %> - <% if file.notification %> - <%= link_to('', notify_deactivate_dmsf_files_path(:id => file), - :title => l(:title_notifications_active_deactivate), - :class => 'icon-only icon-email') %> - <% else %> - <%= link_to('', notify_activate_dmsf_files_path(:id => file), - :title => l(:title_notifications_not_active_activate), - :class => 'icon-only icon-email-add') %> - <% end %> - <% if link %> - <%= link_to('', dmsf_link_path(link), - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete), - :method => :delete, - :class => 'icon-only icon-del') %> - <% else %> - <% if @file_delete_allowed %> - <%= link_to('', dmsf_file_path(:id => file), - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete), - :method => :delete, - :class => 'icon-only icon-del') %> - <% else %> - - <% end %> - <% end %> - <% else %> - - - <% end %> - <% end %> - <%= render(:partial => 'dmsf_workflows/approval_workflow_button', - :locals => {:file => file, :file_approval_allowed => @file_approval_allowed, - :workflows_available => @workflows_available, :project => project, :wf => wf, :dmsf_link_id => nil }) %> - +<%= link_to_context_menu %> <%= position %> <%= file.last_revision.size %> <%= file.last_revision.updated_at.to_i %> diff --git a/app/views/dmsf/_file_trash.html.erb b/app/views/dmsf/_file_trash.html.erb index 38b6c26e..4784678f 100644 --- a/app/views/dmsf/_file_trash.html.erb +++ b/app/views/dmsf/_file_trash.html.erb @@ -63,20 +63,7 @@ <% end %> <% end %> - - <% if @file_manipulation_allowed %> - <%= link_to('', link ? restore_dmsf_link_path(:id => link) : restore_dmsf_file_path(:id => file), - :title => l(:title_restore), - :class => 'icon-only icon-cancel') %> - <% end %> - <% if @file_delete_allowed %> - <%= link_to('', link ? dmsf_link_path(:id => link, :commit => 'yes') : dmsf_file_path(:id => file, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete), - :class => 'icon-only icon-del') %> - <% end %> - +<%= link_to_context_menu %> 1 <%= file.last_revision.size %> <%= file.last_revision.updated_at.to_i %> diff --git a/app/views/dmsf/_tree_view.erb b/app/views/dmsf/_tree_view.erb index f8b35509..2c414cf7 100644 --- a/app/views/dmsf/_tree_view.erb +++ b/app/views/dmsf/_tree_view.erb @@ -67,6 +67,6 @@ - <%= render(:partial => 'dmsf/dmsf_rows') %> + <%= render partial: 'dmsf/dmsf_rows' %> diff --git a/app/views/dmsf/_url.html.erb b/app/views/dmsf/_url.html.erb index 40144f52..e6b93111 100644 --- a/app/views/dmsf/_url.html.erb +++ b/app/views/dmsf/_url.html.erb @@ -66,21 +66,7 @@ <% end %> <% end %> - - - - - <% if @file_delete_allowed %> - <%= link_to('', - dmsf_link_path(link), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete), - :class => "icon icon-del") %> - <% else %> - - <% end %> - +<%= link_to_context_menu %> <%= position %> link.updated_at.to_i diff --git a/app/views/dmsf/_url_trash.html.erb b/app/views/dmsf/_url_trash.html.erb index c0c9f3ac..c7ceb139 100644 --- a/app/views/dmsf/_url_trash.html.erb +++ b/app/views/dmsf/_url_trash.html.erb @@ -62,15 +62,7 @@ <% end %> <% end %> - - <%= link_to_if(@file_manipulation_allowed, '', restore_dmsf_link_path(:id => link), - :title => l(:title_restore), :class => "icon icon-cancel") %> - <% if @file_delete_allowed %> - <%= link_to_if(@file_delete_allowed, '', dmsf_link_path(:id => link, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, - :title => l(:title_delete), :class => "icon icon-del" ) %> - <% end %> - +<%= link_to_context_menu %> 1 <%= link.updated_at.to_i %> diff --git a/app/views/dmsf/edit.html.erb b/app/views/dmsf/edit.html.erb index 80111e0a..cd9b76d8 100644 --- a/app/views/dmsf/edit.html.erb +++ b/app/views/dmsf/edit.html.erb @@ -55,7 +55,7 @@ <% unless @folder.locked? %> <%= link_to(l(:button_delete), delete_dmsf_path(:id => @project, :folder_id => @folder), :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete), :class => 'icon icon-del', :method => :delete) %> + :title => l(:button_delete), :class => 'icon icon-del', :method => :delete) %> <% end %> <% end %> diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index ee3e971c..00f0d711 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -82,8 +82,7 @@ <% end %> -<%= render(:partial => 'path', - :locals => {:folder => @folder, :filename => nil, :title => nil}) %> +<%= render partial: 'path', locals: { folder: @folder, filename: nil, title: nil } %>
diff --git a/app/views/dmsf_context_menus/_approval_workflow.html.erb b/app/views/dmsf_context_menus/_approval_workflow.html.erb new file mode 100644 index 00000000..ecdf46be --- /dev/null +++ b/app/views/dmsf_context_menus/_approval_workflow.html.erb @@ -0,0 +1,52 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +<% workflows_available = DmsfWorkflow.where(['project_id = ? OR project_id IS NULL', project.id]).exists? %> +<% wf = DmsfWorkflow.find_by(id: dmsf_file.last_revision.dmsf_workflow_id) if dmsf_file.last_revision.dmsf_workflow_id %> +<% file_approval_allowed = User.current.allowed_to?(:file_approval, project) %> +<% allowed = User.current && (dmsf_file.last_revision.dmsf_workflow_assigned_by_user == User.current) && wf %> + +<% if file_approval_allowed %> + <% case dmsf_file.last_revision.workflow %> + <% when DmsfWorkflow::STATE_WAITING_FOR_APPROVAL %> + <% if wf %> + <% assignments = wf.next_assignments(dmsf_file.last_revision.id) %> + <% index = assignments.find_index{ |assignment| assignment.user_id == User.current.id } if assignments %> + <%= context_menu_link l(:title_approval), action_dmsf_workflow_path(project_id: project.id, id: wf.id, + dmsf_workflow_step_assignment_id: assignments[index].id, + dmsf_file_revision_id: dmsf_file.last_revision.id), + remote: true, class: 'icon icon-ok', id: 'dmsf-cm-workflow', + disabled: !assignments || !index %> + <% end %> + <% when DmsfWorkflow::STATE_ASSIGNED %> + <%= context_menu_link l(:title_start), start_dmsf_workflow_path(id: dmsf_file.last_revision.dmsf_workflow_id, + dmsf_file_revision_id: dmsf_file.last_revision.id), + class: 'icon icon-ok', disabled: !allowed %> + <% when DmsfWorkflow::STATE_APPROVED, DmsfWorkflow::STATE_REJECTED, DmsfWorkflow::STATE_OBSOLETE %> + <%# %> + <% else %> + <%= context_menu_link l(:title_assignment), assign_dmsf_workflow_path(id: project.id, project_id: project.id, + dmsf_file_revision_id: dmsf_file.last_revision.id), + remote: true, class: 'icon icon-ok', id: 'dmsf-cm-workflow', + disabled: locked || !workflows_available %> + <% end %> +<% end %> diff --git a/app/views/dmsf_context_menus/_file.html.erb b/app/views/dmsf_context_menus/_file.html.erb new file mode 100644 index 00000000..a02025b8 --- /dev/null +++ b/app/views/dmsf_context_menus/_file.html.erb @@ -0,0 +1,72 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:button_edit), dmsf_file_path(id: dmsf_file), class: 'icon icon-edit', + disabled: !allowed || locked %> +
  • +
  • + <% if locked %> + <%= context_menu_link l(:button_unlock), unlock_dmsf_files_path(id: dmsf_file), class: 'icon icon-unlock', + disabled: !allowed || !unlockable %> + <% else %> + <%= context_menu_link l(:button_lock), lock_dmsf_files_path(id: dmsf_file), class: 'icon icon-lock', + disabled: !allowed %> + <% end %> +
  • +
  • + <% if dmsf_file.notification %> + <%= context_menu_link l(:label_notifications_off), notify_deactivate_dmsf_files_path(id: dmsf_file), + class: 'icon icon-email', disabled: !allowed || locked %> + <% else %> + <%= context_menu_link l(:label_notifications_on), notify_activate_dmsf_files_path(id: dmsf_file), + class: 'icon icon-email-add', disabled: !allowed || locked %> + <% end %> +
  • +
  • + <%= context_menu_link l(:button_delete), dmsf_link ? dmsf_link_path(dmsf_link) : dmsf_file_path(dmsf_file), + method: :delete, class: 'icon icon-del', data: { confirm: l(:text_are_you_sure) }, + id: 'dmsf-cm-delete', disabled: !allowed || locked %> +
  • +
  • + <%= render(partial: 'approval_workflow', locals: { dmsf_file: dmsf_file, project: project, locked: locked }) %> +
  • +
  • +<%= context_menu_link l(:button_download), view_dmsf_file_path(dmsf_file), class: 'icon icon-download', + disabled: false %> +
  • +
  • +<%= context_menu_link l(:field_mail), entries_operations_dmsf_path(id: @project, folder_id: folder, + ids: params[:ids], email_entries: true), method: :post, class: 'icon icon-email', + disabled: !email_allowed %> +
  • +
  • + <% if dmsf_file.last_revision && dmsf_file.last_revision.protocol %> + <% url = "#{dmsf_file.last_revision.protocol}:ofe|u|#{Setting.protocol.strip}://#{Setting.host_name.strip}/dmsf/webdav/#{Addressable::URI.escape(RedmineDmsf::Webdav::ProjectResource.create_project_name(dmsf_file.project))}/" %> + <% if dmsf_file.dmsf_folder %> + <% url << "#{dmsf_file.dmsf_folder.dmsf_path_str}/" %> + <% end %> + <% url << dmsf_file.name %> + <% end %> + <%= context_menu_link l(:button_edit_content), url, class: "icon icon-file #{DmsfHelper.filetype_css(dmsf_file.name)}", + disabled: url.blank? || locked %> +
  • diff --git a/app/views/dmsf_context_menus/_file_trash.html.erb b/app/views/dmsf_context_menus/_file_trash.html.erb new file mode 100644 index 00000000..133f7f25 --- /dev/null +++ b/app/views/dmsf_context_menus/_file_trash.html.erb @@ -0,0 +1,33 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:title_restore), + dmsf_link ? restore_dmsf_link_path(id: dmsf_link) : restore_dmsf_file_path(id: dmsf_file), + class: 'icon icon-cancel', disabled: !allowed_restore %> +
  • +
  • + <%= context_menu_link l(:button_delete), + dmsf_link ? dmsf_link_path(id: dmsf_link, commit: 'yes') : dmsf_file_path(id: dmsf_file, commit: 'yes'), + data: { confirm: l(:text_are_you_sure) }, method: :delete, class: 'icon icon-del', + id: 'dmsf-cm-delete', disabled: !allowed_delete %> +
  • diff --git a/app/views/dmsf_context_menus/_folder.html.erb b/app/views/dmsf_context_menus/_folder.html.erb new file mode 100644 index 00000000..c7719966 --- /dev/null +++ b/app/views/dmsf_context_menus/_folder.html.erb @@ -0,0 +1,65 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:button_edit), edit_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-edit', + disabled: !allowed || locked %> +
  • +
  • + <% if locked %> + <%= context_menu_link l(:button_unlock), unlock_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-unlock', + disabled: !allowed || !unlockable %> + <% else %> + <%= context_menu_link l(:button_lock), lock_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-lock', + disabled: !allowed %> + <% end %> +
  • +
  • + <% if dmsf_folder.notification %> + <%= context_menu_link l(:label_notifications_off), notify_deactivate_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-email', + disabled: !allowed || locked || !dmsf_folder.notification? %> + <% else %> + <%= context_menu_link l(:label_notifications_on), notify_activate_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-email-add', + disabled: !allowed || locked || dmsf_folder.notification? %> + <% end %> +
  • +
  • + <%= context_menu_link l(:button_delete), + dmsf_link ? dmsf_link_path(dmsf_link) : delete_dmsf_path(id: project, folder_id: dmsf_folder), + data: { confirm: l(:text_are_you_sure) }, method: :delete, class: 'icon icon-del', id: 'dmsf-cm-delete', + disabled: !allowed || locked || !dmsf_folder.empty? %> +
  • +
  • + <%= context_menu_link l(:button_download), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], download_entries: true), method: :post, class: 'icon icon-download', + id: 'dmsf-cm-download', disabled: false %> +
  • +
  • + <%= context_menu_link l(:field_mail), entries_operations_dmsf_path(id: @project, folder_id: folder, + ids: params[:ids], email_entries: true), method: :post, class: 'icon icon-email', + disabled: !email_allowed %> +
  • diff --git a/app/views/dmsf_context_menus/_folder_trash.html.erb b/app/views/dmsf_context_menus/_folder_trash.html.erb new file mode 100644 index 00000000..f71cef46 --- /dev/null +++ b/app/views/dmsf_context_menus/_folder_trash.html.erb @@ -0,0 +1,33 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:title_restore), + dmsf_link ? restore_dmsf_link_path(id: dmsf_link) : restore_dmsf_path(id: project, folder_id: dmsf_folder), + class: 'icon icon-cancel', disabled: !allowed %> +
  • +
  • + <%= context_menu_link l(:button_delete), + dmsf_link ? dmsf_link_path(id: dmsf_link, commit: 'yes') : delete_dmsf_path(id: project, folder_id: dmsf_folder, commit: 'yes'), + data: { confirm: l(:text_are_you_sure) }, method: :delete, class: 'icon icon-del', + id: 'dmsf-cm-delete', disabled: !allowed %> +
  • diff --git a/app/views/dmsf_context_menus/_multiple.html.erb b/app/views/dmsf_context_menus/_multiple.html.erb new file mode 100644 index 00000000..52604bc9 --- /dev/null +++ b/app/views/dmsf_context_menus/_multiple.html.erb @@ -0,0 +1,37 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:button_download), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], download_entries: true), method: :post, class: 'icon icon-download', disabled: false %> +
  • +
  • + <%= context_menu_link l(:field_mail), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], email_entries: true), method: :post, class: 'icon icon-email', + disabled: !email_allowed %> +
  • +
  • + <%= context_menu_link l(:button_delete), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], delete_entries: true), method: :post, class: 'icon icon-del', + data: { confirm: l(:text_are_you_sure) }, id: 'dmsf-cm-delete', + disabled: !allowed %> +
  • diff --git a/app/views/dmsf_context_menus/_multiple_trash.html.erb b/app/views/dmsf_context_menus/_multiple_trash.html.erb new file mode 100644 index 00000000..3da86d9e --- /dev/null +++ b/app/views/dmsf_context_menus/_multiple_trash.html.erb @@ -0,0 +1,31 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:title_restore), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], restore_entries: true), method: :post, class: 'icon icon-cancel', disabled: !allowed %> +
  • +
  • + <%= context_menu_link l(:button_delete), entries_operations_dmsf_path(id: project, folder_id: folder, + ids: params[:ids], destroy_entries: true), method: :post, class: 'icon icon-del', + data: { confirm: l(:text_are_you_sure) }, id: 'dmsf-cm-delete', disabled: !allowed %> +
  • diff --git a/app/views/dmsf_context_menus/_url.html.erb b/app/views/dmsf_context_menus/_url.html.erb new file mode 100644 index 00000000..832868ce --- /dev/null +++ b/app/views/dmsf_context_menus/_url.html.erb @@ -0,0 +1,26 @@ +<% + # encoding: utf-8 + # + # Redmine plugin for Document Management System "Features" + # + # 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. +%> + +
  • + <%= context_menu_link l(:button_delete), dmsf_link_path(dmsf_link), method: :delete, class: 'icon icon-del', + data: { confirm: l(:text_are_you_sure) }, id: 'dmsf-cm-delete', disabled: !allowed %> +
  • diff --git a/app/views/dmsf_context_menus/dmsf.html.erb b/app/views/dmsf_context_menus/dmsf.html.erb index 3341b831..ea13eda1 100644 --- a/app/views/dmsf_context_menus/dmsf.html.erb +++ b/app/views/dmsf_context_menus/dmsf.html.erb @@ -21,43 +21,27 @@ %>
      -
    • - <%= context_menu_link l(:button_download), entries_operations_dmsf_path(:id => @project, :folder_id => @folder, - :ids => params[:ids], :download_entries => true), :method => :post, :class => 'icon icon-download', - :id => 'dmsf-cm-download', :disabled => @disabled %> -
    • -
    • - <%= context_menu_link l(:field_mail), entries_operations_dmsf_path(:id => @project, :folder_id => @folder, - :ids => params[:ids], :email_entries => true), :method => :post, :class => 'icon icon-email', - :disabled => @disabled || (!User.current.allowed_to?(:email_documents, @project)) %> -
    • -
    • - <%= context_menu_link l(:button_delete), entries_operations_dmsf_path(:id => @project, :folder_id => @folder, - :ids => params[:ids], :delete_entries => true), :method => :post, :class => 'icon icon-del', - :data => { :confirm => l(:text_are_you_sure) }, :id => 'dmsf-cm-delete', - :disabled => @disabled || ((!User.current.allowed_to?(:folder_manipulation, @project)) && - (!User.current.allowed_to?(:file_delete, @project)))%> -
    • - <% if @file %> -
    • - <% if @file.last_revision && @file.last_revision.protocol %> - <% url = "#{@file.last_revision.protocol}:ofe|u|#{Setting.protocol.strip}://#{Setting.host_name.strip}/dmsf/webdav/#{Addressable::URI.escape(RedmineDmsf::Webdav::ProjectResource.create_project_name(@file.project))}/" %> - <% if @file.dmsf_folder %> - <% url << "#{@file.dmsf_folder.dmsf_path_str}/" %> - <% end %> - <% url << @file.name %> - <% end %> - <%= context_menu_link l(:button_edit), url, :class => 'icon icon-edit', :disabled => url.blank? %> -
    • + <% if @dmsf_file %> + <%= render(partial: 'file', locals: { project: @project, folder: @folder, dmsf_file: @dmsf_file, + dmsf_link: @dmsf_link, locked: @locked, unlockable: @unlockable, + allowed: @allowed, email_allowed: @email_allowed }) %> + <% elsif @dmsf_folder %> + <%= render(partial: 'folder', locals: { project: @project, folder: @folder, dmsf_folder: @dmsf_folder, + dmsf_link: @dmsf_link, locked: @locked, unlockable: @unlockable, + allowed: @allowed, email_allowed: @email_allowed }) %> + <% elsif @dmsf_link %> + <%= render(partial: 'url', locals: { dmsf_link: @dmsf_link, allowed: @allowed }) %> + <% else %> + <%= render(partial: 'multiple', locals: { project: @project, folder: @folder, allowed: @allowed, + email_allowed: @email_allowed }) %> <% end %>
    <%= late_javascript_tag do %> - $('#dmsf-cm-download').click(function (event) { - contextMenuHide(); - }); - $('#dmsf-cm-delete').click(function (event) { contextMenuHide(); }); + $('#dmsf-cm-workflow').click(function (event) { + contextMenuHide(); + }); <% end %> diff --git a/app/views/dmsf_context_menus/trash.html.erb b/app/views/dmsf_context_menus/trash.html.erb index c9d0654c..ec69d98b 100644 --- a/app/views/dmsf_context_menus/trash.html.erb +++ b/app/views/dmsf_context_menus/trash.html.erb @@ -21,17 +21,17 @@ %>
      -
    • - <%= context_menu_link l(:button_delete), entries_operations_dmsf_path(:id => @project, :folder_id => @folder, - :ids => params[:ids], :destroy_entries => true), :method => :post, :class => 'icon-del', :id => 'dmsf-cm-delete', - :data => { :confirm => l(:text_are_you_sure) } %> -
    • -
    • - <%= context_menu_link l(:title_restore), entries_operations_dmsf_path(:id => @project, :folder_id => @folder, - :ids => params[:ids], :restore_entries => true), :method => :post, :class => 'icon-cancel' %> -
    • + <% if @dmsf_file || @dmsf_link %> + <%= render(partial: 'file_trash', locals: { project: @project, folder: @folder, dmsf_file: @dmsf_file, + dmsf_link: @dmsf_link, allowed_delete: @allowed_delete, + allowed_restore: @allowed_restore }) %> + <% elsif @dmsf_folder %> + <%= render(partial: 'folder_trash', locals: { project: @project, folder: @folder, dmsf_folder: @dmsf_folder, + dmsf_link: @dmsf_link, allowed: @allowed }) %> + <% else %> + <%= render(partial: 'multiple_trash', locals: { project: @project, folder: @folder, allowed: @allowed }) %> + <% end %>
    - <%= late_javascript_tag do %> $('#dmsf-cm-delete').click(function (event) { contextMenuHide(); diff --git a/app/views/dmsf_files/_link.html.erb b/app/views/dmsf_files/_link.html.erb index 018672f0..2f2490f0 100644 --- a/app/views/dmsf_files/_link.html.erb +++ b/app/views/dmsf_files/_link.html.erb @@ -83,7 +83,7 @@ link ? dmsf_link_path(link, :commit => 'yes') : dmsf_file_path(:id => dmsf_file, :commit => 'yes'), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, - :title => l(:title_delete), + :title => l(:button_delete), :class => 'icon-only icon-del') %> <% end %> <% else %> diff --git a/app/views/dmsf_workflows/_approval_workflow_button.html.erb b/app/views/dmsf_workflows/_approval_workflow_button.html.erb index 887c4fe3..57193040 100644 --- a/app/views/dmsf_workflows/_approval_workflow_button.html.erb +++ b/app/views/dmsf_workflows/_approval_workflow_button.html.erb @@ -35,7 +35,7 @@ :dmsf_file_revision_id => file.last_revision.id), :title => l(:title_waiting_for_approval), :remote => true, - :class => "icon-only icon-wf-waiting") %> + :class => 'icon-only icon-wf-waiting') %> <% else %> <% end %> diff --git a/assets/stylesheets/redmine_dmsf.css b/assets/stylesheets/redmine_dmsf.css index 1f4291b8..e604580a 100644 --- a/assets/stylesheets/redmine_dmsf.css +++ b/assets/stylesheets/redmine_dmsf.css @@ -72,9 +72,7 @@ } .list .dmsf_buttons { - min-width: 98px; - width: 98px; - text-align: left; + min-width: 18px; } .list .dmsf_checkbox { @@ -253,9 +251,10 @@ div.dmsf_revision_inner_box .attribute .label { .icon-wf-none { background-image: url(../images/none.png); } .icon-wf-waiting { background-image: url(../images/waiting_for_approval.png); } .icon-wf-assigned { background-image: url(../images/assigned.png); } -.icon-wf-none::before{content: '✓'} +/* TODO: There is an extra tick in the context menu */ +/*.icon-wf-none::before{content: '✓'} .icon-wf-waiting::before{content: '✓'} -.icon-wf-assigned::before{content: '✓'} +.icon-wf-assigned::before{content: '✓'}*/ .icon-link { background-image: url(../../../images/link.png); } .icon-approvalworkflows { background-image: url(../../../images/ticket_go.png); } diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 571a0cb0..4876d02c 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -77,7 +77,6 @@ cs: title_check_for_zip_download_or_email: Vybrat pro stažení jako zip nebo emailem title_check_for_restore_or_delete: Vybrat pro obnovení nebo smazání - title_delete: Smazat title_notifications_active_deactivate: "Notifikace aktivní: Deaktivovat" title_notifications_not_active_activate: "Notifikace nejsou aktivní: Aktivovat" title_title_version_version_download: "%{title} verze %{version} stáhnout" @@ -248,7 +247,6 @@ cs: label_dmsf_workflow_plural_num: Schvalovací procesy (%{count}) label_dmsf_workflow_step: Krok label_dmsf_workflow_step_plural: Kroky - label_dmsf_workflow_approval: Schválení label_dmsf_workflow_approval_plural: Schválení label_dmsf_wokflow_action_approve: Schválit label_dmsf_wokflow_action_reject: Odmítnout @@ -415,6 +413,7 @@ cs: label_switch_rlf: Přepni do/z Redmine vzhledu button_switch: Přepni vzhled + button_edit_content: Upravit obsah easy_pages: modules: diff --git a/config/locales/de.yml b/config/locales/de.yml index e89127be..caafb7bb 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -77,7 +77,6 @@ de: title_check_for_zip_download_or_email: Wähle für ZIP-Download bzw. Email title_check_for_restore_or_delete: Wähle für Rückstellen oder Löschen - title_delete: Löschen title_notifications_active_deactivate: "Benachrichtigungen sind aktiv: Ausschalten" title_notifications_not_active_activate: "Benachrichtigungen sind nicht aktiv: Einschalten" title_title_version_version_download: "%{title} Version %{version} Download" @@ -248,7 +247,6 @@ de: label_dmsf_workflow_plural_num: Genehmigungs-Workflows (%{count}) label_dmsf_workflow_step: Schritt label_dmsf_workflow_step_plural: Schritte - label_dmsf_workflow_approval: Genehmigung label_dmsf_workflow_approval_plural: Genehmigungen label_dmsf_wokflow_action_approve: Genehmigen label_dmsf_wokflow_action_reject: Ablehnen @@ -415,6 +413,7 @@ de: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/en.yml b/config/locales/en.yml index a2e28e4e..086a4df0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -77,7 +77,6 @@ en: title_check_for_zip_download_or_email: Check for zip, download or email title_check_for_restore_or_delete: Check for restore or delete - title_delete: Delete title_notifications_active_deactivate: "Notifications active: Deactivate" title_notifications_not_active_activate: "Notifications not active: Activate" title_title_version_version_download: "%{title} version %{version} download" @@ -248,7 +247,6 @@ en: label_dmsf_workflow_plural_num: Approval workflows (%{count}) label_dmsf_workflow_step: Step label_dmsf_workflow_step_plural: Steps - label_dmsf_workflow_approval: Approval label_dmsf_workflow_approval_plural: Approvals label_dmsf_wokflow_action_approve: Approve label_dmsf_wokflow_action_reject: Reject @@ -415,6 +413,7 @@ en: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/es.yml b/config/locales/es.yml index a6bcf037..a5df6257 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -77,7 +77,6 @@ es: title_check_for_zip_download_or_email: Tildar para crear Zip o enviarlo por email title_check_for_restore_or_delete: Check for restore or delete - title_delete: Eliminar title_notifications_active_deactivate: "Notificaciones Activas: Desactivadas" title_notifications_not_active_activate: "Notificacciones No Activas: Activadas" title_title_version_version_download: "%{title} version %{version} descargar" @@ -248,7 +247,6 @@ es: label_dmsf_workflow_plural_num: Approval workflows (%{count}) label_dmsf_workflow_step: Paso label_dmsf_workflow_step_plural: Pasos - label_dmsf_workflow_approval: "Aprobación" label_dmsf_workflow_approval_plural: Aprobaciones label_dmsf_wokflow_action_approve: Aprobar label_dmsf_wokflow_action_reject: Rechazar @@ -415,6 +413,7 @@ es: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 318f38d6..15fbccc8 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -77,7 +77,6 @@ fr: title_check_for_zip_download_or_email: Sélectionner pour le téléchargement ou la transmission par mail title_check_for_restore_or_delete: Sélectionner pour restaurer ou supprimer - title_delete: Supprimer title_notifications_active_deactivate: "Notifications activées : cliquer pour désactiver" title_notifications_not_active_activate: "Notifications désactivées : cliquer pour activer" title_title_version_version_download: "Télécharger la version %{version} de %{title}" @@ -248,7 +247,6 @@ fr: label_dmsf_workflow_plural_num: Flux de validation (%{count}) label_dmsf_workflow_step: Etape label_dmsf_workflow_step_plural: Etapes - label_dmsf_workflow_approval: Approbation label_dmsf_workflow_approval_plural: Approbations label_dmsf_wokflow_action_approve: Approuver label_dmsf_wokflow_action_reject: Rejeter @@ -415,6 +413,7 @@ fr: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index be6b20a3..08483b21 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -77,7 +77,6 @@ hu: title_check_for_zip_download_or_email: Kijelölés tömörítésre, letöltésre vagy email-ben küldésre title_check_for_restore_or_delete: Kijelölés visszaállításra vagy törlésre tömörítésre, letöltésre vagy email-ben küldésre - title_delete: Törlés title_notifications_active_deactivate: "Értesítések bekapcsolva: Kikapcsolás" title_notifications_not_active_activate: "Értesítések nincsnek bekapcsolva: Bekapcsolás" title_title_version_version_download: "%{title} verzió %{version} letöltés" @@ -248,7 +247,6 @@ hu: label_dmsf_workflow_plural_num: "Jóváhagyási workflow-k (%{count})" label_dmsf_workflow_step: Lépés label_dmsf_workflow_step_plural: Lépések - label_dmsf_workflow_approval: Jóváhagyás label_dmsf_workflow_approval_plural: Jóváhagyások label_dmsf_wokflow_action_approve: Jóváhagyás label_dmsf_wokflow_action_assign: Jóváhagyási workflow hozzárendelése @@ -415,6 +413,7 @@ hu: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/it.yml b/config/locales/it.yml index fbe29507..f5fb6fd3 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -77,7 +77,6 @@ it: # Italian strings thx 2 Matteo Arceci! title_check_for_zip_download_or_email: Seleziona per zip, download o email title_check_for_restore_or_delete: Seleziona per ripristinare o cancellare - title_delete: Cancella title_notifications_active_deactivate: "Notifiche attive: Disattiva" title_notifications_not_active_activate: "Notifiche disattivate: Attiva" title_title_version_version_download: "%{title} versione %{version} download" @@ -248,7 +247,6 @@ it: # Italian strings thx 2 Matteo Arceci! label_dmsf_workflow_plural_num: Approvazioni flusso di lavoro (%{count}) label_dmsf_workflow_step: Passo label_dmsf_workflow_step_plural: Passi - label_dmsf_workflow_approval: Approvazione label_dmsf_workflow_approval_plural: Approvazioni label_dmsf_wokflow_action_approve: Approva label_dmsf_wokflow_action_reject: Rifiuta @@ -415,6 +413,7 @@ it: # Italian strings thx 2 Matteo Arceci! label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2f13ea65..0e75f0d0 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -77,7 +77,6 @@ ja: title_check_for_zip_download_or_email: Zip圧縮してダウンロードまたはメールするにはチェック title_check_for_restore_or_delete: 復元または削除するにはチェック - title_delete: 削除する title_notifications_active_deactivate: "通知は有効です: 無効にする" title_notifications_not_active_activate: "通知は無効です: 有効にする" title_title_version_version_download: "%{title} のバージョン %{version} をダウンロードする" @@ -248,7 +247,6 @@ ja: label_dmsf_workflow_plural_num: 承認ワークフロー数 (%{count}) label_dmsf_workflow_step: ステップ label_dmsf_workflow_step_plural: ステップ - label_dmsf_workflow_approval: 承認 label_dmsf_workflow_approval_plural: 承認 label_dmsf_wokflow_action_approve: 承認 label_dmsf_wokflow_action_reject: 否認 @@ -415,6 +413,7 @@ ja: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 02184a35..8dbd9aff 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -77,7 +77,6 @@ ko: title_check_for_zip_download_or_email: Zip, 다운로드 혹은 이메일 체크 title_check_for_restore_or_delete: 복구되거나 삭제된 파일 체크 - title_delete: 삭제 title_notifications_active_deactivate: "알림 활성화: 비활성화" title_notifications_not_active_activate: "알림 비활성화: 활성화" title_title_version_version_download: "%{title} 버전 %{version} 다운로드" @@ -248,7 +247,6 @@ ko: label_dmsf_workflow_plural_num: "승인된 작업 흐름 (%{count})" label_dmsf_workflow_step: 단계 label_dmsf_workflow_step_plural: 단계들 - label_dmsf_workflow_approval: 승인 label_dmsf_workflow_approval_plural: 승인들 label_dmsf_wokflow_action_approve: 승인 label_dmsf_wokflow_action_reject: 반려 @@ -415,6 +413,7 @@ ko: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 8ebfd13b..7c712d0d 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -77,7 +77,6 @@ nl: title_check_for_zip_download_or_email: Vink voor zip, download of email title_check_for_restore_or_delete: Vink voor herstel of verwijder - title_delete: Verwijder title_notifications_active_deactivate: "Notificaties actief: Deactiveren" title_notifications_not_active_activate: "Notificaties niet actief: Activeren" title_title_version_version_download: "%{title} versie %{version} downloaden" @@ -248,7 +247,6 @@ nl: label_dmsf_workflow_plural_num: "Goedkeuring workflows (%{count})" label_dmsf_workflow_step: Stap label_dmsf_workflow_step_plural: Stappen - label_dmsf_workflow_approval: Goedkeuring label_dmsf_workflow_approval_plural: Goedkeuringen label_dmsf_wokflow_action_approve: Goedkeuren label_dmsf_wokflow_action_reject: Afwijzen @@ -415,6 +413,7 @@ nl: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 45ff5e55..78681125 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -77,7 +77,6 @@ pl: title_check_for_zip_download_or_email: Zaznacz aby pobrać plik zip lub wysłać email title_check_for_restore_or_delete: Check for restore or delete - title_delete: Usuń title_notifications_active_deactivate: "Powiadomienia aktywne: Wyłącz" title_notifications_not_active_activate: "Powiadomienia wyłączone: Aktywuj" title_title_version_version_download: "pobierz %{title} wersja %{version}" @@ -248,7 +247,6 @@ pl: label_dmsf_workflow_plural_num: Procesy akceptacji (%{count}) label_dmsf_workflow_step: Krok label_dmsf_workflow_step_plural: Kroki - label_dmsf_workflow_approval: Akceptacja label_dmsf_workflow_approval_plural: Akceptacje label_dmsf_wokflow_action_approve: Zaakceptuj label_dmsf_wokflow_action_reject: Odrzuć @@ -415,6 +413,7 @@ pl: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 1fb1410f..59adb097 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -77,7 +77,6 @@ pt-BR: title_check_for_zip_download_or_email: Marcar para download ou enviar por e-mail title_check_for_restore_or_delete: Marcar para restaurar ou excluir - title_delete: Excluir title_notifications_active_deactivate: "Notificações ativas: Desativar" title_notifications_not_active_activate: "Notificações não ativas: Ativar" title_title_version_version_download: "%{title} revisão %{version} download" @@ -248,7 +247,6 @@ pt-BR: label_dmsf_workflow_plural_num: Workflows de aprovação(%{count}) label_dmsf_workflow_step: Passo label_dmsf_workflow_step_plural: Passos - label_dmsf_workflow_approval: Aprovação label_dmsf_workflow_approval_plural: Aprovações label_dmsf_wokflow_action_approve: Aprovar label_dmsf_wokflow_action_reject: Reprovar @@ -415,6 +413,7 @@ pt-BR: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 44a2c5b6..b4f5ebb1 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -77,7 +77,6 @@ ru: title_check_for_zip_download_or_email: Выберите документы, которые нужно скачать или отправить их по электронной почте title_check_for_restore_or_delete: Выберите документы для удаления или восстановления - title_delete: Удалить title_notifications_active_deactivate: "Уведомления включены: Отключить" title_notifications_not_active_activate: "Уведомления не включены: Включить" title_title_version_version_download: "Скачать %{title} редакции %{version}" @@ -248,7 +247,6 @@ ru: label_dmsf_workflow_plural_num: Процессы согласования (%{count}) label_dmsf_workflow_step: Шаг label_dmsf_workflow_step_plural: Шаги - label_dmsf_workflow_approval: Утверждение label_dmsf_workflow_approval_plural: Утверждения label_dmsf_wokflow_action_approve: Согласовать label_dmsf_wokflow_action_reject: Отклонить @@ -415,6 +413,7 @@ ru: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index dad00e16..737221b4 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -77,7 +77,6 @@ sl: title_check_for_zip_download_or_email: Označi za zip prenašanje ali email title_check_for_restore_or_delete: Check for restore or delete - title_delete: Izbriši title_notifications_active_deactivate: "Obveščanje aktivno: Deaktiviraj" title_notifications_not_active_activate: "Obveščanje ni aktivno: Aktiviraj" title_title_version_version_download: "%{title} verzija %{version} prenesi dol" @@ -248,7 +247,6 @@ sl: label_dmsf_workflow_plural_num: Approval workflows (%{count}) label_dmsf_workflow_step: Step label_dmsf_workflow_step_plural: Steps - label_dmsf_workflow_approval: Approval label_dmsf_workflow_approval_plural: Approvals label_dmsf_wokflow_action_approve: Approve label_dmsf_wokflow_action_reject: Reject @@ -415,6 +413,7 @@ sl: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 5757cd32..2c42dd6e 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -77,7 +77,6 @@ zh-TW: title_check_for_zip_download_or_email: 選取檔案 (下載或電子郵件發送) title_check_for_restore_or_delete: Check for restore or delete - title_delete: 刪除 title_notifications_active_deactivate: "通知啟用中: 點擊關閉通知" title_notifications_not_active_activate: "通知關閉中: 點擊啟用通知" title_title_version_version_download: " 版本: %{version} 檔案: %{title} 下載" @@ -248,7 +247,6 @@ zh-TW: label_dmsf_workflow_plural_num: 批准流程 (%{count}) label_dmsf_workflow_step: 步驟 label_dmsf_workflow_step_plural: 步驟 - label_dmsf_workflow_approval: 批准 label_dmsf_workflow_approval_plural: 批准 label_dmsf_wokflow_action_approve: 批准 label_dmsf_wokflow_action_reject: 拒絕 @@ -415,6 +413,7 @@ zh-TW: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f5f6cbec..b9c134cc 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -77,7 +77,6 @@ zh: title_check_for_zip_download_or_email: 选中用于zip下载或邮件发送 title_check_for_restore_or_delete: Check for restore or delete - title_delete: 删除 title_notifications_active_deactivate: "通知有效:点击注销通知" title_notifications_not_active_activate: "通知无效:点击激活通知" title_title_version_version_download: " 下载‘%{title}’版本‘%{version}’" @@ -248,7 +247,6 @@ zh: label_dmsf_workflow_plural_num: Approval workflows (%{count}) label_dmsf_workflow_step: Step label_dmsf_workflow_step_plural: Steps - label_dmsf_workflow_approval: Approval label_dmsf_workflow_approval_plural: Approvals label_dmsf_wokflow_action_approve: Approve label_dmsf_wokflow_action_reject: Reject @@ -415,6 +413,7 @@ zh: label_switch_rlf: Switch Redmine look and feel design button_switch: Switch design + button_edit_content: Edit content easy_pages: modules: diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb index e1687abf..73971f33 100644 --- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb @@ -253,7 +253,7 @@ module RedmineDmsf if issue.attributes_editable? && User.current.allowed_to?(:file_delete, dmsf_file.project) html << link_to('', link ? dmsf_link_path(link, :commit => 'yes') : dmsf_file_path(:id => dmsf_file, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:title_delete), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete), :class => 'icon icon-del') end end