Merge pull request #3013 from crystax/master

Sort groups alphabetically on dashboard page
This commit is contained in:
Dmitriy Zaporozhets 2013-02-19 00:51:08 -08:00
commit 52028dcd2d
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ class DashboardController < ApplicationController
before_filter :event_filter, only: :show before_filter :event_filter, only: :show
def show def show
@groups = current_user.authorized_groups @groups = current_user.authorized_groups.sort_by(&:human_name)
@has_authorized_projects = @projects.count > 0 @has_authorized_projects = @projects.count > 0
@teams = current_user.authorized_teams @teams = current_user.authorized_teams
@projects_count = @projects.count @projects_count = @projects.count

View file

@ -10,8 +10,8 @@ module NamespacesHelper
global_opts = ["Global", [['/', Namespace.global_id]] ] global_opts = ["Global", [['/', Namespace.global_id]] ]
group_opts = ["Groups", groups.map {|g| [g.human_name, g.id]} ] group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ]
users_opts = [ "Users", users.map {|u| [u.human_name, u.id]} ] users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ]
options = [] options = []
options << global_opts if current_user.admin options << global_opts if current_user.admin