<% content_for :content_title, 'Media Library' %> <% toolbar = toolbar_btn(icons(:new), new_admin_media_file_path, title: 'New Upload', class: "btn btn-link btn-icon") %> <%= panel title: 'Thumbnails', toolbar: toolbar do %>
Filter by tag:
<%= link_to content_tag(:span, 'all', class: "tag #{'active' if @tag_filter == 'all'}"), admin_media_files_path(filter: 'all') %> <%= link_to content_tag(:span, '/', class: "tag #{'active' if @tag_filter == 'top'}"), admin_media_files_path(filter: 'top') %> <% MediaFile.tag_list_all.each do |tag| %> <% active_tag = (@tag_filter == tag ? 'active' : '') %> <%= link_to content_tag(:span, tag, class: "tag #{active_tag}"), admin_media_files_path(filter: tag) %> <% end %>
<%#--- List Tab %>
<% @media_files.each do |media_file| %> <% end %>
<% if media_file.image? or media_file.pdf? %> <%= link_to image_tag(media_file.media_url(:thumb)), media_file.media_url, class: 'thumbnail lightbox' %> <% else %> <%= link_to media_file.media_url do %>
<%= media_file.media.file.extension %>
<% end %> <% end %>
<%= media_file.media.file.filename %>
  • <%= format_datetime media_file.created_at %>
<%#--- Grid Tab %>
<% @media_files.each_slice(4) do |media_chunk| %>
<% media_chunk.each do |media_file| %>
<% if media_file.image? or media_file.pdf? %> <%= link_to image_tag(media_file.media_url(:thumb), width: '100%'), media_file.media_url, class: 'thumbnail lightbox' %> <% else %> <%= link_to media_file.media_url do %>
<%= media_file.media.file.extension %>
<% end %> <% end %>
<%= media_file.media.file.filename %>
<%= link_to icons(:edit), edit_admin_media_file_path(media_file), class: "btn btn-link btn-icon" %>
<% end %>
<% end %>
<%= will_paginate(@media_files, inner_window: 10, next_label: 'Next', previous_label: 'Prev', renderer: WillPaginate::AdminThemeRenderer) %>
<% end %>