#699 icons number reduction

This commit is contained in:
Karel Picman 2017-03-14 14:24:29 +01:00
parent a806248559
commit 1e0c510f8c
33 changed files with 253 additions and 306 deletions

View File

@ -1,6 +1,9 @@
Changelog for Redmine DMSF
==========================
1.6.0 *????-??-??*
------------------
1.5.9 *2016-03-01*
------------------

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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? %>
<td class="dmsf_checkbox"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_zip_download_or_email), :id => "subfolder_#{id}") %></td>
<% if DmsfFolder.is_column_on?('id') %>
@ -51,21 +48,7 @@
<td class="dmsf_size"></td>
<% end %>
<% if DmsfFolder.is_column_on?('modified') %>
<td class="dmsf_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 %>
</td>
<td class="dmsf_modified"><%= format_time(subfolder.modified) if subfolder %></td>
<% end %>
<% if DmsfFolder.is_column_on?('version') %>
<td class="dmsf_version"></td>
@ -86,55 +69,46 @@
<% end %>
<td class="dmsf_buttons">
<% 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 %>
<span class="icon"></span>
<% 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? %>
<span class="icon"></span>
<% 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 %>
<span class="icon icon-unlock" title="<%= subfolder.get_locked_title %>"></span>
<% 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))) %>
<span class="icon"></span>
<% 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 %>
<span class="icon"></span>
<% 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 %>
</td>

View File

@ -67,23 +67,20 @@
<% end %>
<td class="dmsf_buttons">
<% 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 %>
</td>

View File

@ -53,19 +53,6 @@
<% if DmsfFolder.is_column_on?('modified') %>
<td class="dmsf_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 %>
</td>
<% end %>
<% if DmsfFolder.is_column_on?('version') %>
@ -100,55 +87,48 @@
<% end %>
<td class="dmsf_buttons">
<% 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 %>
<span class="icon"></span>
<% 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 %>
<span class="icon icon-unlock" title="<%= file.get_locked_title %>"></span>
<% 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 %>
<span class="icon"></span>
<% 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 %>
<span class="icon"></span>
<% end %>
<span class="icon"></span>
<span class="icon"></span>
<% 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 %>

View File

@ -67,25 +67,16 @@
<% end %>
<td class="dmsf_buttons">
<% 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 %>
</td>
<td class="dmsf_invisible">1</td>

View File

@ -32,7 +32,7 @@
<%= link_to(h(title),
link.external_url,
:target => '_blank',
:class => 'icon dmsf_icon-link') %>
:class => 'icon icon-link') %>
<div class="dmsf_filename" title="<%= l(:label_target_folder) %>">
<%= link.external_url %>
</div>
@ -67,12 +67,13 @@
<span class="icon"></span>
<span class="icon"></span>
<span class="icon"></span>
<% 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 %>
<span class="icon"></span>
<% end %>

View File

@ -30,7 +30,7 @@
<%= link_to(h(title),
link.external_url,
:target => '_blank',
:class => 'icon dmsf_icon-link') %>
:class => 'icon icon-link') %>
<div class="dmsf_filename" title="<%= l(:label_target_folder)%>"><%= link.external_url %></div>
</td>
<% end %>
@ -59,15 +59,12 @@
<% end %>
<% end %>
<td class="dmsf_buttons">
<% 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 %>
</td>
<td class="dmsf_invisible">1</td>

View File

@ -26,41 +26,37 @@
<div class="contextual">
<% 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 %>
</div>
@ -97,4 +93,4 @@
<script type="text/javascript">
$('#dmsf_folder_dmsf_folder_id').select2();
</script>
</script>

View File

@ -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 %>
</div>
@ -54,4 +54,4 @@
<%= f.submit l(:submit_save) %>
<% end %>
<%= wikitoolbar_for 'project_dmsf_description' %>
<%= wikitoolbar_for 'project_dmsf_description' %>

View File

@ -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),

View File

@ -28,24 +28,27 @@
<p>
<% 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? %>
<span class="size">(<%= number_to_human_size dmsf_file.last_revision.size %>)</span>
<%= 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 %>
<span class="author"><%= dmsf_file.last_revision.user %>, <%= format_time(dmsf_file.last_revision.updated_at) %></span>
</p>
<% end %>

View File

