Skip to content

Commit

Permalink
Add a footer with the version
Browse files Browse the repository at this point in the history
This adds a responsive footer to the page
that had the standard DCE version displayed
at the bottom. This also changes the header
to include an SVG logo, which is the
first part of adding a logo, but it will need
a PNG fallback.

Connected to UCLALibrary/ursus#10
Connected to UCLALibrary/amalgamated-samvera#132
  • Loading branch information
little9 authored and bess committed Oct 16, 2018
1 parent 5919412 commit d96e5b1
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require ursus
*= require blacklight
*= require ursus
*/
4 changes: 4 additions & 0 deletions app/assets/stylesheets/ursus.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@import 'ursus/fonts';
@import 'ursus/colors';
@import 'ursus/buttons';
@import 'ursus/navbar';
@import 'ursus/facets';
@import 'ursus/footer';
@import 'ursus/body';
9 changes: 9 additions & 0 deletions app/assets/stylesheets/ursus/_body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}

#main-container {
flex: 1;
}
5 changes: 5 additions & 0 deletions app/assets/stylesheets/ursus/_facets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import 'colors';

.facet-values {
display: inline-flex;
}
11 changes: 11 additions & 0 deletions app/assets/stylesheets/ursus/_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.footer {
background-color: $ucla-secondary-blue-dark;
height: 100px;
}

.version {
color: snow;
float: right;
margin: 1em;
margin-top: 2em;
}
7 changes: 7 additions & 0 deletions app/assets/stylesheets/ursus/_navbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'colors';

.navbar-brand {
margin-top: 1em;
margin-left: 0 !important;
background: transparent image_url('logo.svg') no-repeat top left !important;
}
6 changes: 5 additions & 1 deletion app/assets/stylesheets/ursus/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ $system-font-stack: -apple-system,BlinkMacSystemFont,"Segoe UI",Cantarell,Roboto
$font-family-sans-serif: "ProximaNova-Regular", "Verdana", $system-font-stack;

//== Links
$link-color: $ucla-link;
$link-color: $ucla-secondary-blue-dark;
$link-hover-color: $ucla-link-hover;

$navbar-inverse-link-color: snow;

$navbar-inverse-bg: $ucla-secondary-blue-dark;
8 changes: 8 additions & 0 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<footer class="footer"
<div class="container">

<div class="text">
<span class="version">Version <span title="<%= GIT_SHA %>"><%= BRANCH %> updated <%= LAST_DEPLOYED %></span></span>
</div>
</div>
</footer>
26 changes: 26 additions & 0 deletions config/initializers/git_sha.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
revisions_logfile = "/opt/#{ENV['PROJECT_NAME']}/revisions.log"
GIT_SHA =
if Rails.env.production? && File.exist?(revisions_logfile)
`tail -1 #{revisions_logfile}`.chomp.split(" ")[3].gsub(/\)$/, '')
elsif Rails.env.development? || Rails.env.test?
`git rev-parse HEAD`.chomp
else
"Unknown SHA"
end

BRANCH =
if Rails.env.production? && File.exist?(revisions_logfile)
`tail -1 #{revisions_logfile}`.chomp.split(" ")[1]
elsif Rails.env.development? || Rails.env.test?
`git rev-parse --abbrev-ref HEAD`.chomp
else
"Unknown branch"
end

LAST_DEPLOYED =
if Rails.env.production? && File.exist?(revisions_logfile)
deployed = `tail -1 #{revisions_logfile}`.chomp.split(" ")[7]
Date.parse(deployed).strftime("%d %B %Y")
else
"Not in deployed environment"
end

0 comments on commit d96e5b1

Please sign in to comment.