Project

General

Profile

Feature #11543 » 11543.patch

Yuichi HARADA, 2021-03-31 10:09

View differences:

app/views/attachments/_links.html.erb
) if attachments.size > 1 %>
</div>
<table>
<thead>
<tr>
<th><%= l(:field_name) %></th>
<th><%= l(:field_description) %></th>
<% if options[:author] %>
<th><%= l(:field_author) %></th>
<th><%= l(:field_created_on) %></th>
<% end %>
<td></td>
</tr>
</thead>
<tbody>
<% for attachment in attachments %>
<tr>
<td>
......
<%= link_to_attachment attachment, class: 'icon-only icon-download', title: l(:button_download), download: true -%>
</td>
<td><%= attachment.description unless attachment.description.blank? %></td>
<td>
<% if options[:author] %>
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
<% end %>
</td>
<% if options[:author] %>
<td><span class="author"><%= attachment.author %></span></td>
<td><span class="author"><%= format_time(attachment.created_on) %></span></td>
<% end %>
<td>
<% if options[:deletable] %>
<%= link_to l(:button_delete), attachment_path(attachment),
......
</td>
</tr>
<% end %>
</tbody>
</table>
<% if defined?(thumbnails) && thumbnails %>
<% images = attachments.select(&:thumbnailable?) %>
public/javascripts/application.js
$(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) {
......
});
}
function setupWikiTableSortableHeader() {
setupTableSortableHeader('div.wiki table');
}
function setupAttachmentsTableSortableHeader() {
setupTableSortableHeader('div.attachments table');
}
$(function () {
$("[title]:not(.no-tooltip)").tooltip({
show: {
......
$(document).ready(setupTabs);
$(document).ready(setupFilePreviewNavigation);
$(document).ready(setupWikiTableSortableHeader);
$(document).ready(setupAttachmentsTableSortableHeader);
$(document).on('focus', '[data-auto-complete=true]', function(event) {
inlineAutoComplete(event.target);
});
public/stylesheets/application.css
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;}
(3-3/5)