summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-30 08:32:08 +0200
committerPeter Kozak <spag@golwen.net>2013-04-30 08:32:08 +0200
commit91a4c93f7e89c44059283b2395d7c7419c6a4c7d (patch)
tree3cb7ec03c201bbe50568c50b0191c092f957514b /app
parent905a8d0715018188d952d99af5f4686437b4a779 (diff)
chevrons added
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7171fbb..2c420c4 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -23,9 +23,18 @@ module ApplicationHelper
if !defined?(sort_descending)
return title
end
- link_class = (column.to_s == sort_column.to_s) ? "sort_descending #{sort_descending}" : nil
- desc = (column.to_s == sort_column.to_s) ? !!(!sort_descending && column) : nil
- link_to title, {:sort => column, :desc => desc, :type => @type}, {:class => link_class}
+
+ if column.to_s == sort_column.to_s
+ link_class = "sort_descending #{sort_descending}"
+ desc = !!(!sort_descending && column)
+ icon = sort_descending ? ' <i class = "icon-chevron-up"></i> ' : ' <i class = "icon-chevron-down"></i> '
+ else
+ link_class = nil
+ desc = nil
+ icon = ''
+ end
+
+ link_to raw('') + title + raw(icon), {:sort => column, :desc => desc, :type => @type}, {:class => link_class}
end
end