socialforge/app/views/users/_course_form.html.erb

46 lines
2.6 KiB
Plaintext
Raw Normal View History

2015-07-09 15:27:49 +08:00
<% can_edit_flag = User.current.allowed_to?(:as_teacher,item) || User.current.admin? %>
<% course_end_flag = course_endTime_timeout?(item) %>
<div class="courses_list line" id="nh_course_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>">
<%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %>
</a>
</div>
<div class="courses_list_info fl ml10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>" class="courses_list_title f14 fb <%=course_end_flag ? 'c_dark' : 'c_blue02'%> fl"><%= item.name %></a>
<% if(can_edit_flag) %>
<% if(course_end_flag) %>
<a href="<%=restartcourse_course_path(item)%>" class="pic_eye_grey fl ml5" title="重开课程" data-confirm="确定要重开课程?" data-method="post" data-remote="true"></a>
<% else %>
<a href="<%=finishcourse_course_path(item, format: :js)%>" class="pic_eye_blue fl ml5" title="关闭课程" data-confirm="确定要关闭课程?" data-method="post" data-remote="true"></a>
<% end %>
2014-05-20 14:52:30 +08:00
<% end %>
2015-07-09 15:27:49 +08:00
<div class="cl"></div>
<div class="courses_list_table">
<table><tbody>
<tr>
<td class="td_w60 ">主讲老师:</td>
<td class="td_w70 ">
<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a>
</td>
<td class="td_w60 ">课程作业:</td>
<td class="td_w110 "><a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a></td>
</tr>
<tr>
2015-07-17 13:40:53 +08:00
<td>学生人数:</td>
<td><a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></td>
2015-07-09 15:27:49 +08:00
<td>开课学期:</td>
<td><%= item.time %><%= get_course_term_locales item %></td>
</tr>
</tbody></table>
</div>
</div>
<% if(course_end_flag) %>
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">发布作业</a>
<% else %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">提交作品</a>
<% end %>
<div class="cl"></div>
</div>