socialforge/app/views/courses/_set_course_time.html.erb

14 lines
599 B
Plaintext
Raw Normal View History

<%
2014-06-04 16:58:26 +08:00
id = "finish_course_#{course.id}"
display = (User.current.allowed_to?(:as_teacher,course) || User.current.admin?)
%>
2014-05-06 09:26:48 +08:00
<% if display #如果课程已结束%>
2014-06-04 16:58:26 +08:00
<% linkPath = course_endTime_timeout?(course) ? restartcourse_course_path(course) : finishcourse_course_path(course, format: :js) %>
<% desc = course_endTime_timeout?(course) ? l(:label_course_reload) : l(:label_course_closed) %>
2014-05-06 09:26:48 +08:00
<%= link_to "#{desc}", linkPath, :remote => true, :method => :post, :id => id, :confirm => l(:label_course_closed_tips, :desc => desc) %>
<% else %>
2014-05-06 09:26:48 +08:00
<!-- 关闭课程block -->
<% end %>