summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus2016-03-03 12:41:16 +0100
committerHorus2016-03-03 12:41:16 +0100
commit36e039803643d7624da6b7ba4c0d3d57f47da4b9 (patch)
treed6a64d5287922cac44d0d09989a5b5f88239b1d6
parent5ef16cc4a33bad8efb5feb45d78f9843039e8fc3 (diff)
downloadgospeladlershof.de-36e039803643d7624da6b7ba4c0d3d57f47da4b9.tar.gz
Print build time in the html.
-rw-r--r--Makefile4
-rw-r--r--gospeladlershof.de/layouts/impressum/single.html2
-rw-r--r--gospeladlershof.de/layouts/index.html1
-rw-r--r--gospeladlershof.de/layouts/partials/footer.tmpl1
-rw-r--r--gospeladlershof.de/static/css/gc.css3
-rw-r--r--intern/api/termine.php6
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 @@
</div>
</section>
+{{$.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 @@
</div>
</section>
+{{$.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 @@
</p>
</div>
</footer>
+<span class="hidden" id="build">{{$.Scratch.Get "build"}}</span>
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;