diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a4a8e4912..608ddded7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -33,6 +33,15 @@ module ApplicationHelper end end + def current_commit_link + hash = CURRENT_COMMIT_HASH + current_repo = CURRENT_COMMIT_REPO.gsub('com:', 'com/') + .gsub('git@', 'https://') + .gsub('.git', '') + + link_to hash.to_s, "#{current_repo}/commit/#{hash}", class: 'footer-version-link' + end + def creator_link(model) return 'not present' if model.blank? return 'unknown' if model.creator.blank? @@ -96,4 +105,4 @@ module ApplicationHelper def body_css_class [controller_path.split('/').map!(&:dasherize), action_name.dasherize, 'page'].join('-') end -end \ No newline at end of file +end diff --git a/app/views/layouts/admin/base.haml b/app/views/layouts/admin/base.haml index 1ea29753d..928629ce6 100644 --- a/app/views/layouts/admin/base.haml +++ b/app/views/layouts/admin/base.haml @@ -32,5 +32,5 @@ .footer.text-right Version - = link_to "#{CURRENT_COMMIT_HASH}", "#{CURRENT_COMMIT_REPO}/commits/#{CURRENT_COMMIT_HASH}", class: 'footer-version-link' + = current_commit_link = javascript_include_tag 'admin-manifest', async: true diff --git a/app/views/layouts/registrant/application.html.erb b/app/views/layouts/registrant/application.html.erb index 9c3341bd3..c5290b70f 100644 --- a/app/views/layouts/registrant/application.html.erb +++ b/app/views/layouts/registrant/application.html.erb @@ -76,7 +76,7 @@