Merge branch 'cxt_course' into develop

cxt_course
cxt 9 years ago
commit 2d321859fc

@ -172,6 +172,7 @@ class SyllabusesController < ApplicationController
def members def members
@members = @syllabus.syllabus_members.includes(:user => {:user_extensions => [], :courses => []}).order("rank asc") @members = @syllabus.syllabus_members.includes(:user => {:user_extensions => [], :courses => []}).order("rank asc")
@show = params[:show] ? params[:show].to_i : 0
respond_to do |format| respond_to do |format|
format.js format.js
format.html{render :layout => 'base_syllabus'} format.html{render :layout => 'base_syllabus'}

@ -1,6 +1,6 @@
<h3 class="sy_right_title">教师团队 <h3 class="sy_right_title">教师团队
<% if User.current == @syllabus.user || User.current.admin? %> <% if User.current == @syllabus.user || User.current.admin? %>
<a href="<%=members_syllabus_path(syllabus) %>" class="sy_cmore fr mr10" >增加教师</a> <a href="<%=members_syllabus_path(syllabus, :show => 1) %>" class="sy_cmore fr mr10">增加教师</a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</h3> </h3>

@ -5,7 +5,7 @@
</div> </div>
<div id="about_hwork_<%= student_work.id %>"></div> <div id="about_hwork_<%= student_work.id %>"></div>
<div id="group_member_work_<%= student_work.id%>" class="undis"> <div id="group_member_work_<%= student_work.id%>">
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %> <%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
</div> </div>
<% end %> <% end %>

@ -1,5 +1,5 @@
<div class="sy_courses_open f14 fontGrey3"> <div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_close fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span> <span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;"> <span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span> <span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span>
<span class="fontGrey2 ml5 fl"> <span class="fontGrey2 ml5 fl">

@ -44,7 +44,7 @@
<div class=""> <div class="">
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail"> <div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
<div id="homework_description"> <div id="homework_description">
<%= homework.description %> <%= homework.description.html_safe %>
</div> </div>
</div> </div>
<% if is_pro %> <% if is_pro %>
@ -52,14 +52,14 @@
<table class="mt5 test-set-table"> <table class="mt5 test-set-table">
<tr> <tr>
<th width="25">&nbsp;</th> <th width="25">&nbsp;</th>
<th width="290">测试集输入</th> <th width="290" style="max-width:290px;">测试集输入</th>
<th width="290">测试集输出</th> <th width="290" style="max-width:290px;">测试集输出</th>
</tr> </tr>
<% homework.homework_tests.each_with_index do |test, i| %> <% homework.homework_tests.each_with_index do |test, i| %>
<tr> <tr>
<td class="test_td_min"><%=i+1 %></td> <td class="test_td_min"><%=i+1 %></td>
<td><%=test.input %></td> <td><pre style="max-width:290px; word-wrap:break-word; white-space:pre-wrap;"><%=test.input %></pre></td>
<td ><%=test.output %></td> <td><pre style="max-width:290px; word-wrap:break-word; white-space:pre-wrap;"><%=test.output %></pre></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

@ -4,7 +4,7 @@
<tr> <tr>
<th>序号</th> <th>序号</th>
<th class="sy_new_namebox">姓名</th> <th class="sy_new_namebox">姓名</th>
<th>身份</th> <th>职业</th>
<th>创建班级数</th> <th>创建班级数</th>
<th>参与班级数</th> <th>参与班级数</th>
<% if is_admin %> <% if is_admin %>
@ -15,6 +15,7 @@
<tbody> <tbody>
<% @members.each_with_index do |member, i| %> <% @members.each_with_index do |member, i| %>
<% user = member.user %> <% user = member.user %>
<% allow_delete = @syllabus.courses.where(:tea_id => member.user_id).empty? && i != 0 %>
<tr> <tr>
<td><%= member.rank %></td> <td><%= member.rank %></td>
<td> <td>
@ -36,16 +37,20 @@
<td> <td>
<% if i == 0 %> <% if i == 0 %>
&nbsp; &nbsp;
<% elsif i == 1 %>
<%= link_to('删除', {:controller => 'syllabus_member', :action => 'destroy', :id => member.id, :syllabus => @syllabus.id},:remote => true, :method => 'delete', :class => "fr sy_btn_grey mr5", :title => l(:button_delete)) %>
<%= link_to('下移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'down'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '下移') %>
<% elsif i == @members.count - 1 %>
<%= link_to('删除', {:controller => 'syllabus_member', :action => 'destroy', :id => member.id, :syllabus => @syllabus.id},:remote => true, :method => 'delete', :class => "fr sy_btn_grey mr5", :title => l(:button_delete)) %>
<%= link_to('上移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'up'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '上移') %>
<% else %> <% else %>
<%= link_to('删除', {:controller => 'syllabus_member', :action => 'destroy', :id => member.id, :syllabus => @syllabus.id},:remote => true, :method => 'delete', :class => "fr sy_btn_grey mr5", :title => l(:button_delete)) %> <% if allow_delete %>
<%= link_to('下移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'down'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '下移') %> <%= link_to('删除', {:controller => 'syllabus_member', :action => 'destroy', :id => member.id, :syllabus => @syllabus.id},:remote => true, :method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr sy_btn_grey mr5", :title => l(:button_delete)) %>
<%= link_to('上移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'up'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '上移') %> <% else %>
<a href="javascript:void(0)" class="fr sy_btn_grey mr5" title="该老师已在本课程下创建了班级,不能删除">删除</a>
<% end %>
<% if i == 1 %>
<%= link_to('下移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'down'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '下移') %>
<% elsif i == @members.count - 1 %>
<%= link_to('上移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'up'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '上移') %>
<% else %>
<%= link_to('下移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'down'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '下移') %>
<%= link_to('上移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'up'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '上移') %>
<% end %>
<% end %> <% end %>
</td> </td>
<% end %> <% end %>

@ -15,7 +15,7 @@
<%= render :partial => 'syllabus_member_list' %> <%= render :partial => 'syllabus_member_list' %>
<a href="javascript:void(0);" class="fl sy_btn_green" onclick="toggle_search();">添加成员</a> <a href="javascript:void(0);" class="fl sy_btn_green" onclick="toggle_search();">添加成员</a>
</div> </div>
<div class="sy_new_tchbox clear undis" id="sy_search_box"> <div class="sy_new_tchbox clear <%= @show == 1 ? '' : 'undis' %>" id="sy_search_box">
<%= form_tag url_for(:controller => 'syllabus_member', :action => 'create', :syllabus => @syllabus),:id => 'syllabus_member_add_form', :remote => true do |f|%> <%= form_tag url_for(:controller => 'syllabus_member', :action => 'create', :syllabus => @syllabus),:id => 'syllabus_member_add_form', :remote => true do |f|%>
<input hidden="hidden" value="true" name="flag"> <input hidden="hidden" value="true" name="flag">
<div class="hw_search_box mb10"> <div class="hw_search_box mb10">

Loading…
Cancel
Save