@ -26,38 +26,36 @@
<div class="contextual">
<% 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 %>
</div>
@ -81,16 +79,20 @@
<div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
<div class="dataTables_lenght">
<div class="dmsf_controls" style="float: right">
<%= 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 %>
</div>
<i><%= l(:info_revision, :rev => revision.id) %></i>
<%= (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)).downcase %>
@ -171,18 +173,6 @@
<span class="pagination"><%= pagination_links_full @revision_pages, @file.dmsf_file_revisions.visible.count %></span>
<script type="text/javascript">
$('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').change(function() {
if($("input[name='version']:checked").val() == '0') {
$('#fileMinorVersionRadio').prop('checked', true);
@ -208,6 +198,7 @@
}
});
</script>
<% if @revision.valid? && @file.valid? %>
<script type="text/javascript">
$('#newRevisionFormContentToggle').text('[+]');

View File

@ -46,7 +46,7 @@
</div>
<p>
<%= submit_tag(l(:button_copy)) %>
<% if User.current.allowed_to?(:file_manipulation, @project) %>
<% if !@file.locked? && User.current.allowed_to?(:file_manipulation, @project) %>
<%= submit_tag(l(:button_move), :id => 'move_button') %>
<% end %>
</p>

View File

@ -82,14 +82,15 @@
<% assigns = assignment.dmsf_workflow_step.dmsf_workflow.next_assignments(assignment.dmsf_file_revision.id) %>
<% index = assigns.find_index{|assign| assign.user_id == User.current.id} if assigns %>
<% if index %>
<%= link_to(image_tag('waiting_for_approval.png', :plugin => 'redmine_dmsf'),
action_dmsf_workflow_path(
:project_id => assignment.dmsf_file_revision.dmsf_file.project.id,
:id => assignment.dmsf_workflow_step.dmsf_workflow.id,
:dmsf_workflow_step_assignment_id => assigns[index].id,
:dmsf_file_revision_id => assignment.dmsf_file_revision.id),
:title => l(:title_waiting_for_approval),
:remote => true) %>
<%= link_to('',
action_dmsf_workflow_path(
:project_id => assignment.dmsf_file_revision.dmsf_file.project.id,
:id => assignment.dmsf_workflow_step.dmsf_workflow.id,
:dmsf_workflow_step_assignment_id => assigns[index].id,
:dmsf_file_revision_id => assignment.dmsf_file_revision.id),
:title => l(:title_waiting_for_approval),
:remote => true,
:class => 'icon icon-wf-waiting') %>
<% end %>
<% end %>
</td>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

View File

@ -99,7 +99,7 @@
}
.dmsf_workflow {
/*font-size: 0.8em;*/
font-size: 0.8em;
white-space: nowrap;
}
@ -164,11 +164,13 @@
}
/* Command icons */
.dmsf_icon-link { background-image: url(../images/link.png); }
.dmsf_icon-notification-on { background-image: url(../images/notify.png); margin-left: 3px; }
.dmsf_icon-notification-off { background-image: url(../images/notifynot.png); margin-left: 3px; }
.dmsf_icon-lock { background-image: url(../images/lock.png); }
.dmsf_icon-unlock { background-image: url(../images/unlock.png); }
.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-delete { background-image: url(../images/rev_delete.png); }
.icon-download { background-image: url(../images/rev_download.png); }
.icon-downloads { background-image: url(../images/rev_downloads.png); }
.icon-link { background-image: url(../../../images/link.png); }
/* File types */
.dmsf_gray .icon-folder { background-image: url(../images/folder_gray.png); }
@ -199,7 +201,7 @@
.dmsf_gray .icon-file.text-x-c { background-image: url(../images/filetypes/c_gray.png); }
.dmsf_gray .icon-file.text-x-csharp { background-image: url(../images/filetypes/csharp_gray.png); }
.dmsf_gray .icon-file.text-x-java { background-image: url(../images/files/filetypes/java_gray.png); }
.dmsf_gray .icon-file.text-x-java { background-image: url(../images/filetypes/java_gray.png); }
.dmsf_gray .icon-file.text-x-javascript { background-image: url(../images/filetypes/js_gray.png); }
.dmsf_gray .icon-file.text-x-php { background-image: url(../images/filetypes/php_gray.png); }
.dmsf_gray .icon-file.text-x-ruby { background-image: url(../images/filetypes/ruby_gray.png); }

View File

@ -28,7 +28,7 @@ Redmine::Plugin.register :redmine_dmsf do
name 'DMSF'
author 'Vít Jonáš / Daniel Munn / Karel Pičman'
description 'Document Management System Features'
version '1.5.9'
version '1.6.0'
url 'http://www.redmine.org/plugins/dmsf'
author_url 'https://github.com/danmunn/redmine_dmsf/graphs/contributors'