#48 thumbnails

This commit is contained in:
Karel Picman 2017-07-20 10:13:25 +02:00
parent 23176ba0e3
commit cf6aee043c
3 changed files with 8 additions and 5 deletions

View File

@ -28,6 +28,6 @@
<% links.each do |dmsf_file, link, create_at| %> <% links.each do |dmsf_file, link, create_at| %>
<%= render :partial => 'dmsf_files/link', :locals => { :dmsf_file => dmsf_file, :link => link } %> <%= render :partial => 'dmsf_files/link', :locals => { :dmsf_file => dmsf_file, :link => link } %>
<% end %> <% end %>
<%= render :partial => 'dmsf_files/thumbnails', :locals => { :links => links, :thumbnails => thumbnails } %> <%= render :partial => 'dmsf_files/thumbnails', :locals => { :links => links, :thumbnails => thumbnails, :link_to => true } %>
</div> </div>
<% end %> <% end %>

View File

@ -27,9 +27,12 @@
<div class="thumbnails"> <div class="thumbnails">
<% images.each do |file| %> <% images.each do |file| %>
<div> <div>
<%= link_to image_tag(dmsf_thumbnail_path(file)), <% if link_to # Redmine classic %>
url_for({:controller => :dmsf_files, :action => 'view', :id => file}), <%= link_to image_tag(dmsf_thumbnail_path(file)), view_dmsf_file_path(file), :alt => file.title %>
:alt => file.title %> <% else # jQuery gallery %>
<%= image_tag(dmsf_thumbnail_path(file),
{ :'data-fullsrc' => view_dmsf_file_path(file), :alt => file.title }) %>
<% end %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@ -78,7 +78,7 @@ module RedmineDmsf
if links.present? if links.present?
html = controller.send(:render_to_string, html = controller.send(:render_to_string,
{ :partial => 'dmsf_files/thumbnails', { :partial => 'dmsf_files/thumbnails',
:locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} }) :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?, :link_to => false } })
html.html_safe html.html_safe
end end
end end