Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorHerminio Torres <herminiocesar@gmail.com>2016-07-27 06:56:17 +0300
committerHerminio Torres <herminiocesar@gmail.com>2016-07-28 18:20:57 +0300
commit94e6d51ec047fbf01cae2814003bba7ee2ff8546 (patch)
tree6de538f4370b1735068939f82db26c3e3cc8746a /app/views
parent680d361c83fcf57de2927161ddfe7c09766ae75b (diff)
Fix the title of the toggle dropdown button
Before when you choose the way of `sort` instead it display the title correctly it was just apply the humanize helper in sort value. E.g. When you choose `Last updated` it should display the title `Last updated` instead of `Recently updated`. This fix makes this correctly displays the title. Change the implementation of the `link_to` `filter_branches_path` - Change the value of the `params[:sort]` in `link_to`. E.g. instead of using `'recently_updated'` is now using `sort_value_recently_updated`. - Change the values of the case in the `branches_sorted_by` method for the values it receives in the `params[:sort]` that are: `nil`, `'name'`, `'updated_desc'`, `'updated_asc'`.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/branches/index.html.haml11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index cb190d121c2..e889f29c816 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -14,18 +14,15 @@
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
%span.light
- - if params[:sort].present?
- = params[:sort].humanize
- - else
- Name
+ = projects_sort_options_hash[@sort]
%b.caret
%ul.dropdown-menu.dropdown-menu-align-right
%li
- = link_to filter_branches_path(sort: nil) do
+ = link_to filter_branches_path(sort: sort_value_name) do
= sort_title_name
- = link_to filter_branches_path(sort: 'recently_updated') do
+ = link_to filter_branches_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
- = link_to filter_branches_path(sort: 'last_updated') do
+ = link_to filter_branches_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
- if can? current_user, :push_code, @project