From 184e0ee6898bd1a034f93cf711acc926eb6d8e93 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Jan 2016 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E3=80=81=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E3=80=81=E8=AF=BE=E7=A8=8B=E3=80=81=E7=94=A8=E6=88=B7=E3=80=81?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=AA=E6=95=B0=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 1 + lib/redmine/menu_manager.rb | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 68386de44..c7b4dc615 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -29,6 +29,7 @@ class AdminController < ApplicationController def index @no_configuration_data = Redmine::DefaultData::Loader::no_data? + @lastest_login_user_count = User.all.count end def projects diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index a2d2214b6..f9ce21987 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -1,3 +1,4 @@ +#coding=utf-8 # Redmine - project management software # Copyright (C) 2006-2013 Jean-Philippe Lang # @@ -180,8 +181,20 @@ module Redmine end def render_single_menu_node(item, caption, url, selected) - - link_to(h(caption), url, item.html_options(:selected => selected)) + title = h(caption) + case title + when '作业' + title = h(caption) + "(#{HomeworkCommon.all.count})" + when '组织列表' + title = h(caption) + "(#{Organization.all.count})" + when '项目列表' + title = h(caption) + "(#{Project.all.count})" + when '课程列表' + title = h(caption) + "(#{Course.all.count})" + when '用户列表' + title = h(caption) + "(#{User.all.count})" + end + link_to(title, url, item.html_options(:selected => selected)) end