@@ -1,44 +1,44 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %> |
|
2 | <%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %> | |
3 | </div> |
|
3 | </div> | |
4 |
|
4 | |||
5 | <h2><%=l(:label_attachment_plural)%></h2> |
|
5 | <h2><%=l(:label_attachment_plural)%></h2> | |
6 |
|
6 | |||
7 | <% delete_allowed = authorize_for('versions', 'destroy_file') %> |
|
7 | <% delete_allowed = authorize_for('versions', 'destroy_file') %> | |
8 |
|
8 | |||
9 | <table class="list"> |
|
9 | <table class="list"> | |
10 | <thead><tr> |
|
10 | <thead><tr> | |
11 | <th><%=l(:field_version)%></th> |
|
11 | <th><%=l(:field_version)%></th> | |
12 | <th><%=l(:field_filename)%></th> |
|
12 | <th><%=l(:field_filename)%></th> | |
13 | <th><%=l(:label_date)%></th> |
|
13 | <th><%=l(:label_date)%></th> | |
14 | <th><%=l(:field_filesize)%></th> |
|
14 | <th><%=l(:field_filesize)%></th> | |
15 | <th>D/L</th> |
|
15 | <th>D/L</th> | |
16 | <th>MD5</th> |
|
16 | <th>MD5</th> | |
17 | <% if delete_allowed %><th></th><% end %> |
|
17 | <% if delete_allowed %><th></th><% end %> | |
18 | </tr></thead> |
|
18 | </tr></thead> | |
19 | <tbody> |
|
19 | <tbody> | |
20 | <% for version in @versions %> |
|
20 | <% for version in @versions %> | |
21 | <% unless version.attachments.empty? %> |
|
21 | <% unless version.attachments.empty? %> | |
22 | <tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr> |
|
22 | <tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr> | |
23 | <% for file in version.attachments %> |
|
23 | <% for file in version.attachments %> | |
24 | <tr class="<%= cycle("odd", "even") %>"> |
|
24 | <tr class="<%= cycle("odd", "even") %>"> | |
25 | <td></td> |
|
25 | <td></td> | |
26 | <td><%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %></td> |
|
26 | <td><%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %></td> | |
27 | <td align="center"><%= format_date(file.created_on) %></td> |
|
27 | <td align="center"><%= format_date(file.created_on) %></td> | |
28 | <td align="center"><%= number_to_human_size(file.filesize) %></td> |
|
28 | <td align="center"><%= number_to_human_size(file.filesize) %></td> | |
29 | <td align="center"><%= file.downloads %></td> |
|
29 | <td align="center"><%= file.downloads %></td> | |
30 | <td align="center"><small><%= file.digest %></small></td> |
|
30 | <td align="center"><small><%= file.digest %></small></td> | |
31 | <% if delete_allowed %> |
|
31 | <% if delete_allowed %> | |
32 | <td align="center"> |
|
32 | <td align="center"> | |
33 | <div class="contextual"> |
|
33 | <div class="contextual"> | |
34 |
<%= link_to_if_authorized '', {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post |
|
34 | <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post %> | |
35 | </div> |
|
35 | </div> | |
36 | </td> |
|
36 | </td> | |
37 | <% end %> |
|
37 | <% end %> | |
38 | </tr> |
|
38 | </tr> | |
39 | <% end |
|
39 | <% end | |
40 | reset_cycle %> |
|
40 | reset_cycle %> | |
41 | <% end %> |
|
41 | <% end %> | |
42 | <% end %> |
|
42 | <% end %> | |
43 | </tbody> |
|
43 | </tbody> | |
44 | </table> No newline at end of file |
|
44 | </table> |
General Comments 0
You need to be logged in to leave comments.
Login now