Conflicts:
	app/controllers/courses_controller.rb
This commit is contained in:
alan 2014-12-25 10:31:11 +08:00
commit f8dc9dcd35
4 changed files with 26 additions and 14 deletions

View File

@ -333,7 +333,7 @@ class CoursesController < ApplicationController
case params[:role] case params[:role]
when '1' when '1'
@subPage_title = l :label_teacher_list @subPage_title = l :label_teacher_list
@members = searchTeacherAndAssistant(@course) @members = @teachers
when '2' when '2'
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
@members = student_homework_score @members = student_homework_score
@ -882,7 +882,6 @@ class CoursesController < ApplicationController
def student_homework_score def student_homework_score
teachers = find_course_teachers(@course) teachers = find_course_teachers(@course)
homework_scores = Member.find_by_sql("SELECT id, user_id,course_id, course_group_id,created_on,IFNULL(SUM(CASE WHEN t_score <> 0 AND t_score IS NOT NULL THEN t_score ELSE s_score END),0) as score homework_scores = Member.find_by_sql("SELECT id, user_id,course_id, course_group_id,created_on,IFNULL(SUM(CASE WHEN t_score <> 0 AND t_score IS NOT NULL THEN t_score ELSE s_score END),0) as score
FROM ( FROM (
SELECT members.id as id, members.user_id AS user_id, members.course_id AS course_id, members.created_on as created_on,members.course_group_id AS course_group_id, SELECT members.id as id, members.user_id AS user_id, members.course_id AS course_id, members.created_on as created_on,members.course_group_id AS course_group_id,

View File

@ -158,7 +158,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left" colspan="2">
<span class="font_lighter"> <span class="font_lighter">
<%= l(:label_create_time) %> <%= l(:label_create_time) %>
:&nbsp; :&nbsp;
@ -178,7 +178,6 @@
<% end %> <% end %>
</span> </span>
</td> </td>
<td></td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>

View File

@ -24,35 +24,46 @@
<div class="cl"></div> <div class="cl"></div>
<% if members.any? %> <% if members.any? %>
<% if @result_count %> <% if @result_count %>
<p style="font-size: 18px;"><%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %></p> <p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
</p>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div class="st_box"> <div class="st_box">
<ul class="st_box_top" style="margin-left: 17px;"> <ul class="st_box_top" style="margin-left: 17px;">
<% if @subPage_title == l(:label_student_list) %> <% if @subPage_title == l(:label_student_list) %>
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path ,method: 'get', remote: true, :onclick => "change_pic('pic')"%> <li class="ml358"><%= link_to '作业积分', member_score_sort_course_path ,method: 'get', remote: true, :onclick => "change_pic('pic')"%>
<a id="pic" href="#" class="st_down"></a></li> <a id="pic" href="#" class="st_down"></a>
<li class="ml50"><a href="#" >加入时间</a></li> </li>
<li class="ml50">
<a href="#" >加入时间</a>
</li>
<% else %> <% else %>
<li class="ml50" style="margin-left: 470px"><li class="ml50"><a href="#" >加入时间</a></li> <li class="ml50" style="margin-left: 470px">
</li>
<li class="ml50">
<a href="#" >加入时间</a>
</li>
<% end %> <% end %>
</ul> </ul>
<div id="list_detail" style="margin-left: 17px"> <div id="list_detail" style="margin-left: 17px">
<% members.each do |member| %> <% members.each do |member| %>
<div class="cl"></div><!--st_box_top end--> <div class="cl"></div><!--st_box_top end-->
<div class="st_boxlist"> <div class="st_boxlist">
<% next if member.new_record? %> <% next if member.new_record? %>
<a href="#" class="st_img" style="float:left;">
<a href="#" class="st_img" style="float:left;"> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %></a> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
</a>
<ul style="margin-left: 15px"> <ul style="margin-left: 15px">
<% if @canShowCode %> <% if @canShowCode %>
<li> <li>
<%= l(:label_bidding_user_studentname) %> : <%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %> <%= link_to member.user.show_name, user_path(member.user) %>
</li>
</li> </br> </br>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %> <%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %> <% else %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %> <%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
@ -89,7 +100,9 @@
<% end; reset_cycle %> <% end; reset_cycle %>
</div> </div>
</div> </div>
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div> <div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
<% else %> <% else %>
<p class="nodata"> <p class="nodata">
<%= l(:label_no_data) %> <%= l(:label_no_data) %>

View File

@ -29,6 +29,7 @@
</p> </p>
<p> <p>
<%= f.text_field :login, :size => 30 %> <%= f.text_field :login, :size => 30 %>
<input type="text" hidden="hidden">
</p> </p>
<p> <p>
<%= f.password_field :password, :size => 30, :name => 'ignore', <%= f.password_field :password, :size => 30, :name => 'ignore',