only-icons

This commit is contained in:
Karel Picman 2017-08-03 14:44:44 +02:00
parent 54158eb9db
commit 20efe84ad1
7 changed files with 45 additions and 39 deletions

View File

@ -59,10 +59,11 @@ module DmsfHelper
extension = File.extname(filename)
extension = extension[1, extension.length-1]
if File.exist?("#{File.dirname(__FILE__)}/../../assets/images/filetypes/#{extension}.png")
"filetype-#{extension}";
cls = "filetype-#{extension}";
else
Redmine::MimeType.css_class_of(filename)
cls = Redmine::MimeType.css_class_of(filename)
end
cls + ' dmsf-icon-file'
end
def plugin_asset_path(plugin, asset_type, source)

View File

@ -83,45 +83,45 @@
<td class="dmsf_buttons">
<% if @folder_manipulation_allowed && !(subfolder && subfolder.system) %>
<% if subfolder && subfolder.locked? %>
<span class="icon"></span>
<span class="icon-only"></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') %>
:class => 'icon-only icon-unlock') %>
<% else %>
<span class="icon icon-unlock" title="<%= subfolder.get_locked_title %>"></span>
<span class="icon-only 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') %>
:class => 'icon-only icon-edit') %>
<% else %>
<%= link_to('', edit_root_dmsf_path(:id => @project),
:title => l(:link_edit, :title => l(:link_documents)),
:class => 'icon icon-edit') %>
: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 icon-lock') %>
:class => 'icon-only icon-lock') %>
<% else %>
<span class="icon"></span>
<span class="icon-only"></span>
<% 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 icon-email') %>
: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 icon-email-add') %>
: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 icon-del') %>
:class => 'icon-only icon-del') %>
<% end %>
<% end %>
</td>

View File

@ -69,19 +69,19 @@
<% 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') %>
: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 icon-delete') %>
:class => 'icon-only 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),
:method => :delete,
:class => 'icon icon-delete') %>
:class => 'icon-only icon-delete') %>
<% end %>
<% end %>
</td>

View File

@ -89,48 +89,48 @@
<% if @file_manipulation_allowed %>
<%= link_to('', dmsf_file_path(:id => file),
:title => l(:link_details, :title => h(file.last_revision.title)),
:class => 'icon icon-edit') %>
:class => 'icon-only icon-edit') %>
<% if !file.locked? %>
<%= link_to('', lock_dmsf_files_path(:id => file),
:title => l(:title_lock_file),
:class => 'icon icon-lock') %>
: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 icon-unlock') %>
:class => 'icon-only icon-unlock') %>
<% else %>
<span class="icon icon-unlock" title="<%= file.get_locked_title %>"></span>
<span class="icon-only icon-unlock" title="<%= file.get_locked_title %>"></span>
<% end %>
<% unless file.locked? %>
<% if file.notification %>
<%= link_to('', notify_deactivate_dmsf_files_path(:id => file),
:title => l(:title_notifications_active_deactivate),
:class => 'icon icon-email') %>
:class => 'icon-only icon-email') %>
<% else %>
<%= link_to('', notify_activate_dmsf_files_path(:id => file),
:title => l(:title_notifications_not_active_activate),
:class => 'icon icon-email-add') %>
: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 icon-del') %>
: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 icon-del') %>
:class => 'icon-only icon-del') %>
<% else %>
<span class="icon"></span>
<span class="icon-only"></span>
<% end %>
<% end %>
<% else %>
<span class="icon"></span>
<span class="icon"></span>
<span class="icon-only"></span>
<span class="icon-only"></span>
<% end %>
<% end %>
<%= render(:partial => 'dmsf_files/approval_workflow_button',

View File

@ -69,14 +69,14 @@
<% 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 icon-cancel') %>
: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 icon-delete') %>
:class => 'icon-only icon-delete') %>
<% end %>
</td>
<td class="hol">1</td>

View File

@ -46,36 +46,36 @@
<% if User.current.allowed_to? :file_manipulation, dmsf_file.project %>
<%= link_to('', dmsf_file_path(:id => dmsf_file),
:title => l(:link_details, :title => h(dmsf_file.last_revision.title)),
:class => 'icon icon-edit') %>
:class => 'icon-only icon-edit') %>
<% else %>
<span class="icon"></span>
<span class="icon-only"></span>
<% end %>
<% # Email %>
<%= link_to('', entries_operations_dmsf_path(:id => dmsf_file.project, :email_entries => 'email', :files => [dmsf_file.id]), :method => :post,
:title => l(:heading_send_documents_by_email),
:class => 'icon icon-email-disabled') %>
:class => 'icon-only icon-email-disabled') %>
<% # Lock %>
<% if !dmsf_file.locked? %>
<%= link_to('', lock_dmsf_files_path(:id => dmsf_file),
:title => l(:title_lock_file),
:class => 'icon icon-lock') %>
:class => 'icon-only icon-lock') %>
<% elsif dmsf_file.unlockable? && (!dmsf_file.locked_for_user? || User.current.allowed_to?(:force_file_unlock, dmsf_file.project)) %>
<%= link_to('', unlock_dmsf_files_path(:id => dmsf_file),
:title => dmsf_file.get_locked_title,
:class => 'icon icon-unlock') %>
:class => 'icon-only icon-unlock') %>
<% else %>
<span class="icon icon-unlock" title="<%= dmsf_file.get_locked_title %>"></span>
<span class="icon-only icon-unlock" title="<%= dmsf_file.get_locked_title %>"></span>
<% end %>
<% unless dmsf_file.locked? %>
<% # Notifications %>
<% if dmsf_file.notification %>
<%= link_to('', notify_deactivate_dmsf_files_path(:id => dmsf_file),
:title => l(:title_notifications_active_deactivate),
:class => 'icon icon-email') %>
:class => 'icon-only icon-email') %>
<% else %>
<%= link_to('', notify_activate_dmsf_files_path(:id => dmsf_file),
:title => l(:title_notifications_not_active_activate),
:class => 'icon icon-email-add') %>
:class => 'icon-only icon-email-add') %>
<% end %>
<% # Delete %>
<% if @issue.attributes_editable? && User.current.allowed_to?(:file_delete, dmsf_file.project) %>
@ -84,11 +84,11 @@
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:title_delete),
:class => 'icon icon-del') %>
:class => 'icon-only icon-del') %>
<% end %>
<% else %>
<span class="icon"></span>
<span class="icon"></span>
<span class="icon-only"></span>
<span class="icon-only"></span>
<% end %>
<% # Approval workflow %>
<% wf = DmsfWorkflow.find_by_id(dmsf_file.last_revision.dmsf_workflow_id) if dmsf_file.last_revision.dmsf_workflow_id %>

View File

@ -206,6 +206,11 @@ div.dmsf_revision_inner_box .attribute .label {
.icon-approvalworkflows { background-image: url(../../../images/ticket_go.png); }
/* File types */
.dmsf-icon-file{
display: inline-block;
height: 16px;
}
.dmsf_gray .icon-folder { background-image: url(../images/folder_gray.png); }
.dmsf_system .icon-folder { background-image: url(../images/folder_system.png); }
.dmsf_system_closed .icon-folder { background-image: url(../images/folder_system_closed.png); }