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