summaryrefslogtreecommitdiffstats
path: root/app/helpers/sort_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-04 09:36:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-04 09:36:35 +0000
commit8b998ec05ba92082beb8265f5403bc0ec945a0ed (patch)
tree8b63447d5482e7bab971e0b78550c05c8798df4e /app/helpers/sort_helper.rb
parent2e9b28906db62f5ef5b2663f68d395a8e261959c (diff)
downloadredmine-8b998ec05ba92082beb8265f5403bc0ec945a0ed.tar.gz
redmine-8b998ec05ba92082beb8265f5403bc0ec945a0ed.zip
Adds css classes to get sort order on the issue list (#17993).
git-svn-id: http://svn.redmine.org/redmine/trunk@13425 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/sort_helper.rb')
-rw-r--r--app/helpers/sort_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb
index 13beed3c2..cbdc41883 100644
--- a/app/helpers/sort_helper.rb
+++ b/app/helpers/sort_helper.rb
@@ -239,5 +239,17 @@ module SortHelper
options[:title] = l(:label_sort_by, "\"#{caption}\"") unless options[:title]
content_tag('th', sort_link(column, caption, default_order), options)
end
+
+ # Returns the css classes for the current sort order
+ #
+ # Example:
+ #
+ # sort_css_classes
+ # # => "sort-by-created-on sort-desc"
+ def sort_css_classes
+ if @sort_criteria.first_key
+ "sort-by-#{@sort_criteria.first_key.to_s.dasherize} sort-#{@sort_criteria.first_asc? ? 'asc' : 'desc'}"
+ end
+ end
end