diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 25d022029..cabfc7766 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -12,6 +12,18 @@ ) if attachments.size > 1 %> + + + + +<% if options[:author] %> + + +<% end %> + + + + <% for attachment in attachments %> - + <% if options[:author] %> + + + <% end %> <% end %> +
<%= l(:field_name) %><%= l(:field_description) %><%= l(:field_author) %><%= l(:field_created_on) %>
@@ -20,11 +32,10 @@ <%= link_to_attachment attachment, class: 'icon-only icon-download', title: l(:button_download), download: true -%> <%= attachment.description unless attachment.description.blank? %> - <% if options[:author] %> - <%= attachment.author %>, <%= format_time(attachment.created_on) %> - <% end %> - <%= attachment.author %><%= format_time(attachment.created_on) %> <% if options[:deletable] %> <%= link_to l(:button_delete), attachment_path(attachment), @@ -36,6 +47,7 @@
<% if defined?(thumbnails) && thumbnails %> <% images = attachments.select(&:thumbnailable?) %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e60425cae..da086f76c 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1096,8 +1096,8 @@ function setupAttachmentDetail() { $(window).resize(setFilecontentContainerHeight); } -function setupWikiTableSortableHeader() { - $('div.wiki table').each(function(i, table){ +function setupTableSortableHeader(selector) { + $(selector).each(function(i, table){ if (table.rows.length < 3) return true; var tr = $(table.rows).first(); if (tr.find("TH").length > 0) { @@ -1108,6 +1108,14 @@ function setupWikiTableSortableHeader() { }); } +function setupWikiTableSortableHeader() { + setupTableSortableHeader('div.wiki table'); +} + +function setupAttachmentsTableSortableHeader() { + setupTableSortableHeader('div.attachments table'); +} + $(function () { $("[title]:not(.no-tooltip)").tooltip({ show: { @@ -1209,6 +1217,7 @@ $(document).ready(setupAttachmentDetail); $(document).ready(setupTabs); $(document).ready(setupFilePreviewNavigation); $(document).ready(setupWikiTableSortableHeader); +$(document).ready(setupAttachmentsTableSortableHeader); $(document).on('focus', '[data-auto-complete=true]', function(event) { inlineAutoComplete(event.target); }); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index fca5f5647..c2dfa8eae 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -938,6 +938,8 @@ div.fileover, p.custom-field-filedroplistner.fileover { background-color: lavend div.attachments p { margin:4px 0 2px 0; } div.attachments img { vertical-align: middle; } div.attachments span.author { font-size: 0.9em; color: #888; } +div.attachments table { border-collapse:collapse; } +div.attachments table thead { border-bottom:1px solid #ccc; } div.thumbnails {margin:0.6em;} div.thumbnails div {background:#fff;border:2px solid #ddd;display:inline-block;margin-right:2px;}