debian-mirror-gitlab/app/views/shared/projects/_dropdown.html.haml

31 lines
1.4 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
- @sort ||= sort_value_recently_updated
- personal = params[:personal]
- archived = params[:archived]
2016-08-24 12:49:21 +05:30
- namespace_id = params[:namespace_id]
2016-06-02 11:05:42 +05:30
.dropdown.inline
2016-08-24 12:49:21 +05:30
- toggle_text = projects_sort_options_hash[@sort]
= dropdown_toggle(toggle_text, { toggle: 'dropdown' }, { id: 'sort-projects-dropdown' })
2016-06-02 11:05:42 +05:30
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
%li.dropdown-header
Sort by
- projects_sort_options_hash.each do |value, title|
%li
2016-08-24 12:49:21 +05:30
= link_to filter_projects_path(namespace_id: namespace_id, sort: value, archived: archived, personal: personal), class: ("is-active" if @sort == value) do
2016-06-02 11:05:42 +05:30
= title
%li.divider
%li
2016-08-24 12:49:21 +05:30
= link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, archived: nil), class: ("is-active" unless params[:archived].present?) do
2016-06-02 11:05:42 +05:30
Hide archived projects
%li
2016-08-24 12:49:21 +05:30
= link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, archived: true), class: ("is-active" if params[:archived].present?) do
2016-06-02 11:05:42 +05:30
Show archived projects
- if current_user
%li.divider
%li
2016-08-24 12:49:21 +05:30
= link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, personal: nil), class: ("is-active" unless personal.present?) do
2016-06-02 11:05:42 +05:30
Owned by anyone
%li
2016-08-24 12:49:21 +05:30
= link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, personal: true), class: ("is-active" if personal.present?) do
2016-06-02 11:05:42 +05:30
Owned by me