diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-23 01:53:38 -0700 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-23 01:53:38 -0700 |
commit | 8300398b9f4666c102d6c205f1b94e00b8017014 (patch) | |
tree | bfecc1ae98ff202e4063714c267afde0692f1ca7 /app/helpers/application_helper.rb | |
parent | 20b2a3c493d19b1ea66ba2605053af05f0595f7f (diff) | |
parent | 820e124c20865c17eeea2e17c5bb82da620ada5b (diff) |
Merge pull request #493 from sebbacon/feature/merge-wombleton-sparkly-admin-css
Merge @wombleton sparkly admin css
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index df89a372c..0520a8c77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,5 +113,19 @@ module ApplicationHelper end end + def admin_value(v) + if v.nil? + nil + elsif v.instance_of?(Time) + admin_date(v) + else + h(v) + end + end + + def admin_date(date) + "#{I18n.l(date, :format => "%e %B %Y %H:%M:%S")} (#{_('{{length_of_time}} ago', :length_of_time => time_ago_in_words(date))})" + end + end |