Revision 912:5e80956cc792 app/views/files
| app/views/files/index.html.erb | ||
|---|---|---|
| 19 | 19 |
</tr></thead> |
| 20 | 20 |
<tbody> |
| 21 | 21 |
<% have_file = false %> |
| 22 |
<% @containers.each do |container| %>
|
|
| 22 |
<% @containers.each do |container| %> |
|
| 23 | 23 |
<% next if container.attachments.empty? -%> |
| 24 |
<% if container.is_a?(Version) -%>
|
|
| 24 |
<% if container.is_a?(Version) -%>
|
|
| 25 | 25 |
<tr> |
| 26 | 26 |
<th colspan="7" align="left"> |
| 27 |
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
|
| 28 |
</th>
|
|
| 29 |
</tr>
|
|
| 30 |
<% end -%>
|
|
| 31 |
<% container.attachments.each do |file| %>
|
|
| 27 |
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
|
| 28 |
</th>
|
|
| 29 |
</tr>
|
|
| 30 |
<% end -%>
|
|
| 31 |
<% container.attachments.each do |file| %> |
|
| 32 | 32 |
<tr class="file <%= cycle("odd", "even") %> <%= "active" if file.active? %>">
|
| 33 | 33 |
<td class="active"> |
| 34 | 34 |
<% have_file = true %> |
| ... | ... | |
| 55 | 55 |
<td class="downloads"><%= file.downloads %></td> |
| 56 | 56 |
<td class="digest"><%= file.digest %></td> |
| 57 | 57 |
<td align="center"> |
| 58 |
<%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file},
|
|
| 59 |
:confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %>
|
|
| 58 |
<%= link_to(image_tag('delete.png'), attachment_path(file),
|
|
| 59 |
:confirm => l(:text_are_you_sure), :method => :delete) if delete_allowed %>
|
|
| 60 | 60 |
</td> |
| 61 |
</tr>
|
|
| 61 |
</tr> |
|
| 62 | 62 |
<% end |
| 63 | 63 |
reset_cycle %> |
| 64 | 64 |
<% end %> |
| app/views/files/new.html.erb | ||
|---|---|---|
| 7 | 7 |
<% if @versions.any? %> |
| 8 | 8 |
<p><label for="version_id"><%=l(:field_version)%></label> |
| 9 | 9 |
<%= select_tag "version_id", content_tag('option', '') +
|
| 10 |
options_from_collection_for_select(@versions, "id", "name") %></p>
|
|
| 10 |
options_from_collection_for_select(@versions, "id", "name") %></p>
|
|
| 11 | 11 |
<% end %> |
| 12 | 12 |
|
| 13 | 13 |
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
| 14 | 14 |
</div> |
| 15 | 15 |
<%= submit_tag l(:button_add) %> |
| 16 |
<% end %> |
|
| 16 |
<% end %> |
|
Also available in: Unified diff