diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6ce1f4..893fce93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Changelog for Redmine DMSF ========================== +1.6.0 *????-??-??* +------------------ + 1.5.9 *2016-03-01* ------------------ diff --git a/README.md b/README.md index 1f617b69..81a76f87 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Redmine DMSF Plugin =================== -The current version of Redmine DMSF is **1.5.9** [![Build Status](https://api.travis-ci.org/danmunn/redmine_dmsf.png)](https://travis-ci.org/danmunn/redmine_dmsf) +The current version of Redmine DMSF is **1.6.0** [![Build Status](https://api.travis-ci.org/danmunn/redmine_dmsf.png)](https://travis-ci.org/danmunn/redmine_dmsf) Redmine DMSF is Document Management System Features plugin for Redmine issue tracking system; It is aimed to replace current Redmine's Documents module. diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index c9b85e90..c5adda5a 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -660,4 +660,15 @@ class DmsfFile < ActiveRecord::Base end end + def get_locked_title + if self.locked_for_user? + if self.lock.reverse[0].user + return l(:title_locked_by_user, :user => self.lock.reverse[0].user) + else + return l(:notice_account_unknown_email) + end + end + l(:title_unlock_file) + end + end diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb index 8d2875bd..45199de4 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -467,6 +467,17 @@ class DmsfFolder < ActiveRecord::Base csv end + def get_locked_title + if self.locked_for_user? + if self.lock.reverse[0].user + return l(:title_locked_by_user, :user => self.lock.reverse[0].user) + else + return l(:notice_account_unknown_email) + end + end + l(:title_unlock_file) + end + private def self.directory_subtree(tree, folder, level, current_folder) diff --git a/app/views/dmsf/_dir.html.erb b/app/views/dmsf/_dir.html.erb index 123bd82a..013f11c3 100644 --- a/app/views/dmsf/_dir.html.erb +++ b/app/views/dmsf/_dir.html.erb @@ -20,9 +20,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. %> -<% locked_for_user = subfolder && subfolder.locked_for_user? %> -<% locked = subfolder && subfolder.locked? %> - <%= check_box_tag(name, id, false, :title => l(:title_check_for_zip_download_or_email), :id => "subfolder_#{id}") %> <% if DmsfFolder.is_column_on?('id') %> @@ -51,21 +48,7 @@ <% end %> <% if DmsfFolder.is_column_on?('modified') %> - <%= format_time(subfolder.modified) if subfolder %> - <% if locked_for_user %> - <% if subfolder.lock.reverse[0].user %> - <%= link_to(image_tag(link ? 'locked_gray.png' : 'locked.png', :plugin => 'redmine_dmsf'), - user_path(subfolder.lock.reverse[0].user), - :title => l(:title_locked_by_user, :user => subfolder.lock.reverse[0].user)) %> - <% else %> - <%= content_tag(:span, image_tag(link ? 'locked_gray.png' : 'locked.png', :plugin => 'redmine_dmsf'), - :title => l(:notice_account_unknown_email)) %> - <% end %> - <% elsif locked %> - <%= content_tag(:span, image_tag(link ? 'lockedbycurrent_gray.png' : 'lockedbycurrent.png', :plugin => 'redmine_dmsf'), - :title => l(:title_locked_by_you)) %> - <% end %> - + <%= format_time(subfolder.modified) if subfolder %> <% end %> <% if DmsfFolder.is_column_on?('version') %> @@ -86,55 +69,46 @@ <% end %> <% if @folder_manipulation_allowed %> - <% unless locked_for_user %> - <% if subfolder %> - <%= link_to(image_tag('edit.png'), - edit_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:link_edit, :title => subfolder ? h(subfolder.title) : project.name)) %> - <% if locked %> - <% if subfolder.unlockable? %> - <%= link_to(image_tag('unlock.png', :plugin => 'redmine_dmsf'), - unlock_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_unlock_file)) %> - <% else %> - - <% end %> - <% else %> - <%= link_to(image_tag('lock.png', :plugin => 'redmine_dmsf'), - lock_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_lock_file)) %> - <% end %> + <% 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 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 icon-edit') %> + <% else %> + <%= link_to('', edit_root_dmsf_path(:id => @project), + :title => l(:link_edit, :title => l(:link_documents)), + :class => 'icon icon-edit') %> + <% end %> + <% if subfolder %> + <%= link_to('', lock_dmsf_path(:id => project, :folder_id => subfolder), + :title => l(:title_lock_file), + :class => 'icon icon-lock') %> <% else %> - <%= link_to(image_tag('edit.png'), edit_root_dmsf_path(:id => @project), - :title => l(:link_edit, :title => l(:link_documents))) %> <% end %> <% if (subfolder && subfolder.notification) || (!subfolder && project.dmsf_notification) %> - <%= link_to(image_tag('notify.png', :plugin => 'redmine_dmsf'), - notify_deactivate_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_notifications_active_deactivate)) %> + <%= link_to('', notify_deactivate_dmsf_path(:id => project, :folder_id => subfolder), + :title => l(:title_notifications_active_deactivate), + :class => 'icon icon-email') %> <% else %> - <%= link_to(image_tag('notifynot.png', :plugin => 'redmine_dmsf'), - notify_activate_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_notifications_not_active_activate)) %> - <% end %> - <% if link %> - <%= link_to(image_tag('delete.png'), dmsf_link_path(link), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, :title => l(:title_delete)) %> - <% else %> - <%= link_to(image_tag('delete.png'), - delete_dmsf_path(:id => project, :folder_id => subfolder), - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete)) %> - <% end %> - <% else %> - - <% if (!locked_for_user || @force_file_unlock_allowed) && subfolder.unlockable? %> - <%= link_to(image_tag('unlock.png', :plugin => 'redmine_dmsf'), - unlock_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_unlock_file)) %> + <%= link_to('', notify_activate_dmsf_path(:id => project, :folder_id => subfolder), + :title => l(:title_notifications_not_active_activate), + :class => 'icon 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 icon-del') %> <% end %> <% end %> diff --git a/app/views/dmsf/_dir_trash.html.erb b/app/views/dmsf/_dir_trash.html.erb index 3d16d0f7..68d56865 100644 --- a/app/views/dmsf/_dir_trash.html.erb +++ b/app/views/dmsf/_dir_trash.html.erb @@ -67,23 +67,20 @@ <% 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 icon-cancel') %> <% if link %> - <%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'), - restore_dmsf_link_path(:id => link), - :title => l(:title_restore)) %> - <%= link_to(image_tag('rev_delete.png', :plugin => 'redmine_dmsf'), - dmsf_link_path(:id => link, :commit => 'yes'), + <%= link_to('', dmsf_link_path(:id => link, :commit => 'yes'), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, - :title => l(:title_delete)) %> - <% else # folder %> - <%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'), - restore_dmsf_path(:id => project, :folder_id => subfolder), - :title => l(:title_restore)) %> - <%= link_to(image_tag('rev_delete.png', :plugin => 'redmine_dmsf'), - delete_dmsf_path(:id => project, :folder_id => subfolder, :commit => 'yes'), + :title => l(:title_delete), + :class => 'icon icon-delete') %> + <% else %> + <%= link_to('', delete_dmsf_path(:id => project, :folder_id => subfolder, :commit => 'yes'), :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:title_delete)) %> + :title => l(:title_delete), + :class => 'icon icon-delete') %> <% end %> <% end %> diff --git a/app/views/dmsf/_file.html.erb b/app/views/dmsf/_file.html.erb index b345f7e4..88f7ac76 100644 --- a/app/views/dmsf/_file.html.erb +++ b/app/views/dmsf/_file.html.erb @@ -53,19 +53,6 @@ <% if DmsfFolder.is_column_on?('modified') %> <%= format_time(file.last_revision.updated_at) %> - <% if file.locked_for_user? %> - <% if file.lock.reverse[0].user %> - <%= link_to(image_tag(link ? 'locked_gray.png' : 'locked.png', :plugin => 'redmine_dmsf'), - user_path(file.lock.reverse[0].user), - :title => l(:title_locked_by_user, :user => file.lock.reverse[0].user)) %> - <% else %> - <%= content_tag(:span, image_tag(link ? 'locked_gray.png' : 'locked.png', :plugin => 'redmine_dmsf'), - :title => l(:notice_account_unknown_email)) %> - <% end %> - <% elsif file.locked? %> - <%= content_tag(:span, image_tag(link ? 'lockedbycurrent_gray.png' : 'lockedbycurrent.png', :plugin => 'redmine_dmsf'), - :title => l(:title_locked_by_you)) %> - <% end %> <% end %> <% if DmsfFolder.is_column_on?('version') %> @@ -100,55 +87,48 @@ <% end %> <% if @file_manipulation_allowed %> - <%= link_to(image_tag('filedetails.png', :plugin => 'redmine_dmsf'), - dmsf_file_path(:id => file), - :title => l(:link_details, :title => h(file.last_revision.title))) %> - <% unless file.locked_for_user? %> - <% if !file.locked? %> - <%= link_to(image_tag('lock.png', :plugin => 'redmine_dmsf'), - lock_dmsf_files_path(:id => file), - :title => l(:title_lock_file)) %> - <% elsif file.unlockable? %> - <%= link_to(image_tag('unlock.png', :plugin => 'redmine_dmsf'), - unlock_dmsf_files_path(:id => file), - :title => l(:title_unlock_file))%> - <% else %> - - <% end %> + <%= link_to('', dmsf_file_path(:id => file), + :title => l(:link_details, :title => h(file.last_revision.title)), + :class => 'icon icon-edit') %> + <% if !file.locked? %> + <%= link_to('', lock_dmsf_files_path(:id => file), + :title => l(:title_lock_file), + :class => 'icon 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 icon-unlock') %> + <% else %> + + <% end %> + <% unless file.locked? %> <% if file.notification %> - <%= link_to(image_tag('notify.png', :plugin => 'redmine_dmsf'), - notify_deactivate_dmsf_files_path(:id => file), - :title => l(:title_notifications_active_deactivate)) %> + <%= link_to('', notify_deactivate_dmsf_files_path(:id => file), + :title => l(:title_notifications_active_deactivate), + :class => 'icon icon-email') %> <% else %> - <%= link_to(image_tag('notifynot.png', :plugin => 'redmine_dmsf'), - notify_activate_dmsf_files_path(:id => file), - :title => l(:title_notifications_not_active_activate)) %> + <%= link_to('', notify_activate_dmsf_files_path(:id => file), + :title => l(:title_notifications_not_active_activate), + :class => 'icon icon-email-add') %> <% end %> <% if link %> - <%= link_to(image_tag('delete.png'), - dmsf_link_path(link), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete)) %> + <%= link_to('', dmsf_link_path(link), + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:title_delete), + :method => :delete, + :class => 'icon icon-del') %> <% else %> <% if @file_delete_allowed %> - <%= link_to(image_tag('delete.png'), - dmsf_file_path(:id => file), + <%= link_to('', dmsf_file_path(:id => file), :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:title_delete), :method => :delete, - :title => l(:title_delete)) unless file.locked_for_user? %> + :class => 'icon icon-del') %> <% else %> <% end %> <% end %> <% else %> - <% if @force_file_unlock_allowed && file.unlockable? %> - <%= link_to(image_tag('unlock.png', :plugin => 'redmine_dmsf'), - unlock_dmsf_files_path(:id => file), - :title => l(:title_unlock_file))%> - <% else %> - - <% end %> <% end %> @@ -160,47 +140,36 @@ <% assignments = wf.next_assignments(file.last_revision.id) %> <% index = assignments.find_index{|assignment| assignment.user_id == User.current.id} if assignments %> <% if index %> - <%= link_to(image_tag('waiting_for_approval.png', :plugin => 'redmine_dmsf'), + <%= link_to('', action_dmsf_workflow_path( - :project_id => project.id, - :id => wf.id, - :dmsf_workflow_step_assignment_id => assignments[index].id, - :dmsf_file_revision_id => file.last_revision.id), + :project_id => project.id, + :id => wf.id, + :dmsf_workflow_step_assignment_id => assignments[index].id, + :dmsf_file_revision_id => file.last_revision.id), :title => l(:title_waiting_for_approval), - :remote => true) %> - <% else %> - <%= content_tag(:span, image_tag('waiting_for_approval.png', :plugin => 'redmine_dmsf'), - :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}") %> + :remote => true, + :class => 'icon icon-wf-waiting') %> <% end %> - <% else %> - <%= content_tag(:span, image_tag('waiting_for_approval.png', :plugin => 'redmine_dmsf'), - :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}") %> <% end %> - <% when DmsfWorkflow::STATE_APPROVED %> - <%= content_tag(:span, image_tag('approved.png', :plugin => 'redmine_dmsf'), - :title => l(:title_approved)) %> <% when DmsfWorkflow::STATE_ASSIGNED %> <% if User.current && (file.last_revision.dmsf_workflow_assigned_by == User.current.id) && wf %> - <%= link_to(image_tag('assigned.png', :plugin => 'redmine_dmsf'), + <%= link_to('', start_dmsf_workflow_path( - :id => file.last_revision.dmsf_workflow_id, - :dmsf_file_revision_id => file.last_revision.id), - :title => l(:label_dmsf_wokflow_action_start)) %> - <% else %> - <%= content_tag(:span, image_tag('assigned.png', :plugin => 'redmine_dmsf'), - title => l(:label_dmsf_wokflow_action_start)) %> + :id => file.last_revision.dmsf_workflow_id, + :dmsf_file_revision_id => file.last_revision.id), + :title => l(:label_dmsf_wokflow_action_start), + :class => 'icon icon-wf-assigned') %> <% end %> - <% when DmsfWorkflow::STATE_REJECTED %> - <%= content_tag(:span, image_tag('rejected.png', :plugin => 'redmine_dmsf'), - :title => l(:title_rejected)) %> + <% when DmsfWorkflow::STATE_APPROVED, DmsfWorkflow::STATE_REJECTED %> <% else %> - <% if @workflows_available && !file.locked_for_user? %> - <%= link_to(image_tag('none.png', :plugin => 'redmine_dmsf'), + <% if @workflows_available %> + <%= link_to('', assign_dmsf_workflow_path( - :project_id => project.id, - :dmsf_file_revision_id => file.last_revision.id), - :title => l(:label_dmsf_wokflow_action_assign), - :remote => true) %> + :project_id => project.id, + :dmsf_file_revision_id => file.last_revision.id), + :title => l(:label_dmsf_wokflow_action_assign), + :remote => true, + :class => 'icon icon-wf-none') %> <% end %> <% end %> <% end %> diff --git a/app/views/dmsf/_file_trash.html.erb b/app/views/dmsf/_file_trash.html.erb index 62bba0e5..7d2f710a 100644 --- a/app/views/dmsf/_file_trash.html.erb +++ b/app/views/dmsf/_file_trash.html.erb @@ -67,25 +67,16 @@ <% end %> <% if @file_manipulation_allowed %> - <% if link %> - <%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'), - restore_dmsf_link_path(:id => link), - :title => l(:title_restore)) %> - <%= link_to(image_tag('rev_delete.png', :plugin => 'redmine_dmsf'), - dmsf_link_path(:id => link, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete)) %> - <% else # file %> - <%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'), - restore_dmsf_file_path(:id => file), - :title => l(:title_restore)) %> - <%= link_to(image_tag('rev_delete.png', :plugin => 'redmine_dmsf'), - dmsf_file_path(:id => file, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete)) %> - <% end %> + <%= link_to('', link ? restore_dmsf_link_path(:id => link) : restore_dmsf_file_path(:id => file), + :title => l(:title_restore), + :class => 'icon 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 icon-delete') %> <% end %> 1 diff --git a/app/views/dmsf/_url.html.erb b/app/views/dmsf/_url.html.erb index 776b7e72..bdd954d9 100644 --- a/app/views/dmsf/_url.html.erb +++ b/app/views/dmsf/_url.html.erb @@ -32,7 +32,7 @@ <%= link_to(h(title), link.external_url, :target => '_blank', - :class => 'icon dmsf_icon-link') %> + :class => 'icon icon-link') %>
<%= link.external_url %>
@@ -67,12 +67,13 @@ - <% if @file_manipulation_allowed %> - <%= link_to(image_tag('delete.png'), + <% if @file_delete_allowed %> + <%= link_to('', dmsf_link_path(link), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, - :title => l(:title_delete)) %> + :title => l(:title_delete), + :class => "icon icon-del") %> <% else %> <% end %> diff --git a/app/views/dmsf/_url_trash.html.erb b/app/views/dmsf/_url_trash.html.erb index de4623f1..3ad1be9a 100644 --- a/app/views/dmsf/_url_trash.html.erb +++ b/app/views/dmsf/_url_trash.html.erb @@ -30,7 +30,7 @@ <%= link_to(h(title), link.external_url, :target => '_blank', - :class => 'icon dmsf_icon-link') %> + :class => 'icon icon-link') %>
<%= link.external_url %>
<% end %> @@ -59,15 +59,12 @@ <% end %> <% end %> - <% if @file_manipulation_allowed %> - <%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'), - restore_dmsf_link_path(:id => link), - :title => l(:title_restore)) %> - <%= link_to(image_tag('rev_delete.png', :plugin => 'redmine_dmsf'), - dmsf_link_path(:id => link, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete)) %> + <%= 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-delete" ) %> <% end %> 1 diff --git a/app/views/dmsf/edit.html.erb b/app/views/dmsf/edit.html.erb index 57cc6265..24952100 100644 --- a/app/views/dmsf/edit.html.erb +++ b/app/views/dmsf/edit.html.erb @@ -26,41 +26,37 @@
<% if !@folder.new_record? && User.current.allowed_to?(:folder_manipulation, @project) %> - <% if !@folder.locked_for_user? %> - <% unless @folder.locked? %> - <%= link_to(l(:button_lock), - lock_dmsf_path(:id => @project, :folder_id => @folder), - :title => l(:title_lock_file), :class => 'icon dmsf_icon-lock') %> - <% else %> - <%= link_to_if(@folder.unlockable?, l(:button_unlock), - unlock_dmsf_path(:id => @project, :folder_id => @folder), - :title => l(:title_unlock_file), :class => 'icon dmsf_icon-unlock')%> - <% end %> - <% if @folder.notification %> - <%= link_to(l(:label_notifications_off), - notify_deactivate_dmsf_path(:id => @project, :folder_id => @folder), - :title => l(:title_notifications_active_deactivate), - :class => 'icon dmsf_icon-notification-on') %> - <% else %> - <%= link_to(l(:label_notifications_on), - notify_activate_dmsf_path(:id => @project, :folder_id => @folder), - :title => l(:title_notifications_not_active_activate), - :class => 'icon dmsf_icon-notification-off') %> - <% end %> - <%= link_to(l(:label_link_to), - new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder.id, :type => 'link_to'), - :title => l(:title_create_link), :class => 'icon dmsf_icon-link') %> - <%= link_to(l(:button_copy), copy_folder_path(:id => @folder), - :title => l(:title_copy), :class => 'icon icon-copy') %> - <%= 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') %> - <% elsif @force_file_unlock_allowed %> - <%= link_to_if(@folder.unlockable?, l(:button_unlock), + <% unless @folder.locked? %> + <%= link_to(l(:button_lock), lock_dmsf_path(:id => @project, :folder_id => @folder), + :title => l(:title_lock_file), :class => 'icon icon-lock') %> + <% else %> + <%= link_to_if(@folder.unlockable? && (!@folder.locked_for_user? || @force_file_unlock_allowed), l(:button_unlock), unlock_dmsf_path(:id => @project, :folder_id => @folder), - :title => l(:title_unlock_file), :class => 'icon dmsf_icon-unlock')%> - <% end %> + :title => l(:title_unlock_file), :class => 'icon icon-unlock')%> + <% end %> + <% unless @folder.locked? %> + <% if @folder.notification %> + <%= link_to(l(:label_notifications_off), + notify_deactivate_dmsf_path(:id => @project, :folder_id => @folder), + :title => l(:title_notifications_active_deactivate), + :class => 'icon icon-email') %> + <% else %> + <%= link_to(l(:label_notifications_on), + notify_activate_dmsf_path(:id => @project, :folder_id => @folder), + :title => l(:title_notifications_not_active_activate), + :class => 'icon icon-email-add') %> + <% end %> + <% end %> + <%= link_to(l(:label_link_to), + new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder.id, :type => 'link_to'), + :title => l(:title_create_link), :class => 'icon icon-link') %> + <%= link_to(l(:button_copy), copy_folder_path(:id => @folder), + :title => l(:title_copy), :class => 'icon icon-copy') %> + <% 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') %> + <% end %> <% end %>
@@ -97,4 +93,4 @@ \ No newline at end of file + diff --git a/app/views/dmsf/edit_root.html.erb b/app/views/dmsf/edit_root.html.erb index 7a89db5a..a4535e50 100644 --- a/app/views/dmsf/edit_root.html.erb +++ b/app/views/dmsf/edit_root.html.erb @@ -30,12 +30,12 @@ <%= link_to(l(:label_notifications_off), notify_deactivate_dmsf_path(:id => @project), :title => l(:title_notifications_active_deactivate), - :class => 'icon dmsf_icon-notification-on') %> + :class => 'icon icon-email') %> <% else %> <%= link_to(l(:label_notifications_on), notify_activate_dmsf_path(:id => @project), :title => l(:title_notifications_active_deactivate), - :class => 'icon dmsf_icon-notification-off') %> + :class => 'icon icon-email-add') %> <% end %> <% end %> @@ -54,4 +54,4 @@ <%= f.submit l(:submit_save) %> <% end %> -<%= wikitoolbar_for 'project_dmsf_description' %> \ No newline at end of file +<%= wikitoolbar_for 'project_dmsf_description' %> diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index 318c5dd7..9e111d5f 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -35,32 +35,32 @@ :title => l(:link_edit, :title => h(@folder.title)), :class => 'icon icon-edit') %> <% end %> - <% if @folder && (!@locked_for_user || User.current.allowed_to?(:force_file_unlock, @project)) %> + <% if @folder && (!@folder.locked_for_user || User.current.allowed_to?(:force_file_unlock, @project)) %> <% if @folder.locked? %> <%= link_to_if(@folder.unlockable?, l(:button_unlock), unlock_dmsf_path(:id => @project, :folder_id => @folder, :current => request.url), - :title => l(:title_unlock_folder), :class => 'icon dmsf_icon-unlock') %> + :title => l(:title_unlock_folder), :class => 'icon icon-unlock') %> <% else %> <%= link_to(l(:button_lock), lock_dmsf_path(:id => @project, :folder_id => @folder, :current => request.url), - :title => l(:title_lock_folder), :class => 'icon dmsf_icon-lock') %> + :title => l(:title_lock_folder), :class => 'icon icon-lock') %> <% end %> <% end %> <% if !@locked_for_user && ((@folder && @folder.notification) || (!@folder && @project.dmsf_notification)) %> <%= link_to(l(:label_notifications_off), notify_deactivate_dmsf_path(:id => @project, :folder_id => @folder), :title => l(:title_notifications_active_deactivate), - :class => 'icon dmsf_icon-notification-on') %> + :class => 'icon icon-email') %> <% else %> <%= link_to(l(:label_notifications_on), notify_activate_dmsf_path(:id => @project, :folder_id => @folder), :title => l(:title_notifications_not_active_activate), - :class => 'icon dmsf_icon-notification-off') %> + :class => 'icon icon-email-add') %> <% end %> <% if @file_manipulation_allowed && !@locked_for_user %> <%= link_to(l(:label_link_from), new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder ? @folder.id : @folder, :type => 'link_from'), - :title => l(:title_create_link), :class => 'icon dmsf_icon-link') %> + :title => l(:title_create_link), :class => 'icon icon-link') %> <% end %> <%= link_to(l(:link_create_folder), new_dmsf_path(:id => @project, :parent_id => @folder), diff --git a/app/views/dmsf_files/_links.html.erb b/app/views/dmsf_files/_links.html.erb index 2964d1e2..b4141da1 100644 --- a/app/views/dmsf_files/_links.html.erb +++ b/app/views/dmsf_files/_links.html.erb @@ -28,24 +28,27 @@

<% file_view_url = url_for({:controller => :dmsf_files, :action => 'view', :id => dmsf_file}) %> <%= link_to(h(dmsf_file.title), - file_view_url, - :target => '_blank', - :class => "icon icon-file #{DmsfHelper.filetype_css(dmsf_file.name)}", - :title => h(dmsf_file.last_revision.try(:tooltip)), - 'data-downloadurl' => "#{dmsf_file.last_revision.detect_content_type}:#{h(dmsf_file.name)}:#{file_view_url}") %> + file_view_url, + :target => '_blank', + :class => "icon icon-file #{DmsfHelper.filetype_css(dmsf_file.name)}", + :title => h(dmsf_file.last_revision.try(:tooltip)), + 'data-downloadurl' => "#{dmsf_file.last_revision.detect_content_type}:#{h(dmsf_file.name)}:#{file_view_url}") %> <% if dmsf_file.text? || dmsf_file.image? %> <%= link_to l(:button_view), - file_view_url, - :class => 'icon-only icon-magnifier', - :title => l(:button_view) %> + file_view_url, + :class => 'icon-only icon-magnifier', + :title => l(:button_view) %> <% end %> <%= " - #{dmsf_file.description}" unless dmsf_file.description.blank? %> (<%= number_to_human_size dmsf_file.last_revision.size %>) - <%= link_to(image_tag('delete.png'), - dmsf_file_path(:id => dmsf_file, :commit => 'yes'), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:title_delete)) %> + <% if @issue.attributes_editable? %> + <%= link_to('', + dmsf_file_path(:id => dmsf_file, :commit => 'yes'), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :title => l(:title_delete), + :class => 'icon icon-del') %> + <% end %> <%= dmsf_file.last_revision.user %>, <%= format_time(dmsf_file.last_revision.updated_at) %>

