socialforge/app/views/files/index.html.erb

114 lines
4.0 KiB
Plaintext
Raw Normal View History

<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
2014-01-13 16:29:02 +08:00
<style>
table {
line-height: 25px;
font-size: 14px;
}
#ver-zebra
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 20px;
width: 98%;
text-align: left;
border-collapse: collapse;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
</style>
2013-11-08 17:20:26 +08:00
<div class="content-title-top">
2013-09-13 22:25:31 +08:00
<% if @project.project_type == 1 %>
<% if User.current.member_of?(@project) %>
2013-10-22 16:15:27 +08:00
<!-- %= link_to(l(:label_file_upload), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) % -->
<%= link_to(l(:label_file_upload), new_project_file_path(@project), :class => 'icon icon-add') if User.current.member_of?(@project) %>
<% end %>
2013-09-13 22:25:31 +08:00
<% else %>
2013-10-22 16:15:27 +08:00
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<!-- %= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.member_of?(@project) % -->
2013-09-13 22:25:31 +08:00
<% end %>
2013-11-08 17:20:26 +08:00
</div>
2013-08-01 10:33:49 +08:00
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
2014-01-13 16:29:02 +08:00
<table class="list files" id="ver-zebra">
<colgroup>
<col class="vzebra-odd" />
<col class="vzebra-even" />
<col class="vzebra-odd" />
<col class="vzebra-even" />
</colgroup>
2013-08-01 10:33:49 +08:00
<thead><tr>
2014-01-13 16:29:02 +08:00
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
<%= sort_header_tag('downloads', :caption => "操作", :scope =>"col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
2013-08-01 10:33:49 +08:00
</tr></thead>
<tbody>
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% if container.is_a?(Version) -%>
<tr>
<th colspan="6" align="left">
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
</th>
</tr>
<% end -%>
<% container.attachments.each do |file| %>
<tr class="file <%= cycle("odd", "even") %>">
2014-01-13 20:46:27 +08:00
<td class="filename" style="font-size: 12px; width: 240px; "><%= link_to_attachment file, :download => true, :title => file.description, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></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>
2014-01-13 16:29:02 +08:00
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<% end %>
<% reset_cycle %>
<% end %>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
2013-08-01 10:33:49 +08:00
</tbody>
</table>
<% html_title(l(:label_attachment_plural)) -%>
2013-09-23 09:32:04 +08:00