From c8eb2d9c954b8a10cfc1c50980d5dcadb88ec1c9 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 17 Mar 2016 12:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B5=84=E6=BA=90=E5=8E=86=E5=8F=B2=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_org_subfield_list.html.erb | 14 +++++++++++--- app/views/files/_project_list.html.erb | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) 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%>