b996a82ff4
Extended ProjectFinder in order to handle the following options: - current_user - which user use - project_ids_relation: int[] - project ids to use - params: - trending: boolean - non_public: boolean - starred: boolean - sort: string - visibility_level: int - tags: string[] - personal: boolean - search: string - non_archived: boolean GroupProjectsFinder now inherits from ProjectsFinder. Changed the code in order to use the new available options.
38 lines
1.6 KiB
Text
38 lines
1.6 KiB
Text
- @sort ||= sort_value_latest_activity
|
|
.dropdown
|
|
- toggle_text = projects_sort_options_hash[@sort]
|
|
= dropdown_toggle(toggle_text, { toggle: 'dropdown' }, { id: 'sort-projects-dropdown' })
|
|
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
|
|
%li.dropdown-header
|
|
Sort by
|
|
- projects_sort_options_hash.each do |value, title|
|
|
%li
|
|
= link_to filter_projects_path(sort: value), class: ("is-active" if @sort == value) do
|
|
= title
|
|
|
|
%li.divider
|
|
%li
|
|
= link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do
|
|
Hide archived projects
|
|
%li
|
|
= link_to filter_projects_path(archived: true), class: ("is-active" if params[:archived].present?) do
|
|
Show archived projects
|
|
- if current_user
|
|
%li.divider
|
|
%li
|
|
= link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do
|
|
Owned by anyone
|
|
%li
|
|
= link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do
|
|
Owned by me
|
|
- if @group && @group.shared_projects.present?
|
|
%li.divider
|
|
%li
|
|
= link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do
|
|
All projects
|
|
%li
|
|
= link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do
|
|
Hide shared projects
|
|
%li
|
|
= link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do
|
|
Hide group projects
|