Skip to content

Commit

Permalink
Adding version info and timestamp to views
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlee committed Mar 15, 2018
1 parent a00b057 commit 20d7778
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,13 @@ p.separator {
}
}
}
}

.diagnostic-info {
padding: 2px;
font-size: 0.8em;
color: #888;
position:absolute;
bottom:0;
right: 0;
}
8 changes: 7 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
class ApplicationController < ActionController::Base
#include Pundit
protect_from_forgery with: :exception

before_action :authenticate_user!
helper_method :app_version

protected

def app_version
@app_version ||= `git show --pretty=%H`[0...8]
end
end
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<%= yield %>
</div>

<%= render 'partials/diagnostic_info' %>
<%= render 'partials/google_analytics' %>
</body>

Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/no_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<%= yield %>
</div>

<%= render 'partials/diagnostic_info' %>
<%= render 'partials/google_analytics' %>
</body>

Expand Down
4 changes: 4 additions & 0 deletions app/views/partials/_diagnostic_info.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="diagnostic-info">
Version: <%= app_version %> |
<%= Time.now.getutc %>
</div>

0 comments on commit 20d7778

Please sign in to comment.