orbit4-5/app/views/admin/assets/_asset.html.erb

35 lines
1.6 KiB
Plaintext

<table id="asset_sort_list" class="table main-list">
<thead>
<tr>
<th></th>
<th><%= t(:filename) %></th>
<th><%= t(:size) %></th>
<th><%= t(:description) %></th>
<th></th>
</tr>
</thead>
<tbody id="tbody_assets" class="sort-holder">
<% @assets.each do |asset| %>
<tr id="asset_<%= asset.id %>" class="with_action">
<td>
<%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %>
<input type="hidden" value="<%= asset.data.url %>" id="url_<%= asset.id %>" />
<% @site_in_use_locales.each_with_index do |locale, i| %>
<input type="hidden" value="<%= asset.description_translations[locale] rescue nil %>" id="<%= locale %>_desc_<%= asset.id %>" />
<input type="hidden" value="<%= asset.title_translations[locale] rescue nil %>" id="<%= locale %>_title_<%= asset.id %>" />
<% end %>
<input type="hidden" value="<%= File.extname(asset.data.url) %>" id="ext_<%= asset.id %>" />
</td>
<td><%= asset.title_translations[I18n.locale.to_s] rescue nil %></td>
<td><%= number_to_human_size(asset.data.file.size) rescue nil %></td>
<td><%= asset.description rescue nil %></td>
<td>
<a href="<%= edit_admin_asset_path(asset) %>" class="editform"><%= t(:edit) %></a>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="pagination pagination-centered">
<%= paginate @assets, :params => {:controller => 'assets', :action => 'index', :direction => params[:direction], :sort => params[:sort], :type => params[:type]}, :remote => true %>
</div>