diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /app/helpers/sorting_helper.rb | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) | |
download | gitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'app/helpers/sorting_helper.rb')
-rw-r--r-- | app/helpers/sorting_helper.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb index b28e5ff39b2..fb30e8ca059 100644 --- a/app/helpers/sorting_helper.rb +++ b/app/helpers/sorting_helper.rb @@ -70,6 +70,15 @@ module SortingHelper options end + def forks_sort_options_hash + { + sort_value_recently_created => sort_title_created_date, + sort_value_oldest_created => sort_title_created_date, + sort_value_latest_activity => sort_title_latest_activity, + sort_value_oldest_activity => sort_title_latest_activity + } + end + def projects_sort_option_titles # Only used for the project filter search bar projects_sort_options_hash.merge({ @@ -93,6 +102,15 @@ module SortingHelper } end + def forks_reverse_sort_options_hash + { + sort_value_recently_created => sort_value_oldest_created, + sort_value_oldest_created => sort_value_recently_created, + sort_value_latest_activity => sort_value_oldest_activity, + sort_value_oldest_activity => sort_value_latest_activity + } + end + def groups_sort_options_hash { sort_value_name => sort_title_name, @@ -303,6 +321,13 @@ module SortingHelper sort_direction_button(url, reverse_sort, sort_value) end + + def forks_sort_direction_button(sort_value, without = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]) + reverse_sort = forks_reverse_sort_options_hash[sort_value] + url = page_filter_path(sort: reverse_sort, without: without) + + sort_direction_button(url, reverse_sort, sort_value) + end end SortingHelper.prepend_mod_with('SortingHelper') |