Feature #11543 » 11543-v2.patch
| app/views/attachments/_links.html.erb | ||
|---|---|---|
|
) if attachments.size > 1 %>
|
||
|
</div>
|
||
|
<table>
|
||
|
<% for attachment in attachments %>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th style="width:20px;">#</th>
|
||
|
<th><%= l(:field_name) %></th>
|
||
|
<th><%= l(:field_description) %></th>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<% attachments.each_with_index do |attachment, index| %>
|
||
|
<tr>
|
||
|
<td><%= index + 1 %></td>
|
||
|
<td>
|
||
|
<%= link_to_attachment attachment, class: 'icon icon-attachment' -%>
|
||
|
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
||
| ... | ... | |
|
</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;}
|
||
- « Previous
- 1
- …
- 3
- 4
- 5
- Next »