bisscomm/refinerycms-videos

View on GitHub
app/views/refinery/videos/admin/videos/_video.html.erb

Summary

Maintainability
Test Coverage
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(video) -%>">
  <span class='title'>
    <%= video.title %>
    <% if video.draft? %><span class="label notice"><%= t('.draft')%></span><% end %>
    <span class='title'>
      <% if Refinery::I18n.frontend_locales.many? %>
        <span class='locales'>
          <% video.translations.sort_by{ |t| Refinery::I18n.frontend_locales.index(t.locale)}.each do |translation| %>
            <% if translation.title.present? %>
              <%= link_to refinery.edit_videos_admin_video_path(video, :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>
  </span>

  <span class='actions'>
    <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_videos_admin_video_path(video),
         :title => t('.edit') %>
    <%= link_to refinery_icon_tag("delete.png"), refinery.videos_admin_video_path(video),
        :class => "cancel confirm-delete",
        :title => t('.delete'),
        :confirm => t('message', :scope => 'refinery.admin.delete', :title => video.title),
        :method => :delete %>
  </span>
</li>