|
10 | 10 |
|
11 | 11 | <table> |
12 | 12 | <% for attachment in attachments %> |
| 13 | +<% caption = "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %> |
13 | 14 | <tr> |
14 | 15 | <td> |
15 | 16 | <% if attachment.is_image? %> |
|
19 | 20 | <%= link_to l(:button_view), |
20 | 21 | { :controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }, |
21 | 22 | :class => 'icon-only icon-magnifier lightbox_preview ' + attachment.filename.split('.').last.downcase, |
22 | | - :rel => 'attachments', :title => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }", |
| 23 | + :rel => 'attachments', :title => l(:label_preview), |
23 | 24 | :data => { |
24 | 25 | :type => 'image', |
25 | 26 | :fancybox => 'attachments', |
26 | | - :caption => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" |
| 27 | + :caption => caption |
27 | 28 | } %> |
28 | 29 |
|
29 | 30 | <% elsif attachment.is_pdf? %> |
|
33 | 34 | <%= link_to l(:button_view), |
34 | 35 | { :controller => 'attachments', :action => 'download_inline', :id => attachment, :filename => attachment.filename }, |
35 | 36 | :class => 'icon-only icon-magnifier lightbox_preview pdf', |
36 | | - :rel => 'attachments', :title => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }", |
| 37 | + :rel => 'attachments', :title => l(:label_preview), |
37 | 38 | :data => { |
38 | 39 | :type => 'iframe', |
39 | 40 | :fancybox => 'attachments', |
40 | | - :caption => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" |
| 41 | + :caption => caption |
41 | 42 | } %> |
42 | 43 |
|
43 | 44 | <% else %> |
|
74 | 75 | <% if images.any? %> |
75 | 76 | <div class="thumbnails images"> |
76 | 77 | <% images.each do |attachment| %> |
| 78 | + <% caption = "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %> |
77 | 79 | <div> |
78 | 80 | <%= |
79 | 81 | link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)), |
80 | 82 | { :controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }, |
81 | | - :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }", |
| 83 | + :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => l(:label_preview) + ': ' + caption, |
82 | 84 | :data => { |
83 | 85 | :type => attachment.is_pdf? ? 'iframe' : 'image', |
84 | 86 | :fancybox => 'thumbnails', |
85 | | - :caption => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" |
| 87 | + :caption => caption |
86 | 88 | } |
87 | 89 | %> |
88 | 90 | </div> |
|
94 | 96 | <% unless images.empty? %> |
95 | 97 | <div class='images'> |
96 | 98 | <% images.each do |attachment| %> |
| 99 | + <% caption = "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %> |
97 | 100 | <%= link_to image_tag(url_for({:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }), :width => Setting.thumbnails_size), |
98 | 101 | { :controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }, |
99 | | - :class => 'lightbox', :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }", |
| 102 | + :class => 'lightbox', :rel => 'thumbnails', :title => l(:label_preview) + ': ' + caption, |
100 | 103 | :data => { |
101 | 104 | :type => attachment.is_pdf? ? 'iframe' : 'image', |
102 | 105 | :fancybox => 'thumbnails', |
103 | | - :caption => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" |
| 106 | + :caption => caption |
104 | 107 | } |
105 | 108 | %> |
106 | 109 | <% end -%> |
|
0 commit comments