对新增功能《添加学生列表班内搜索和课内搜索》样式微调

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-09 15:16:43 +08:00
parent d8a568e685
commit 90a01c8d84
6 changed files with 46 additions and 43 deletions

View File

@ -207,9 +207,9 @@ class CoursesController < ApplicationController
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:incourse] if params[:incourse]
@results = searchStudent_by_name(@course, q) @results = searchStudent_by_name(@course, q)
else elsif params[:ingroup]
group = CourseGroup.find(params[:search_group_id]) @group = CourseGroup.find(params[:search_group_id])
@results = searchgroupstudent_by_name(group, @course, q) @results = searchgroupstudent_by_name(@group, @course, q)
end end
@result_count = @results.count @result_count = @results.count
@results = paginateHelper @results @results = paginateHelper @results

View File

@ -184,7 +184,7 @@ module CoursesHelper
end end
members members
end end
def searchgroupstudent_by_name(group, project, q) def searchgroupstudent_by_name(group, project, name)
members = [] members = []
group.members.each do |m| group.members.each do |m|
if m && m.user && m.user.allowed_to?(:as_student,project) if m && m.user && m.user.allowed_to?(:as_student,project)

View File

@ -1,40 +1,4 @@
<script type=" text/javascript" charset="utf-8">
function validate_groupname(value1) {
if(value1.length > 20) {
alert('<%= l(:label_limit_groupname) %>');
}
}
function checkclass(value) {
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
if(document.getElementsByName("check_group_name")[i].id == value) {
document.getElementById(value).className = "selected";
}
else {
document.getElementsByName("check_group_name")[i].className = "classbox";
}
}
}
function validate_groupname_null(value1) {
value1 = value1.trim();
if(value1.length == 0 ) {
alert('<%= l(:label_limit_groupname_null) %>');
}
}
function validate_update(name) {
value1 = document.getElementById(name).value;
validate_groupname(value1);
}
function validate_add_group() {
value1 = document.getElementById('group_name').value;
validate_groupname(value1);
validate_groupname_null(value1);
}
</script>
<ul> <ul>

View File

@ -9,10 +9,10 @@
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %> <%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%>
<% if @group %> <% if @group %>
<%= hidden_field "#{@group.id}", params[:search_group_id], name: 'search_group_id' %> <%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search), :name => "ingroup",:class => "f_2"%> <%= submit_tag l(:label_search_member_in_group), :name => "ingroup",:class => "f_2"%>
<% end %> <% end %>
<%= submit_tag l(:label_search), :name => 'incourse',:class => "f_2"%> <%= submit_tag l(:label_search_member_in_course), :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %> <%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,40 @@
<script type=" text/javascript" charset="utf-8">
function validate_groupname(value1) {
if(value1.length > 20) {
alert('<%= l(:label_limit_groupname) %>');
}
}
function checkclass(value) {
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
if(document.getElementsByName("check_group_name")[i].id == value) {
document.getElementById(value).className = "selected";
}
else {
document.getElementsByName("check_group_name")[i].className = "classbox";
}
}
}
function validate_groupname_null(value1) {
value1 = value1.trim();
if(value1.length == 0 ) {
alert('<%= l(:label_limit_groupname_null) %>');
}
}
function validate_update(name) {
value1 = document.getElementById(name).value;
validate_groupname(value1);
}
function validate_add_group() {
value1 = document.getElementById('group_name').value;
validate_groupname(value1);
validate_groupname_null(value1);
}
</script>
<%= 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> <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">

View File

@ -570,6 +570,8 @@ zh:
label_role_new: 新建角色 label_role_new: 新建角色
label_role_and_permissions: 角色和权限 label_role_and_permissions: 角色和权限
label_member: 成员 label_member: 成员
label_search_member_in_group: 班内搜索
label_search_member_in_course: 课内搜索
label_search_member_count: 共搜索到 label_search_member_count: 共搜索到
label_member_people: label_member_people:
label_delete_group: 确定删除分班? label_delete_group: 确定删除分班?