From a4eeeeaa4b7b199e5b4e41c61c33e5a56fccc823 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 9 Jan 2012 17:57:51 +0100 Subject: Add locales and views for lines --- app/helpers/lines_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/helpers/lines_helper.rb') diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb index a03868a0a..45bd8c6c3 100644 --- a/app/helpers/lines_helper.rb +++ b/app/helpers/lines_helper.rb @@ -1,2 +1,8 @@ module LinesHelper + def order(column) + title ||= Chouette::Line.human_attribute_name(column).titleize + css_class = (column == sort_column) ? "current #{sort_direction}" : nil + direction = (column == sort_column && sort_direction == "asc") ? "desc" : "asc" + link_to title, { :sort => column, :direction => direction}, {:class => css_class} + end end -- cgit v1.2.3