修改老师配置界面成员搜索

This commit is contained in:
sw 2015-04-17 11:48:47 +08:00
parent 9f862ad7a7
commit cdbe95f6ec
5 changed files with 11 additions and 23 deletions

View File

@ -20,7 +20,7 @@ class CoursesController < ApplicationController
before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course,:search_member]
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
@ -419,8 +419,8 @@ class CoursesController < ApplicationController
end
def search_member
if User.current.allowed_to?(:as_teacher,@course)
q = "#{params[:q].strip}"
if User.current.allowed_to?(:as_teacher,@course) || User.current.admin
q = "#{params[:name].strip}"
@roles = Role.givable.all[3..5]
if q.nil? || q == ""
@members = @course.member_principals.includes(:roles, :principal).all.sort

View File

@ -1,14 +1,15 @@
<div class="search_course fl">
<%= form_tag({:controller => 'courses', :action => 'search_member'},:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %>
<!-- , :onkeyup => "regexQ('#{l(:label_search_conditions_not_null)}');" -->
<%= text_field_tag 'q', params[:q], :placeholder => l(:label_user_name), :class => "search_text fl" %>
<a href="javascript:void(0)" onclick="submitMemberSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
<%= text_field_tag 'name', params[:name], :placeholder => "昵称、学号、姓名搜索", :class => "search_text fl" %>
<a href="javascript:void(0)" onclick="submitMemberSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white ml10" >
<%= l(:label_search)%>
</a>
<br />
<span id="course_member_name_span" style="float: left"></span>
<% end %>
</div>
<div class="cl"></div>
<div class="members_left">
<ul style=" border-bottom:none;">
<li>

View File

@ -1 +1 @@
$("#course_member_list").html("<%= escape_javascript(render :partial => "courses/member") %>");
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');

View File

@ -469,6 +469,8 @@ blockquote {
font-family: "Microsoft YaHei";
background: url('../images/requirements/reference.jpg');
}
a.member_search_edit {width: 43px;background: #15bccf;color: #fff;text-align: center;text-decoration: none;padding: 2px;}
.min_search_edit {width: 150px;height: 20px;border: 1px solid #d0d0d0 !important;color: #666;}
a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; }
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}

View File

@ -167,23 +167,8 @@ a:hover.tijiao{ background:#0f99a9 !important;}
.c_grey{ color:#A7A7A7;}
/*新增*/
.min_search {
width: 150px;
height: 15px;
border: 1px solid #d0d0d0 !important;
color: #666;
/*background: url(../images/course/public_icon.png) 135px -193px no-repeat;*/
/*cursor: pointer;*/
}
a.member_search {
width: 43px;
height: 22px;
background: #15bccf;
color: #fff;
text-align: center;
padding: 4px 6px;
text-decoration: none;
}
.min_search {width: 150px;height: 15px;border: 1px solid #d0d0d0 !important;color: #666;}
a.member_search {width: 43px;height: 22px;background: #15bccf;color: #fff;text-align: center;padding: 4px 6px;text-decoration: none;}
/*上传图片处理*/
.upload_img img{max-width: 100%;}