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