diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-04-12 14:14:28 +0200 |
---|---|---|
committer | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-06 16:41:47 +0100 |
commit | aebf22f639073ab4d5c0ff4970d60bf24e8879f0 (patch) | |
tree | 72f9b9c8f7f33990aab4410d746be2f267ad3f49 /app/helpers | |
parent | c1f5205d9123d7f497d56235b4330145ef80a652 (diff) | |
download | gitlab-ce-aebf22f639073ab4d5c0ff4970d60bf24e8879f0.tar.gz |
Ensure we dont apply changes to admin/projects
The changes introduced for the project filter bar should
not apply to the admin projects screen.
Remove "Owned by me", "Owned by anyone" options
Update the dropdown option Last created -> Created date.
Introduces fixes for spacing and minor styling across breakpoints.
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/sorting_helper.rb | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb index bfba12972db..dfb741269eb 100644 --- a/app/helpers/sorting_helper.rb +++ b/app/helpers/sorting_helper.rb @@ -29,30 +29,40 @@ module SortingHelper } end - # TODO: stars_asc doesnt seem to work def projects_sort_options_hash + is_admin = current_controller?('admin/projects') + options = { sort_value_latest_activity => sort_title_latest_activity, - sort_value_recently_created => sort_title_recently_created, sort_value_name => sort_title_name, - sort_value_most_stars => sort_title_stars + sort_value_oldest_activity => sort_title_oldest_activity, + sort_value_oldest_created => sort_title_oldest_created, + sort_value_recently_created => sort_title_recently_created, + sort_value_most_stars => sort_title_most_stars } - if current_controller?('admin/projects') + if is_admin options[sort_value_largest_repo] = sort_title_largest_repo end - options + search_bar_options = { + sort_value_latest_activity => sort_title_latest_activity, + sort_value_recently_created => sort_title_created_date, + sort_value_name => sort_title_name, + sort_value_most_stars => sort_title_stars + } + + Feature.enabled?(:project_list_filter_bar) && !is_admin ? search_bar_options : options end def projects_sort_option_titles { sort_value_latest_activity => sort_title_latest_activity, - sort_value_recently_created => sort_title_recently_created, + sort_value_recently_created => sort_title_created_date, sort_value_name => sort_title_name, sort_value_most_stars => sort_title_stars, sort_value_oldest_activity => sort_title_latest_activity, - sort_value_oldest_created => sort_title_recently_created, + sort_value_oldest_created => sort_title_created_date, sort_value_name_desc => sort_title_name, sort_value_most_stars_asc => sort_title_stars } |