diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 50cf542..8a99914 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,4 +7,21 @@ def visible?(flag) "display: none" end end + + def application_version + @application_version ||= if File.exists?("#{RAILS_ROOT}/REVISION") + File.read("#{RAILS_ROOT}/REVISION").strip + else + "(development)" + end + end + + def application_last_deployed + @application_last_deployed ||= if File.exists?("#{RAILS_ROOT}/REVISION") + deployed_at = File.stat("#{RAILS_ROOT}/REVISION").ctime + time_ago_in_words(deployed_at) + else + "(not deployed)" + end + end end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d2a3244..a5bd653 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -16,4 +16,10 @@ %span.actions = link_to "logout", session_path, :method => :delete BucketWise - #container= yield + + #container + = yield + #version + == BucketWise version: #{application_version} + %br + == Last deployed: #{application_last_deployed} diff --git a/public/stylesheets/money.css b/public/stylesheets/money.css index d4c5100..8cb8daa 100644 --- a/public/stylesheets/money.css +++ b/public/stylesheets/money.css @@ -58,6 +58,20 @@ div#container { margin: 0 auto; } +div#version { + margin-top: 2em; + border-top: 1px solid #ddd; + color: #ccc; + font-size: 80%; + text-align: right; + padding-top: 0.5em; + line-height: 1.2em; +} + +div#version .version { + font-weight: bold; +} + .header { border-bottom: 1px solid #ccc; }