parent
63c9804da8
commit
615bc7d444
|
@ -196,12 +196,35 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def searchmembers
|
||||||
|
@render_file = 'member_list'
|
||||||
|
|
||||||
|
@is_remote = true
|
||||||
|
q = "#{params[:name].strip}"
|
||||||
|
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
|
@results = searchStudent_by_name(@course, q)
|
||||||
|
@results = paginateHelper @results
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def addgroups
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def updategroupname
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def searchgroupmembers
|
||||||
|
|
||||||
|
end
|
||||||
def member
|
def member
|
||||||
## 有角色参数的才是课程,没有的就是项目
|
## 有角色参数的才是课程,没有的就是项目
|
||||||
@render_file = 'member_list'
|
@render_file = 'member_list'
|
||||||
@teachers= searchTeacherAndAssistant(@course)
|
@teachers= searchTeacherAndAssistant(@course)
|
||||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||||
@role = params[:role]
|
@role = params[:role]
|
||||||
|
@course_groups = @course.course_groups if @course.course_groups
|
||||||
@course_group_id = params[:@course_group_id] unless params[:@course_group_id].nil?
|
@course_group_id = params[:@course_group_id] unless params[:@course_group_id].nil?
|
||||||
case params[:role]
|
case params[:role]
|
||||||
when '1'
|
when '1'
|
||||||
|
|
|
@ -186,6 +186,19 @@ module CoursesHelper
|
||||||
end
|
end
|
||||||
members
|
members
|
||||||
end
|
end
|
||||||
|
def searchStudent_by_name project, name
|
||||||
|
#searchPeopleByRoles(project, StudentRoles)
|
||||||
|
members = []
|
||||||
|
project.members.each do |m|
|
||||||
|
if m && m.user && m.user.allowed_to?(:as_student,project)
|
||||||
|
username = m.user[:lastname].to_s + m.user[:firstname].to_s
|
||||||
|
if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
|
||||||
|
members << m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
members
|
||||||
|
end
|
||||||
# =====================================================================================
|
# =====================================================================================
|
||||||
|
|
||||||
#def searchCountByRoles project, roles_id
|
#def searchCountByRoles project, roles_id
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
<script type="application/javascript">
|
||||||
|
function asign_id(id) {
|
||||||
|
document.getElementById(id).value = id;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<%# if course_groups.any? %>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li style=" color:#8b8b8b;">分班:</li>
|
||||||
|
<% form_tag(searchgroupmembers_course_path(@course), :method => 'get', :remote => true) do %>
|
||||||
|
<li class="classbox">
|
||||||
|
<%= hidden_field 'all', params[:group_id], name: 'all' %>
|
||||||
|
<%= submit_tag l:(label_all), :onclick => "asign_id('all')" %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<li id="show_groups" class="classbox">
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<% course_groups.each do |group| %>
|
||||||
|
<li class="classbox" id="group_name_<%= group.id %>">
|
||||||
|
<% form_tag(searchgroupmembers_course_path(@course), :method => 'get', :remote => true) do %>
|
||||||
|
<%= hidden_field group, :id, :value => params[:group_id] %>
|
||||||
|
<%= submit_tag l:(label_all), :onclick => "asign_id(#{group.id})" %>
|
||||||
|
<% end %>
|
||||||
|
<a href="javascript:void(0)" class="f_l" onclick="$('#add_tag_<%= group.id %>').slideToggle();"><img src="images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<% form_tag(updategroupname_course_path(@course), :method => 'get', :remote => true, :update => 'group_name') do %>
|
||||||
|
<span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
|
||||||
|
<%= text_field group, :value => params[:group_name], :size=>"20", :class=>"isTxt w90 f_l", :style=>"padding: 0px", :max => 100 %>
|
||||||
|
<!--<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>-->
|
||||||
|
<%= submit_tag group.name, :class => "submit f_1", :style => "width: 43px;", :update => "group_name_#{group.id}" %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<li style="margin-left:15px;">
|
||||||
|
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#add_tag04').slideToggle();">+添加分班</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
||||||
|
<input type="text" id="" name="" size="20" class="isTxt w90 f_l" style="padding: 0px" maxlength="100" />
|
||||||
|
<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>
|
||||||
|
<input type="button" class="submit_2" onclick="$('#add_tag04').slideToggle();" style="width: 43px"/>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<%# end %>
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
<% if members.any? %>
|
<% if members.any? %>
|
||||||
<% members.each do |member| %>
|
<% members.each do |member| %>
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|
|
@ -1,13 +1,25 @@
|
||||||
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
||||||
|
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
|
||||||
<div class="st_list">
|
<div class="st_list">
|
||||||
<div class="st_search">
|
<div class="st_search">
|
||||||
<span class="f_l"><%= @subPage_title %></span>
|
<span class="f_l"><%= @subPage_title %></span>
|
||||||
<% if @subPage_title == l(:label_student_list) %>
|
<% if @subPage_title == l(:label_student_list) %>
|
||||||
<form class="f_l"><%= text_field_tag 'name', params[:name], name: "name", class: 'f_1'%></form>
|
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true) do %>
|
||||||
<%= submit_tag l(:label_search), :class => 'f_2' %>
|
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1'%>
|
||||||
|
<%= submit_tag l(:label_search), :class => "f_2"%>
|
||||||
|
<%#= link_to l(:label_search),'' , :class => 'f_2' %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="member_content">
|
<div class="cl"></div>
|
||||||
|
<%# if @canShowCode %>
|
||||||
|
<div class="st_addclass">
|
||||||
|
<%= render :partial => 'groups_name', locals: {:course_groups => @course_groups} %>
|
||||||
|
</div>
|
||||||
|
<%# end %>
|
||||||
|
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="member_content" id = "member_content">
|
||||||
<%= error_messages_for 'member' %>
|
<%= error_messages_for 'member' %>
|
||||||
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 2014/12/2.
|
||||||
|
*/
|
||||||
|
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
|
@ -643,10 +643,12 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
||||||
post 'finishcourse'
|
post 'finishcourse'
|
||||||
post 'restartcourse'
|
post 'restartcourse'
|
||||||
|
match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get]
|
||||||
|
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
match 'join_private_courses', :via => [:get, :post]
|
match 'join_private_courses', :via => [:get, :post]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
match '/member', :to => 'courses#member', :as => 'member', :via => :get
|
match '/member', :to => 'courses#member', :as => 'member', :via => :get
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 769 B |
|
@ -20,15 +20,29 @@ a:hover{ }
|
||||||
.c_red{ color:#ec0016;}
|
.c_red{ color:#ec0016;}
|
||||||
.w90{width:90px;}
|
.w90{width:90px;}
|
||||||
.ml10{margin-left:10px;}
|
.ml10{margin-left:10px;}
|
||||||
|
.st_search input.f_2 {
|
||||||
|
width:60px !important;
|
||||||
|
height:28px !important;
|
||||||
|
color:#fff !important;
|
||||||
|
margin-right:5px !important;
|
||||||
|
border:none !important;
|
||||||
|
margin-left:0px !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
padding: 0px !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
text-shadow: none !important;
|
||||||
|
border:1px solid #1c9ec7;
|
||||||
|
background:#1c9ec7;
|
||||||
|
|
||||||
|
}
|
||||||
.container{ width:940px; margin:0 auto; font-size:12px;}
|
.container{ width:940px; margin:0 auto; font-size:12px;}
|
||||||
|
|
||||||
.st_list{ width:688px; padding-left:5px; height:800px;}
|
.st_list{ width:688px; padding-left:5px; height:800px;}
|
||||||
.st_search{ margin:10px 0;}
|
.st_search{ margin:10px 0;}
|
||||||
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
|
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
|
||||||
.st_search input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px;}
|
.st_search input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px;}
|
||||||
.st_search input.f_2{ background:#1c9ec7; padding: 3px; margin-left: 3px; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:28px; float:left; font-size:12px; }
|
|
||||||
.st_search a:hover{ background:#048fbb; text-decoration:none;}
|
.st_search a:hover{ background:#048fbb; text-decoration:none;}
|
||||||
|
/*.st_search input.f_2{ background:#1c9ec7; padding: 3px; margin-left: 3px; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:28px; font-size:12px; }*/
|
||||||
|
|
||||||
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
|
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
|
||||||
.st_addclass{ margin-top:5px;}
|
.st_addclass{ margin-top:5px;}
|
||||||
|
@ -41,8 +55,8 @@ a:hover{ }
|
||||||
.st_box ul li{ float:left;}
|
.st_box ul li{ float:left;}
|
||||||
.st_box_top a{ font-weight:bold; color:#7a7a7a; float:left;}
|
.st_box_top a{ font-weight:bold; color:#7a7a7a; float:left;}
|
||||||
.st_box_top a:hover{ color:#1c9ec7;}
|
.st_box_top a:hover{ color:#1c9ec7;}
|
||||||
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
|
.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
|
||||||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||||
a.st_img { display:block;width:40px; height:40px; border:1px solid #CCC; padding:1px;}
|
a.st_img { display:block;width:40px; height:40px; border:1px solid #CCC; padding:1px;}
|
||||||
a:hover.st_img { border:1px solid #1c9ec7; }
|
a:hover.st_img { border:1px solid #1c9ec7; }
|
||||||
.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px; }
|
.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px; }
|
||||||
|
@ -63,5 +77,6 @@ a:hover.st_add{ color:#ff8e15;}
|
||||||
.wlist a:hover{border:1px solid #15bccf; background-color:#15bccf; color:#fff;}
|
.wlist a:hover{border:1px solid #15bccf; background-color:#15bccf; color:#fff;}
|
||||||
.wlist_select a { background-color:#64bdd9; color:#fff;}
|
.wlist_select a { background-color:#64bdd9; color:#fff;}
|
||||||
|
|
||||||
.submit{height:21px;border:0; cursor:pointer; background:url(images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
||||||
.isTxt{background:#fbfbfb url(images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
|
.submit_2{height:21px;border:0; cursor:pointer; background:url(../images/btn1.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
||||||
|
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
|
Loading…
Reference in New Issue