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

14 lines
574 B
Plaintext
Raw Normal View History

<%
2014-04-21 08:39:49 +08:00
id = "finish_course_#{project.id}"
2014-05-06 09:26:48 +08:00
display = (project.course_extra.teacher.id == User.current.id || User.current.admin?)
%>
2014-05-06 09:26:48 +08:00
<% if display #如果课程已结束%>
<% linkPath = course_endTime_timeout?(project) ? restartcourse_project_path(project) : finishcourse_project_path(project, format: :js) %>
<% desc = course_endTime_timeout?(project) ? '重启' : '关闭' %>
<%= link_to "#{desc}课程", linkPath, :remote => true, :method => :post, :id => id, :confirm => ("确定要#{desc}课程?") %>
<% else %>
2014-05-06 09:26:48 +08:00
<!-- 关闭课程block -->
<% end %>