Commit 52028dcd2d5a4048a6751312c6f1eba49013ce22

Authored by Dmitriy Zaporozhets
2 parents bfc359ca f7ae1bce

Merge pull request #3013 from crystax/master

Sort groups alphabetically on dashboard page
app/controllers/dashboard_controller.rb
@@ -5,7 +5,7 @@ class DashboardController < ApplicationController @@ -5,7 +5,7 @@ class DashboardController < ApplicationController
5 before_filter :event_filter, only: :show 5 before_filter :event_filter, only: :show
6 6
7 def show 7 def show
8 - @groups = current_user.authorized_groups 8 + @groups = current_user.authorized_groups.sort_by(&:human_name)
9 @has_authorized_projects = @projects.count > 0 9 @has_authorized_projects = @projects.count > 0
10 @teams = current_user.authorized_teams 10 @teams = current_user.authorized_teams
11 @projects_count = @projects.count 11 @projects_count = @projects.count
app/helpers/namespaces_helper.rb
@@ -10,8 +10,8 @@ module NamespacesHelper @@ -10,8 +10,8 @@ module NamespacesHelper
10 10
11 11
12 global_opts = ["Global", [['/', Namespace.global_id]] ] 12 global_opts = ["Global", [['/', Namespace.global_id]] ]
13 - group_opts = ["Groups", groups.map {|g| [g.human_name, g.id]} ]  
14 - users_opts = [ "Users", users.map {|u| [u.human_name, u.id]} ] 13 + group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ]
  14 + users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ]
15 15
16 options = [] 16 options = []
17 options << global_opts if current_user.admin 17 options << global_opts if current_user.admin