Reworked Files tab of collection view a bit.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Mon, 13 Jan 2014 16:49:06 +0000 (11:49 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Mon, 13 Jan 2014 16:49:06 +0000 (11:49 -0500)
apps/workbench/app/views/collections/show.html.erb

index d525c7804cc329f1c542cee88b86f43343d31d97..057ced89fd164104f71a329aba5bd300819431d9 100644 (file)
         <tr>
           <th style="width: 10em; text-align:right">size</th>
           <th>
-            <div style="width:3.5em; display:inline-block"></div>
             path
           </th>
+          <th>
+            file
+          </th>
+          <th style="width:2em">
+          </th>
         </tr>
       </thead><tbody>
         <% if @object then @object.files.sort_by{|f|f[1]}.each do |file| %>
         <tr>
           <td style="text-align:right">
             <%= raw(human_readable_bytes_html(file[2])) %>
-          </td><td>
-            <div style="width:3.5em; display:inline-block">
+          </td>
+          <td>
+            <%= file[0] %>
+          </td>
+          <td>
+            <%= link_to file[1], {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'}, {title: 'View in browser'} %>
+          </td>
+          <td>
+            <div style="display:inline-block">
             <%= link_to raw('<i class="icon-download"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'attachment'}, {class: 'label label-info', title: 'Download'} %>
-            <% if file_path.match /\.(txt|pdf|png|jpe?g|gif|tiff?|html?)$/i %>
-            <%= link_to raw('<i class="icon-play"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'}, {class: 'label label-info', title: 'View in browser'} %>
-            <% end %>
             </div>
-            <%= file_path %>
           </td>
         </tr>
         <% end; end %>