From 36e039803643d7624da6b7ba4c0d3d57f47da4b9 Mon Sep 17 00:00:00 2001 From: Horus Date: Thu, 3 Mar 2016 12:41:16 +0100 Subject: Print build time in the html. --- Makefile | 4 ++-- gospeladlershof.de/layouts/impressum/single.html | 2 ++ gospeladlershof.de/layouts/index.html | 1 + gospeladlershof.de/layouts/partials/footer.tmpl | 1 + gospeladlershof.de/static/css/gc.css | 3 +++ intern/api/termine.php | 6 +++--- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ed1caf6..44c876b 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,9 @@ build: deploy: @if [ -d /var/www/gospeladlershof.de ]; then\ - rsync --delete -avz intern/ /var/www/gospeladlershof.de/intern/ && \ + rsync --delete --exclude=secrets.php --exclude=json -avz intern/ /var/www/gospeladlershof.de/intern/ && \ cd gospeladlershof.de && rsync --delete -avz public/ /var/www/gospeladlershof.de/gospeladlershof.de/; \ else \ echo rsync --delete -avze ssh intern/ online:/var/www/gospeladlershof.de/intern/ && \ - cd gospeladlershof.de && rsync --delete -avze ssh public/ online:/var/www/gospeladlershof.de/gospeladlershof.de/; \ + cd gospeladlershof.de && rsync --delete --exclude=secrets.php --exclude=json -avze ssh public/ online:/var/www/gospeladlershof.de/gospeladlershof.de/; \ fi diff --git a/gospeladlershof.de/layouts/impressum/single.html b/gospeladlershof.de/layouts/impressum/single.html index 7e3300a..f34a2e9 100644 --- a/gospeladlershof.de/layouts/impressum/single.html +++ b/gospeladlershof.de/layouts/impressum/single.html @@ -1,3 +1,4 @@ +{{ $termine := getJSON "https://www.gospeladlershof.de/" "api/v1/termine" }} {{partial "header.tmpl" .}} {{partial "navbar.tmpl" .}} @@ -58,5 +59,6 @@ +{{$.Scratch.Set "build" $termine.build}} {{partial "footer.tmpl" .}} {{partial "js.tmpl" .}} diff --git a/gospeladlershof.de/layouts/index.html b/gospeladlershof.de/layouts/index.html index b3b822f..759b046 100644 --- a/gospeladlershof.de/layouts/index.html +++ b/gospeladlershof.de/layouts/index.html @@ -136,5 +136,6 @@ +{{$.Scratch.Add "build" $termine.build}} {{partial "footer.tmpl" .}} {{partial "js.tmpl" .}} diff --git a/gospeladlershof.de/layouts/partials/footer.tmpl b/gospeladlershof.de/layouts/partials/footer.tmpl index 201674f..b27197f 100644 --- a/gospeladlershof.de/layouts/partials/footer.tmpl +++ b/gospeladlershof.de/layouts/partials/footer.tmpl @@ -11,4 +11,5 @@
+{{$.Scratch.Get "build"}} diff --git a/gospeladlershof.de/static/css/gc.css b/gospeladlershof.de/static/css/gc.css index fa1aeca..83edce9 100644 --- a/gospeladlershof.de/static/css/gc.css +++ b/gospeladlershof.de/static/css/gc.css @@ -387,3 +387,6 @@ body { .footer-text { font-size: 0.8em !important; } +.hidden { + display:none; +} diff --git a/intern/api/termine.php b/intern/api/termine.php index b5ff1db..6571e98 100644 --- a/intern/api/termine.php +++ b/intern/api/termine.php @@ -7,7 +7,7 @@ $db = get_db(); if ( false === $db ) { echo file_get_contents($json_file); // Liest veralte JSON Datei - error_log (json_encode( array( "error" => true, "reason" => "Can't connect to the database", "build" => time() ) ) ); + error_log (json_encode( array( "error" => true, "reason" => "Can't connect to the database", "build" => date("d.m.Y H:i:s") ) ) ); exit; } @@ -16,10 +16,10 @@ $proben = $res->fetchAll(PDO::FETCH_ASSOC); $res = $db->query('select termin,uhrzeit,beschreibung,anfahrt from konzert order by id desc limit 1;'); $konzert = $res->fetchAll(PDO::FETCH_ASSOC); -$output = array("konzert" => $konzert, "proben" => $proben, "build" => time()); +$output = array("konzert" => $konzert, "proben" => $proben, "build" => date("d.m.Y H:i:s")); $data = json_encode($output, JSON_PRETTY_PRINT); file_put_contents($json_file, $data); // speichert die JSON Datei für den Fall, dass es später Fehler gibt -echo $file; +echo $data; -- cgit v1.2.3