Show document description in mouseover or column #529

This commit is contained in:
Karel Picman 2016-06-13 13:52:54 +02:00
parent 529296215a
commit 2a68400a89
5 changed files with 43 additions and 12 deletions

View File

@ -452,4 +452,23 @@ class DmsfFile < ActiveRecord::Base
false
end
def tooltip(download_info=true)
text = ''
if self.last_revision
if self.last_revision.description.present?
text = self.last_revision.description
end
if self.last_revision.comment.present?
if text.present?
text += '&#xA;'
end
text += self.last_revision.comment
end
end
if text.blank? && download_info
text = l(:title_title_version_version_download, :title => self.title, :version => self.version)
end
text.html_safe
end
end

View File

@ -31,7 +31,8 @@
<% end %>
<%= link_to(h(title),
dmsf_folder_path(:id => project, :folder_id => subfolder),
:class => 'icon icon-folder') %>
:class => 'icon icon-folder',
:title => subfolder.description.html_safe) %>
<% if link %>
<div class="dmsf_filename" title="<%= l(:label_target_folder)%>"><%= link.path %></div>
<% else %>

View File

@ -24,7 +24,7 @@
:title => l(:title_check_for_restore_or_delete), :id => "subfolder_#{id}") %></td>
<td class="dmsf_title">
<%= content_tag(:span, h(title),
:title => h(title),
:title => h(subfolder.description),
:class => 'icon icon-folder') %>
<% if link %>
<div class="dmsf_filename" title="<%= l(:label_target_folder)%>"><%= link.path %></div>
@ -40,14 +40,25 @@
<td class="dmsf_workflow"></td>
<td class="dmsf_author"><%= h(subfolder.user) %></td>
<td class="dmsf_buttons">
<% if @folder_manipulation_allowed %>
<%= 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'),
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:title_delete)) %>
<% if @folder_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 # 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'),
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:title_delete)) %>
<% end %>
<% end %>
</td>
<td class="dmsf_invisible">0</td>

View File

@ -33,7 +33,7 @@
file_view_url,
:target => '_blank',
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}",
:title => l(:title_title_version_version_download, :title => h(file.title), :version => file.version),
:title => file.tooltip,
'data-downloadurl' => "#{file.last_revision.detect_content_type}:#{h(file.name)}:#{file_view_url}") %>
<div class="dmsf_filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.display_name) %></div>
<%= '</span>'.html_safe if @tree_view %>

View File

@ -24,7 +24,7 @@
:title => l(:title_check_for_restore_or_delete), :id => "file_#{id}") %></td>
<td class="dmsf_title">
<%= content_tag(:span, h(title),
:title => h(title),
:title => h(file.tooltip(false)),
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}") %>
<div class="dmsf_filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.display_name) %></div>
</td>