From 3ed4b458a12694848569b8b6d0fc68c209b9914a Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 27 Apr 2015 12:59:45 +0000 Subject: [PATCH] simple javascript clock for frontend remove table from administration backend, styling with bootstrap for mobile compability --- example-output-style/clock.js | 19 ++++++++++ templates/admin_show_entries.html | 63 ++++++++++++++++++++----------- templates/display.html | 12 ++++-- 3 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 example-output-style/clock.js diff --git a/example-output-style/clock.js b/example-output-style/clock.js new file mode 100644 index 0000000..7611c7b --- /dev/null +++ b/example-output-style/clock.js @@ -0,0 +1,19 @@ +tday=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"); +tmonth=new Array("Januar","Februar","M%E4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"); + +function GetClock(){ +var d=new Date(); +var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear(),nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(); + + +if(nyear<1000) nyear+=1900; +if(nmin<=9) nmin="0"+nmin; +if(nsec<=9) nsec="0"+nsec; + +document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+ndate+". "+tmonth[nmonth]+" "+nyear+"
"+nhour+":"+nmin+":"+nsec+""; +} + +window.onload=function(){ +GetClock(); +setInterval(GetClock,1000); +} diff --git a/templates/admin_show_entries.html b/templates/admin_show_entries.html index d3c532d..bdbf10b 100644 --- a/templates/admin_show_entries.html +++ b/templates/admin_show_entries.html @@ -22,7 +22,6 @@ -

Show frontpage of this tycker

@@ -47,31 +46,49 @@
- +
- - - - - - - - - - -
TimestampTitleContent
- - -
-
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ + +
+ + diff --git a/templates/display.html b/templates/display.html index bfd78ef..ec810da 100644 --- a/templates/display.html +++ b/templates/display.html @@ -10,6 +10,7 @@ + @@ -22,7 +23,9 @@

-
+
+
+
${nav_links(prev_link, next_link)}
@@ -31,11 +34,14 @@ ${formatter(entry['content'])}
${show_timestamp(entry['timestamp'])}
-
+
${nav_links(prev_link, next_link)} -
+
+
+
+