video-program/app/views/admin/video_programs/_index.html.erb

71 lines
2.8 KiB
Plaintext

<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @video_programs.each do |video_program| %>
<tr>
<td>
<%= video_program.status_for_table %>
</td>
<td>
<%= video_program.category.title rescue "" %>
<% if (video_program.category.disable rescue false) %>
<span class='label'><%= t(:disabled) %></span>
<% end %>
</td>
<td>
<% if video_program.expired? || (video_program.category.disable rescue false)%>
<%= video_program.title.to_s.html_safe %>
<% else %>
<a href="<%= OrbitHelper.cal_url_to_show(@module_app, video_program) %>" target="_blank"><%= video_program.title.to_s.html_safe %></a>
<% end %>
<% if video_program.expired? %>
<span class='label'><%= t(:expired) %></span>
<% end %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="#" class="detail-row" onclick="$('#<%= "#{video_program.id.to_s}-detail" %>').slideToggle(300); return false;"><%= t(:detail) %></a></li>
<% if can_edit_or_delete?(video_program) %>
<li><a href="<%= edit_admin_video_program_path(video_program.id) %>"><%= t(:edit) %></a></li>
<li><a href="#" class="delete text-error" rel="<%= admin_video_program_path(video_program.id) %>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= format_value video_program.postdate %></td>
<td class="<%= video_program.expired? ? "expired" : "" %>"><%= format_value video_program.deadline %></td>
<td><%= video_program.update_user.user_name rescue ""%></td>
</tr>
<tr class="footable-row-detail">
<td class="footable-cell-detail" colspan="6">
<div id="<%= "#{video_program.id.to_s}-detail" %>" class="footable-row-detail-inner" style="display: none;">
<div>
<strong><%= t(:view_count) %></strong> :
<span class="label label-info"><%= video_program.view_count %></span>
</div>
<div>
<strong><%= t(:tags) %></strong> :
<% video_program.tags.each do |tag| %>
<span class="label label-warning"><%= tag.name %></span>
<% end %>
</div>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag(:div, paginate(@video_programs), class: "pagination pagination-centered") +
content_tag(:div, link_to(t(:new_),new_admin_video_program_path, :class=>"btn btn-primary"), class: "pull-right")
end
%>