diff options
author | Herminio Torres <herminiocesar@gmail.com> | 2016-07-27 00:56:17 -0300 |
---|---|---|
committer | Herminio Torres <herminiocesar@gmail.com> | 2016-07-28 12:20:57 -0300 |
commit | 94e6d51ec047fbf01cae2814003bba7ee2ff8546 (patch) | |
tree | 6de538f4370b1735068939f82db26c3e3cc8746a /app/models/repository.rb | |
parent | 680d361c83fcf57de2927161ddfe7c09766ae75b (diff) | |
download | gitlab-ce-94e6d51ec047fbf01cae2814003bba7ee2ff8546.tar.gz |
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/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index d8775ecbd6c..8a6f4086518 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -615,11 +615,11 @@ class Repository case value when 'name' branches.sort_by(&:name) - when 'recently_updated' + when 'updated_desc' branches.sort do |a, b| commit(b.target).committed_date <=> commit(a.target).committed_date end - when 'last_updated' + when 'updated_asc' branches.sort do |a, b| commit(a.target).committed_date <=> commit(b.target).committed_date end |