Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
14
app/views/files/index.api.rsb
Normal file
14
app/views/files/index.api.rsb
Normal file
|
@ -0,0 +1,14 @@
|
|||
api.array :files do
|
||||
@containers.each do |container|
|
||||
container.attachments.each do |attachment|
|
||||
api.file do
|
||||
render_api_attachment_attributes(attachment, api)
|
||||
if container.is_a?(Version)
|
||||
api.version :id => container.id, :name => container.name
|
||||
end
|
||||
api.digest attachment.digest
|
||||
api.downloads attachment.downloads
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
46
app/views/files/index.html.erb
Normal file
46
app/views/files/index.html.erb
Normal file
|
@ -0,0 +1,46 @@
|
|||
<div class="contextual">
|
||||
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_attachment_plural)%></h2>
|
||||
|
||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
|
||||
<table class="list files">
|
||||
<thead><tr>
|
||||
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
||||
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
||||
<th><%= l(:field_digest) %></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% @containers.each do |container| %>
|
||||
<% next if container.attachments.empty? -%>
|
||||
<% if container.is_a?(Version) -%>
|
||||
<tr>
|
||||
<th colspan="6">
|
||||
<%= link_to(container, {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
||||
</th>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% container.attachments.each do |file| %>
|
||||
<tr class="file">
|
||||
<td class="filename"><%= link_to_attachment file, :title => file.description -%></td>
|
||||
<td class="created_on"><%= format_time(file.created_on) %></td>
|
||||
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
||||
<td class="downloads"><%= file.downloads %></td>
|
||||
<td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %>
|
||||
<%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del',
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
16
app/views/files/new.html.erb
Normal file
16
app/views/files/new.html.erb
Normal file
|
@ -0,0 +1,16 @@
|
|||
<h2><%=l(:label_attachment_new)%></h2>
|
||||
|
||||
<%= error_messages_for 'attachment' %>
|
||||
<%= form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %>
|
||||
<div class="box">
|
||||
|
||||
<% if @versions.any? %>
|
||||
<p><label for="version_id"><%=l(:field_version)%></label>
|
||||
<%= select_tag "version_id", content_tag('option', '') +
|
||||
options_from_collection_for_select(@versions, "id", "name") %></p>
|
||||
<% end %>
|
||||
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue