video_pro/app/views/admin/video_pros/_index_table.html.erb

71 lines
2.3 KiB
Plaintext

<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @video_images.each do |image| %>
<tr>
<td>
<%= image.status_for_table %>
</td>
<td>
<%= image.category_title %>
</td>
<td>
<% if image.exchange_item == "1" %>
<iframe height="140" src="<%= image.embed_url %>"></iframe>
<% elsif image.exchange_item == "2" %>
<%
video_snapshot_url = ""
video_snapshot_url = image.video_snapshot.url if image.video_snapshot.file %>
<video width="320" height="240" controls poster="<%=video_snapshot_url%>">
<source src="<%= image.video_file.url %>" type="video/mp4">
Your browser does not support the video tag.
</video>
<% elsif image.exchange_item == "3" %>
<%= image_tag image.file.thumb, :class => "video_data-image" %>
<% end %>
</td>
<td>
<%= image.title.to_s.html_safe rescue "" %>
<% if can_edit_or_delete?(@video_data) %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="<%= edit_admin_video_pro_path(image.id, :page => params[:page]) %>"><%= t(:edit) %></a></li>
<li><a href="<%= admin_video_pro_path(image.id, :page => params[:page]) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?" ><%= t(:delete_) %></a></li>
</ul>
</div>
<% end %>
</td>
<td>
<%= image.postdate.strftime("%Y-%m-%d") rescue "" %>
</td>
<td>
<%= image.deadline.strftime("%Y-%m-%d") rescue "" %>
</td>
<td>
<%= image.desc %>
</td>
<td>
<%= image.keyword %>
</td>
<td>
<%= image.post_agency(@video_pro_setting) %>
<div><%= image.updated_at.strftime("%Y-%m-%d %H:%M") rescue "" %></div>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="bottomnav clearfix" style="left: 81px;">
<div class="action pull-right">
<a class="btn btn-primary" href="<%= new_admin_video_pro_path(:page => params[:page]) %>">
<%= t("video_pro.add") %>
</a>
</div>
<%= content_tag :div, paginate(@video_images), class: "pagination pagination-centered" %>
</div>