<% end %> diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index f4293a98..a90a5115 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -26,38 +26,36 @@
<% if User.current.allowed_to?(:file_manipulation, @project) %> - <% unless @file.locked_for_user? %> - <% unless @file.locked? %> - <%= link_to(l(:button_lock), lock_dmsf_files_path(:id => @file), - :title => l(:title_lock_file), :class => 'icon dmsf_icon-lock') %> - <% else %> - <%= link_to_if(@file.unlockable?, l(:button_unlock), unlock_dmsf_files_path(:id => @file), - :title => l(:title_unlock_file), :class => 'icon dmsf_icon-unlock') %> - <% end %> + <% if !@file.locked? %> + <%= link_to(l(:button_lock), lock_dmsf_files_path(:id => @file), + :title => l(:title_lock_file), :class => 'icon icon-lock') %> <% if @file.notification %> <%= link_to(l(:label_notifications_off), notify_deactivate_dmsf_files_path(:id => @file), :title => l(:title_notifications_active_deactivate), - :class => 'icon dmsf_icon-notification-on') %> + :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 dmsf_icon-notification-off') %> - <% 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 dmsf_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 %> - <% else %> - <% 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 dmsf_icon-unlock')%> + :class => 'icon icon-email-add') %> <% end %> + <% elsif (!@file.locked_for_user? || 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 %> + <%= 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') %> + <% if !@file.locked? && @file_delete_allowed %> + <%= delete_link(dmsf_file_path(:id => @file, :details => true)) %> + <% end %> <% end %>
@@ -81,16 +79,20 @@
- <%= link_to_function image_tag('rev_downloads.png', :plugin => 'redmine_dmsf'), - "$('#revision_access-#{revision.id}').toggle()", - :title => l(:title_download_entries) %> - <%= link_to image_tag('rev_download.png', :plugin => 'redmine_dmsf'), - 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('rev_delete.png', :plugin => 'redmine_dmsf'), - 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) %> + <%= link_to_function '', "$('#revision_access-#{revision.id}').toggle()", + :title => l(:title_download_entries), + :class => 'icon icon-downloads' + %> + <%= link_to '', view_dmsf_file_path(@file, :download => revision), + :title => l(:title_title_version_version_download, :title => h(revision.title), :version => revision.version), + :class => 'icon icon-download' + %> + <% if @file_delete_allowed && !@file.locked? && (@file.dmsf_file_revisions.visible.count > 1) %> + <%= link_to '', delete_revision_path(revision), + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:title_delete_revision), + :class => 'icon icon-delete' %> + <% end %>
<%= l(:info_revision, :rev => revision.id) %> <%= (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)).downcase %> @@ -171,18 +173,6 @@ <%= pagination_links_full @revision_pages, @file.dmsf_file_revisions.visible.count %> + <% if @revision.valid? && @file.valid? %>