From b7c30cae4eedab5e8e41d9764ac08ca12361d054 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 1 Mar 2017 15:31:56 +0200 Subject: Add filter and sorting to dashboard groups page Signed-off-by: Dmitriy Zaporozhets --- app/views/explore/groups/_groups.html.haml | 6 +++++ app/views/explore/groups/index.html.haml | 41 +++++------------------------- 2 files changed, 13 insertions(+), 34 deletions(-) create mode 100644 app/views/explore/groups/_groups.html.haml (limited to 'app/views/explore') diff --git a/app/views/explore/groups/_groups.html.haml b/app/views/explore/groups/_groups.html.haml new file mode 100644 index 00000000000..8a8c2a740f1 --- /dev/null +++ b/app/views/explore/groups/_groups.html.haml @@ -0,0 +1,6 @@ +.groups-list-holder + %ul.content-list + - @groups.each do |group| + = render 'shared/groups/group', group: group + + = paginate @groups, theme: 'gitlab' diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml index 73cf6e87eb4..10383613c2b 100644 --- a/app/views/explore/groups/index.html.haml +++ b/app/views/explore/groups/index.html.haml @@ -6,40 +6,13 @@ - else = render 'explore/head' -.row-content-block.clearfix - .pull-left - = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| - = hidden_field_tag :sort, @sort - .form-group - = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "groups_search", spellcheck: false - .form-group - = button_tag 'Search', class: "btn btn-default" - - .pull-right - .dropdown.inline - %button.dropdown-toggle{ type: 'button', 'data-toggle' => 'dropdown' } - %span.light - - if @sort.present? - = sort_options_hash[@sort] - - else - = sort_title_recently_created - = icon('chevron-down') - %ul.dropdown-menu.dropdown-menu-align-right - %li - = link_to explore_groups_path(sort: sort_value_recently_created) do - = sort_title_recently_created - = link_to explore_groups_path(sort: sort_value_oldest_created) do - = sort_title_oldest_created - = link_to explore_groups_path(sort: sort_value_recently_updated) do - = sort_title_recently_updated - = link_to explore_groups_path(sort: sort_value_oldest_updated) do - = sort_title_oldest_updated - -%ul.content-list - - @groups.each do |group| - = render 'shared/groups/group', group: group - - unless @groups.present? - .nothing-here-block No public groups +- if @groups.present? + = render 'groups' +- else + .nothing-here-block No public groups = paginate @groups, theme: "gitlab" + +:javascript + GroupsList.init(); -- cgit v1.2.3