diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index 90ae3516d..b839128da 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -9,9 +9,17 @@
- <%= link_to file.is_public? ? truncate(file.filename, length: 70) : truncate(file.filename,length: 50, omission: '...'), - download_named_attachment_path(file.id, file.filename), - :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14 f_l" %> + <%# 如果有历史版本则提供历史版本下载 %> + <% if file.attachment_histories.count == 0 %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), + download_named_attachment_path(file.id, file.filename), + :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> + <% else %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id), + :title => file.filename+"\n"+file.description.to_s, + :class => "linkGrey3 f_14", + :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %> + <% end %> <%= file_preview_eye(file, class: 'preview') %> <% if file.is_public? == false%> diff --git a/app/views/files/_project_list.html.erb b/app/views/files/_project_list.html.erb index a2a1670d1..2ee726d77 100644 --- a/app/views/files/_project_list.html.erb +++ b/app/views/files/_project_list.html.erb @@ -8,9 +8,17 @@
- <%= link_to truncate(file.filename,length: 35, omission: '...'), - download_named_attachment_path(file.id, file.filename), - :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> + <%# 如果有历史版本则提供历史版本下载 %> + <% if file.attachment_histories.count == 0 %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), + download_named_attachment_path(file.id, file.filename), + :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> + <% else %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id), + :title => file.filename+"\n"+file.description.to_s, + :class => "linkGrey3 f_14", + :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %> + <% end %> <%= file_preview_eye(file, class: 'preview') %> <% if file.is_public? == false%>