diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-15 17:20:56 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-08-15 17:20:56 -0500 |
commit | 1ba2ef4fdafa26d2301f85bee2e38061c0dddd93 (patch) | |
tree | 7e401879596a39f365dd21670af8b3a370e75df0 /app/helpers | |
parent | 882f97e4e3f23fc28752da3644a62575d2cb84e1 (diff) | |
parent | 931eadaa5e8e0063c7d8f90b5863789ffcd33b30 (diff) | |
download | gitlab-ce-1ba2ef4fdafa26d2301f85bee2e38061c0dddd93.tar.gz |
Merge branch 'master' into mc-ui
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/sorting_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/todos_helper.rb | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb index e1c0b497550..8b138a8e69f 100644 --- a/app/helpers/sorting_helper.rb +++ b/app/helpers/sorting_helper.rb @@ -20,13 +20,19 @@ module SortingHelper end def projects_sort_options_hash - { + options = { sort_value_name => sort_title_name, sort_value_recently_updated => sort_title_recently_updated, sort_value_oldest_updated => sort_title_oldest_updated, sort_value_recently_created => sort_title_recently_created, sort_value_oldest_created => sort_title_oldest_created, } + + if current_controller?('admin/projects') + options.merge!(sort_value_largest_repo => sort_title_largest_repo) + end + + options end def sort_title_priority diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index e3a208f826a..0465327060e 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -1,10 +1,10 @@ module TodosHelper def todos_pending_count - @todos_pending_count ||= TodosFinder.new(current_user, state: :pending).execute.count + @todos_pending_count ||= current_user.todos_pending_count end def todos_done_count - @todos_done_count ||= TodosFinder.new(current_user, state: :done).execute.count + @todos_done_count ||= current_user.todos_done_count end def todo_action_name(todo) |