sean@16: sean@16: sean@16: <% sean@16: import math, os, sys, subprocess, html.parser sean@16: from datetime import date sean@16: sean@16: PATH = os.path.abspath(os.path.dirname(sys.argv[0])) sean@16: sys.path.append(PATH + "/modules") sean@16: import web_view sean@16: sean@16: ################# sean@16: # settings # sean@16: ################# sean@16: sean@16: show_top_bar = settings["show_top_bar"] sean@16: sean@16: ################# sean@16: # date and time # sean@16: ################# sean@16: sean@16: today = date.today() sean@16: weekday = ("Montag", "Dienstag", "Mittwoch", "Donnerstag", sean@16: "Freitag", "Samstag", "Sonntag")[today.weekday()] sean@16: month_name = ("Januar", "Februar", "März", "Aprill", "Mai", sean@16: "Juni", "Juli", "August", "September", "Oktober", sean@16: "November", "Dezember")[today.month-1] sean@16: sean@19: number_of_rows = 2 sean@16: sean@16: ################# sean@16: # viewport size # sean@16: ################# sean@16: vp_size = "17px" sean@16: #if len(tiles) <= 2: sean@16: # vp_size = "6vw" sean@16: #elif len(tiles) >2 and len(tiles) <=4 : sean@16: # vp_size = "5vw" sean@16: #elif len(tiles) >4 and len(tiles) <=6 : sean@16: # vp_size = "4vw" sean@16: #elif len(tiles) >6 and len(tiles) <=8 : sean@16: # vp_size = "3vw" sean@16: #end sean@16: %> sean@16: sean@16: sean@16: sean@16: sean@16: sean@16:
sean@16: % if show_top_bar == "True" : sean@16:
sean@16: {{weekday}} {{today.day}}. {{month_name}} sean@16:
sean@16: % end sean@16: sean@16:
sean@16: <% sean@16: for tile in tiles : sean@16: type = "" sean@16: tile_content = "" sean@16: status = "" sean@16: if tile["type"] == "mon" : sean@16: type = "statusmon" sean@16: tile_content = tile["source"] sean@16: if tile["status"] == "up" : sean@16: status = "active" sean@16: elif tile["status"] == "down" : sean@16: status = "dead" sean@16: end sean@16: elif tile["type"] == "d3js" : sean@16: type = "chart" sean@16: status = tile["div_name"] sean@16: tile_content = web_view.make_chart(tile["script"], tile["div_name"]) sean@16: end sean@16: %> sean@16: sean@16:
sean@16: {{!tile_content}} sean@16:
sean@16: sean@16: % end sean@16: sean@16:
sean@16: