From aebf22f639073ab4d5c0ff4970d60bf24e8879f0 Mon Sep 17 00:00:00 2001 From: Ezekiel Kigbo Date: Fri, 12 Apr 2019 14:14:28 +0200 Subject: 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. --- app/helpers/sorting_helper.rb | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'app/helpers/sorting_helper.rb') 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 } -- cgit v1.2.3