/
_resource.html.erb
37 lines (32 loc) · 1.5 KB
/
_resource.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%
edit_url = refinery.edit_admin_resource_path(resource)
delete_url = refinery.admin_resource_path(resource)
delete_options = {data: {confirm: t('.message', scope: 'refinery.admin.delete', title: resource.title)}}
%>
<li class="clearfix record <%= cycle('on', 'on-hover') %>">
<span class="title <%= resource.ext.try(:downcase) %>">
<%= resource_title_with_translations resource %>
</span>
<% if Refinery::I18n.frontend_locales.many? %>
<span class='locales'>
<% resource.translations.sort_by{ |t| Refinery::I18n.frontend_locales.index(t.locale)}.each do |translation| %>
<% if translation.resource_title.present? %>
<%= link_to refinery.edit_admin_resource_path(resource, switch_locale: translation.locale),
class: 'locale', title: translation.locale.upcase do %>
<div class="<%=translation.locale %> locale_marker">
<%= locale_text_icon(translation.locale.upcase) %>
</div>
<% end %>
<% end %>
<% end %>
</span>
<% end %>
<span class="preview">
<%= resource.file_name %> - <%= number_to_human_size(resource.size) %>
</span>
<span class="actions">
<%= action_icon :download, resource.url, t('.download', size: number_to_human_size(resource.size)) %>
<%= action_icon :edit, edit_url, t('edit', scope: 'refinery.admin.resources') %>
<%= action_icon :delete, delete_url, t('delete', scope: 'refinery.admin.resources'), delete_options %>
</span>
</li>