aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorZog2017-12-18 17:18:25 +0100
committerZog2017-12-19 14:21:52 +0100
commit98c08c6fae5b0bf59231b3e402ca91307c200297 (patch)
tree51dc7a30198d6fa83df13948fc2223effb01cc28 /app/helpers
parent3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d (diff)
downloadchouette-core-98c08c6fae5b0bf59231b3e402ca91307c200297.tar.bz2
Refs #5333@1.5h; Use permissions to sync StopAreas and Lines
- add missing policies - update permissions translator - update views to check for the permission - update views helper to check for the permission - uipdate controllers to check for the permission
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 124604cd9..713542ff4 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -23,12 +23,18 @@ module ApplicationHelper
end
def page_header_meta(object)
- info = t('last_update', time: l(object.updated_at, format: :short))
- if object.try(:versions)
- author = object.versions.try(:last).try(:whodunnit) || t('default_whodunnit')
- info = "#{info} <br/> #{t('whodunnit', author: author)}"
+ out = ""
+ display = true
+ display = policy(object).synchronize? if policy(object).respond_to?(:synchronize?) rescue false
+ if display
+ info = t('last_update', time: l(object.updated_at, format: :short))
+ if object.try(:versions)
+ author = object.versions.try(:last).try(:whodunnit) || t('default_whodunnit')
+ info = "#{info} <br/> #{t('whodunnit', author: author)}"
+ end
+ out += content_tag :div, info.html_safe, class: 'small last-update'
end
- content_tag :div, info.html_safe, class: 'small'
+ out.html_safe
end
def page_header_content_for(object)