Commit 52028dcd2d5a4048a6751312c6f1eba49013ce22
Exists in
master
and in
4 other branches
Merge pull request #3013 from crystax/master
Sort groups alphabetically on dashboard page
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/controllers/dashboard_controller.rb
... | ... | @@ -5,7 +5,7 @@ class DashboardController < ApplicationController |
5 | 5 | before_filter :event_filter, only: :show |
6 | 6 | |
7 | 7 | def show |
8 | - @groups = current_user.authorized_groups | |
8 | + @groups = current_user.authorized_groups.sort_by(&:human_name) | |
9 | 9 | @has_authorized_projects = @projects.count > 0 |
10 | 10 | @teams = current_user.authorized_teams |
11 | 11 | @projects_count = @projects.count | ... | ... |
app/helpers/namespaces_helper.rb
... | ... | @@ -10,8 +10,8 @@ module NamespacesHelper |
10 | 10 | |
11 | 11 | |
12 | 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 | 16 | options = [] |
17 | 17 | options << global_opts if current_user.admin | ... | ... |