diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-19 12:51:08 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-19 12:51:08 +0400 |
commit | 52028dcd2d5a4048a6751312c6f1eba49013ce22 (patch) | |
tree | 15196436984887fd87cb83d22ddad08bdcd545b0 /app | |
parent | bfc359ca61bd7e7ffea714b4ad64a7d9927441c3 (diff) | |
parent | f7ae1bce258695b07c674d8857112f927f412b90 (diff) |
Merge pull request #3013 from crystax/master
Sort groups alphabetically on dashboard page
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/namespaces_helper.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index f320e819e26..9fd477dcdb6 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -5,7 +5,7 @@ class DashboardController < ApplicationController before_filter :event_filter, only: :show def show - @groups = current_user.authorized_groups + @groups = current_user.authorized_groups.sort_by(&:human_name) @has_authorized_projects = @projects.count > 0 @teams = current_user.authorized_teams @projects_count = @projects.count diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index 6d0c6c98191..a9a6c78654f 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -10,8 +10,8 @@ module NamespacesHelper global_opts = ["Global", [['/', Namespace.global_id]] ] - group_opts = ["Groups", groups.map {|g| [g.human_name, g.id]} ] - users_opts = [ "Users", users.map {|u| [u.human_name, u.id]} ] + group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ] + users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ] options = [] options << global_opts if current_user.admin |