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

51 lines
2.9 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>
2016-07-01 11:11:53 +08:00
<td class="td_w60 ">班级作业:</td>
2015-07-09 15:27:49 +08:00
<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>
2015-07-09 15:27:49 +08:00
</tr>
</tbody></table>
</div>
</div>
<% if(course_end_flag) %>
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
2015-07-18 13:51:13 +08:00
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">发布作业</a>
<% elsif User.current.member_of_course? item %>
2015-07-18 13:51:13 +08:00
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">提交作品</a>
<% elsif User.current.logged?%>
2016-07-01 11:11:53 +08:00
<%= link_to "加入班级",try_join_path(:object_id => item.id), :class => "blue_n_btn fr mt20", :remote => "true",:id => "try_join_course_link"%>
2015-07-09 15:27:49 +08:00
<% end %>
<div class="cl"></div>
</div>