2014-04-20 01:29:52 +00:00
|
|
|
<div id="file">
|
2020-03-22 17:47:24 +00:00
|
|
|
<h1><%=h @file %></h1>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<%= cascade @file, [["Filename", "name.identifier".to_sym], "size_s", "directory", ["Directory path", "directory.path".to_sym], "md5_s", ["Modified", "created_at"]] %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<% if cuser and cuser.admin? %>
|
2014-04-20 01:29:52 +00:00
|
|
|
<div class="actions">
|
2020-03-22 17:47:24 +00:00
|
|
|
<% if @file.can_update? cuser %>
|
2014-04-20 01:29:52 +00:00
|
|
|
<%= link_to 'Edit', edit_data_file_path(@file), class: 'button tiny' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end; if @file.can_destroy? cuser %>
|
2014-04-20 01:29:52 +00:00
|
|
|
<%= link_to 'Destroy', @file, confirm: 'Are you sure?', method: :delete, class: 'button tiny' %>
|
2020-03-22 17:47:24 +00:00
|
|
|
<% end %>
|
2014-04-20 01:29:52 +00:00
|
|
|
</div>
|
2020-03-22 17:47:24 +00:00
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<%= link_to "Download", @file.url, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<% if @file.related_files.count > 0 %>
|
|
|
|
<div class="files-list">
|
|
|
|
<h4>Related Files</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<table class="striped">
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Size</th>
|
|
|
|
<th>MD5</th>
|
|
|
|
<th>Modified</th>
|
|
|
|
</tr>
|
|
|
|
<% @file.related_files.each do |related| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= link_to (h related.name.filename), related.name.url %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= related.size_s %> MB
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= related.md5_s %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= shorttime related.created_at %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</div>
|
|
|
|
|
2020-03-22 17:47:24 +00:00
|
|
|
<%= add_comments @file %>
|