Commit 225980db authored by Mark Fletcher's avatar Mark Fletcher

Employ Groups dropdown in admin view

parent 5664ea2f
...@@ -43,14 +43,18 @@ module SortingHelper ...@@ -43,14 +43,18 @@ module SortingHelper
end end
def groups_sort_options_hash def groups_sort_options_hash
options = { {
sort_value_recently_created => sort_title_recently_created, sort_value_recently_created => sort_title_recently_created,
sort_value_oldest_created => sort_title_oldest_created, sort_value_oldest_created => sort_title_oldest_created,
sort_value_recently_updated => sort_title_recently_updated, sort_value_recently_updated => sort_title_recently_updated,
sort_value_oldest_updated => sort_title_oldest_updated sort_value_oldest_updated => sort_title_oldest_updated
} }
end
options def admin_groups_sort_options_hash
groups_sort_options_hash.merge(
sort_value_largest_group => sort_title_largest_group
)
end end
def member_sort_options_hash def member_sort_options_hash
......
...@@ -11,23 +11,7 @@ ...@@ -11,23 +11,7 @@
.search-field-holder .search-field-holder
= search_field_tag :name, project_name, class: "form-control search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: 'Search by name' = search_field_tag :name, project_name, class: "form-control search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: 'Search by name'
= icon("search", class: "search-icon") = icon("search", class: "search-icon")
.dropdown = render "shared/groups/dropdown", options_hash: admin_groups_sort_options_hash
- toggle_text = @sort.present? ? sort_options_hash[@sort] : sort_title_recently_created
= dropdown_toggle(toggle_text, { toggle: 'dropdown' })
%ul.dropdown-menu.dropdown-menu-align-right
%li.dropdown-header
Sort by
%li
= link_to admin_groups_path(sort: sort_value_recently_created, name: project_name) do
= sort_title_recently_created
= link_to admin_groups_path(sort: sort_value_oldest_created, name: project_name) do
= sort_title_oldest_created
= link_to admin_groups_path(sort: sort_value_recently_updated, name: project_name) do
= sort_title_recently_updated
= link_to admin_groups_path(sort: sort_value_oldest_updated, name: project_name) do
= sort_title_oldest_updated
= link_to admin_groups_path(sort: sort_value_largest_group, name: project_name) do
= sort_title_largest_group
= link_to new_admin_group_path, class: "btn btn-new" do = link_to new_admin_group_path, class: "btn btn-new" do
New group New group
%ul.content-list %ul.content-list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment