summaryrefslogtreecommitdiff
path: root/app/views/explore
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 19:15:05 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 19:15:05 -0800
commitbbca6a0abd9f5559fe4abbf2cb2100a0e4717ac8 (patch)
tree34b5f2fd0c2301b8d5284700bec64ee272246bc4 /app/views/explore
parente0aa5c371ea1c633a0648f13cd7bea35f3aea75c (diff)
downloadgitlab-ce-bbca6a0abd9f5559fe4abbf2cb2100a0e4717ac8.tar.gz
Refactor sorting in project
Diffstat (limited to 'app/views/explore')
-rw-r--r--app/views/explore/groups/index.html.haml15
-rw-r--r--app/views/explore/projects/index.html.haml14
2 files changed, 13 insertions, 16 deletions
diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml
index 9b1d7d0416d..5cf514927af 100644
--- a/app/views/explore/groups/index.html.haml
+++ b/app/views/explore/groups/index.html.haml
@@ -1,6 +1,7 @@
.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 input-mn-300", id: "groups_search"
.form-group
@@ -11,21 +12,19 @@
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%span.light sort:
- if @sort.present?
- = @sort.humanize
+ = sort_options_hash[@sort]
- else
- Name
+ = sort_title_recently_created
%b.caret
%ul.dropdown-menu
%li
- = link_to explore_groups_path(sort: nil) do
- Name
- = link_to explore_groups_path(sort: 'newest') do
+ = link_to explore_groups_path(sort: sort_value_recently_created) do
= sort_title_recently_created
- = link_to explore_groups_path(sort: 'oldest') do
+ = link_to explore_groups_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created
- = link_to explore_groups_path(sort: 'recently_updated') do
+ = link_to explore_groups_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
- = link_to explore_groups_path(sort: 'last_updated') do
+ = link_to explore_groups_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
%hr
diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml
index 02586077d8c..02d02912791 100644
--- a/app/views/explore/projects/index.html.haml
+++ b/app/views/explore/projects/index.html.haml
@@ -11,21 +11,19 @@
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%span.light sort:
- if @sort.present?
- = @sort.humanize
+ = sort_options_hash[@sort]
- else
- Name
+ = sort_title_recently_created
%b.caret
%ul.dropdown-menu
%li
- = link_to explore_projects_path(sort: nil) do
- Name
- = link_to explore_projects_path(sort: 'newest') do
+ = link_to explore_projects_path(sort: sort_value_recently_created) do
= sort_title_recently_created
- = link_to explore_projects_path(sort: 'oldest') do
+ = link_to explore_projects_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created
- = link_to explore_projects_path(sort: 'recently_updated') do
+ = link_to explore_projects_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
- = link_to explore_projects_path(sort: 'last_updated') do
+ = link_to explore_projects_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
%hr