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