Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1053: Put synchweb version in footer #692

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
# - Show at the top of every page on first load
$motd = 'This is the message of the day.';

# Synchweb version, displayed in footer of each page
$synchweb_version = '';

# Maintainance Mode
# - Disables site access, showing a message
# - This is defined in client/js/config.json
Expand Down
5 changes: 3 additions & 2 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function setupApplication($mode): Slim
global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
$facility_courier_countries, $facility_courier_countries_nde,
$dhl_enable, $dhl_link, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary;
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
Expand All @@ -90,7 +90,8 @@ function setupApplication($mode): Slim
'timezone' => $timezone,
'valid_components' => $valid_components,
'enabled_container_types' => $enabled_container_types,
'ifsummary' => $ifsummary
'ifsummary' => $ifsummary,
'synchweb_version' => $synchweb_version
)));
});
return $app;
Expand Down
42 changes: 16 additions & 26 deletions client/src/css/partials/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,44 +149,34 @@
@apply tw-bg-footer-background tw-bg-footer-site-logo tw-bg-center tw-bg-no-repeat;
// background: $footer-background url('~images/ispyb_gs_medium.png') center center no-repeat;
height: 200px;
background-position: 50% 85%;
background-position: 50% 60%;

@media (max-width: $breakpoint-medium) {
clear: both;
}

.whatnow {
.bottom_bar {
border-top: 1px solid #bbb;
font-size: 16px;
font-size: 12px;
font-family: $page-header-font;
text-align: center;
display: block;
padding: 0.5%;
color: #222;
background: #eee;
transition: 0.3s ease-in-out;

a {
display: block;
padding: 0.5%;
color: #222;
background: #eee;
transition: 0.3s ease-in-out;
text-decoration: none;
}

&:hover {
color: #000;
};
.powered_by {
float: left;
width: 50%;
}
}

a {
color: $footer-color;
text-decoration: none;

&:hover {
color: $footer-hover-color;
.site {
margin-left: 50%;
text-align: right;
}
}

p {
padding: 1%;
text-align: center;
color: $footer-color;
font-size: 10px;
}
}
10 changes: 7 additions & 3 deletions client/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@
</div>

<div id="footer">
<div class="whatnow">
<a href="http://diamondlightsource.github.io/SynchWeb/">SynchWeb? What is This?</a>
<div class="bottom_bar">
<div class="powered_by">
<p>Powered by <a href="http://diamondlightsource.github.io/SynchWeb/">SynchWeb</a></p>
</div>
<div class="site">
<p><a href="<%= htmlWebpackPlugin.options.jsonConfig.site_link || 'https://www.diamond.ac.uk' %>"><%- htmlWebpackPlugin.options.jsonConfig.site_name || 'Diamond Light Source' %></a> &copy;2013-<script>document.write(new Date().getFullYear())</script></p>
</div>
</div>
<p><a href="<%= htmlWebpackPlugin.options.jsonConfig.site_link || 'https://www.diamond.ac.uk' %>"><%- htmlWebpackPlugin.options.jsonConfig.site_name || 'Diamond Light Source' %></a> &copy;2013-<script>document.write(new Date().getFullYear())</script></p>
</div>

</div>
Expand Down
51 changes: 24 additions & 27 deletions client/src/js/app/components/footer.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<template>
<div id="footer">
<div class="whatnow">
<a href="http://diamondlightsource.github.io/SynchWeb/">SynchWeb? What is This?</a>
<div class="bottom_bar">
<div class="powered_by">
<p>Powered by <a href="http://diamondlightsource.github.io/SynchWeb/">SynchWeb</a> {{ synchwebVersion }} </p>
</div>
<div class="site">
<p><a :href="siteLink">{{ siteName }}</a> &copy;2013-{{ currentYear }}</p>
</div>
</div>
<p><a :href="siteLink">{{ siteName }}</a> &copy;2013-{{ currentYear }}</p>

</div>
</template>

Expand All @@ -18,6 +23,9 @@ export default {
siteLink: config.site_link || 'https://www.diamond.ac.uk',
siteName: config.site_name || 'Diamond Light Source'
}
},
computed: {
synchwebVersion : function() { return this.$store.state.synchwebVersion }
}
}
</script>
Expand All @@ -27,7 +35,7 @@ export default {
margin-top: 70px;
background: #000 url(~images/ispyb_gs_medium.png) center center no-repeat;
height: 200px;
background-position: 50% 85%
background-position: 50% 60%
}

@media (max-width: 1024px) {
Expand All @@ -36,40 +44,29 @@ export default {
}
}

#footer .whatnow {
#footer .bottom_bar {
border-top: 1px solid #bbb;
font-size: 16px;
font-size: 12px;
font-family: "Maven Pro";
text-align: center
}

#footer .whatnow a {
display: block;
padding: 0.5%;
color: #222;
background: #eee;
transition: 0.3s ease-in-out
transition: 0.3s ease-in-out;
}

#footer .whatnow a:hover {
color: #000
#footer .bottom_bar a {
text-decoration: none;
}

#footer a {
color: #efefef;
text-decoration: none
#footer .bottom-bar .powered_by {
float: left;
width: 50%;
}

#footer a:hover {
color: #efefef
#footer .bottom-bar .site {
margin-left: 50%;
text-align: right;
}

#footer p {
padding: 1%;
text-align: center;
color: #efefef;
font-size: 10px
}


</style>
</style>
2 changes: 2 additions & 0 deletions client/src/js/app/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const store = new Vuex.Store({
isLoading: false,
motd: '',
ifsummary: false,
synchwebVersion: '',
help: false, // Global help flag used to denote if we should display inline help on pages
skipHomePage: config.skipHome || false,
models: {},
Expand All @@ -68,6 +69,7 @@ const store = new Vuex.Store({
state.motd = options.get('motd') || state.motd

state.ifsummary = options.get('ifsummary') || state.ifsummary
state.synchwebVersion = options.get('synchweb_version') || state.synchwebVersion

app.options = options
},
Expand Down