diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4a712c0f0..cd3322283 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -44,9 +44,8 @@ module OrganizationsHelper def get_attach_org2(field) org_attachments = field.attachments - attachments = User.current.admin? ? org_attachments : visable_attachemnts(org_attachments) - return attachments.sort_by{|x| x.created_on}.reverse.first(6) - # Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;") + attachments = User.current.admin? ? org_attachments.first(5) : visable_attachemnts(org_attachments).first(5) + attachments.sort_by{|x| x.created_on}.reverse end # 从内容中获取路径 diff --git a/app/views/organizations/_org_custom_right3.html.erb b/app/views/organizations/_org_custom_right3.html.erb index 698a2ea25..c29097400 100644 --- a/app/views/organizations/_org_custom_right3.html.erb +++ b/app/views/organizations/_org_custom_right3.html.erb @@ -1,91 +1,146 @@ -
+ <%= link_to truncate(attach.filename,length: 20, omission: '...'), + download_named_attachment_path(attach.id, attach.filename), + :title => attach.filename+"\n"+attach.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> +
+ ++ 类型:<%= attach.tag_list[0] %> + 下载:<%= attach.downloads %> + 引用:<%= attach.quotes.nil? ? 0 : attach.quotes %> +
+