hps_learning/app/views/admin/online_courses/show.html.erb

63 lines
2.1 KiB
Plaintext
Raw Normal View History

2017-07-04 16:58:50 +00:00
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @hpsclass.hps_lectures.each do |lecture| %>
<tr>
2017-07-05 03:57:30 +00:00
<% if !lecture.lecture_pic.nil? && !lecture.lecture_pic.url.nil? %>
2017-07-04 16:58:50 +00:00
<td><img width="150px" src="<%= lecture.lecture_pic.thumb.url %>" /></td>
<% else %>
2017-07-05 03:53:39 +00:00
<td><img src="http://www.placehold.it/150x150/EFEFEF/AAAAAA" width="150px"></td>
2017-07-04 16:58:50 +00:00
<% end %>
<td>
<%= lecture.subject %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@hpsclass) %>
<li><a href="<%= edit_lecture_admin_online_course_path(lecture.id, :page => params[:page]) %>"><%= t(:edit) %></a></li>
<li><a href="<%= delete_lecture_admin_online_course_path(lecture.id,:page => params[:page]) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
2017-07-04 16:58:50 +00:00
<% end %>
</ul>
</div>
</td>
<td>
<%= lecture.presenter %>
</td>
<td>
<%= lecture.get_runtime %>
</td>
<td>
<% if !lecture.hps_lecture_file.nil? && !lecture.hps_lecture_file.index_path.nil? %>
<a href="http://<%= request.host_with_port %>/<%= lecture.hps_lecture_file.index_path %>" class="open-presentation">Link</a>
<% else %>
Not Available
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, class: "pull-right" do
link_to(t("hps_learning.add_lecture"), add_lecture_admin_online_course_path(@hpsclass.id), :class => "btn btn-primary") + " " +
link_to(t("back"), admin_online_courses_path, :class => "btn")
2017-07-04 16:58:50 +00:00
end
end
%>
<script type="text/javascript">
var presenter = null;
$(".open-presentation").on("click",function(){
var el = $(this);
presenter = window.open(el.attr("href"), "presenter", "width=1024,height=768");
return false;
})
</script>