Added Hackerspace state change time

gh-pages
Thierry Degeling 2014-08-25 16:57:24 +02:00
parent b2d9d1eb60
commit 560ee5e773
2 changed files with 14 additions and 4 deletions

View File

@ -98,6 +98,10 @@ h1, h2, h3, h4, h5, h6 {
.status { .status {
text-align: center; text-align: center;
font-size: 7em; }
padding: 0;
.status h1 {
font-size: 7em;
margin: 0;
line-height: 1em;
} }

View File

@ -218,12 +218,18 @@ function l2status() {
var status = JSON.parse( response.responseText ); var status = JSON.parse( response.responseText );
var timeStamp = moment.unix( status.lastchange ).format( 'HH:mm' );
$('.status').removeClass('open').removeClass('closed'); $('.status').removeClass('open').removeClass('closed');
if ( status.state.open ) { if ( status.state.open ) {
$('.status').addClass('open').text('Open'); $('.status')
.addClass('open')
.html('<h1>Open</h1>since ' + timeStamp);
} else { } else {
$('.status').addClass('closed').text('Closed'); $('.status')
.addClass('closed')
.html('<h1>Closed</h1>since ' + timeStamp);
} }
} }