From 020242a8c973109f958292601b172c296eaf873e Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 5 Dec 2014 11:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=87=8F=E3=80=8A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BA=BA=E6=95=B0=E4=BB=A5=E5=8F=8A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=85=A8=E9=83=A8=E4=BA=BA=E6=95=B0=E3=80=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 1 + app/views/courses/_groups_name.html.erb | 3 ++- app/views/courses/_member_list.html.erb | 3 +++ config/locales/zh.yml | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 2e3f42784..d266f5990 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -205,6 +205,7 @@ class CoursesController < ApplicationController q = "#{params[:name].strip}" #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? @results = searchStudent_by_name(@course, q) + @result_count = @results.count @results = paginateHelper @results end diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index de8425b45..151eb9c7e 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -6,11 +6,12 @@
  • 分班:
  • + <% course_member_count = l(:label_all) + "(" + @course.members.count.to_s + "人)" %> <%= form_tag( searchgroupmembers_course_path(@course, :group_id => 0), method: 'get',:remote=>true) do %> <%= hidden_field_tag "all", params[:group_id], name: 'all' %> - <%= submit_tag l(:label_all), :style => "background: #f8df8c; border:0px; color: black" %> + <%= submit_tag course_member_count, :style => "background: #f8df8c; border:0px; color: black" %> <% end %>
  • diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index cba88b141..436a339dd 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -9,6 +9,9 @@ <% if members.any? %> + <% if @result_count %> +

    <%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %>

    + <% end %> <% members.each do |member| %>
    <% next if member.new_record? %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ef90c7d10..cecc9b465 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -569,7 +569,9 @@ zh: label_role_plural: 角色 label_role_new: 新建角色 label_role_and_permissions: 角色和权限 - label_member: 成员 + label_member: + label_search_member_count: 共搜索到 + label_member_people: 人 label_member_new: 添加成员 label_member_plural: 成员 label_tracker: 跟踪标签