diff options
| author | Xinhui | 2017-11-28 11:06:23 +0100 |
|---|---|---|
| committer | Xinhui | 2017-11-28 12:23:39 +0100 |
| commit | 9b22efe398e9c4fade870742aa81ffb8de6fbcaf (patch) | |
| tree | 13cfb6e0c9b8b88ac850877a61c85291607de7ba | |
| parent | 9a313f95785a55788af54a46bf1f846b74c16c54 (diff) | |
| download | chouette-core-9b22efe398e9c4fade870742aa81ffb8de6fbcaf.tar.bz2 | |
Edit helper page_header_meta to display default default_whodunnit
| -rw-r--r-- | app/helpers/application_helper.rb | 7 | ||||
| -rw-r--r-- | config/locales/en.yml | 1 | ||||
| -rw-r--r-- | config/locales/fr.yml | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index da293905f..2ce1de497 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,4 @@ + module ApplicationHelper include NewapplicationHelper @@ -15,9 +16,9 @@ module ApplicationHelper def page_header_meta(object) info = t('last_update', time: l(object.updated_at, format: :short)) - if object.try(:versions) && object.versions.last - author = object.versions.last.try(:whodunnit) - info = "#{info} #{t('whodunnit', author: author)}" if author + if object.try(:versions) + author = object.versions.try(:last).try(:whodunnit) || t('default_whodunnit') + info = "#{info} #{t('whodunnit', author: author)}" end content_tag :div, info.html_safe, class: 'small' end diff --git a/config/locales/en.yml b/config/locales/en.yml index 58259a1d4..4834ceef4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -49,6 +49,7 @@ en: last_update: 'Last update on<br>%{time}' whodunnit: 'By %{author}' + default_whodunnit: 'web service' last_sync: 'Last sync on %{time}' validity_range: '%{debut} > %{end}' bounding_dates: '%{debut} > %{end}' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 98231787f..24482166c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -49,6 +49,7 @@ fr: last_update: 'Dernière mise à jour<br>le %{time}' whodunnit: 'Par %{author}' + default_whodunnit: 'web service' last_sync: 'Dernière mise à jour le %{time}' validity_range: '%{debut} > %{end}' bounding_dates: '%{debut} > %{end}' |
