From 2cb5e8469466b1c7980e3dcc11de41e1a28b4989 Mon Sep 17 00:00:00 2001 From: Claudius Date: Wed, 6 Oct 2021 12:03:36 +0200 Subject: [PATCH] Update v2h_templates.py Tweaks to the HTML output template: - Sticky footer so update timestamp always visible without scrolling - Slight copy update to clarify that networks are shown behind the map link - table row hover state now uses hue-rotate to ensure enough contrast as compared to whole line blue previously --- v2h_templates.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/v2h_templates.py b/v2h_templates.py index 0f0237b..300a62e 100644 --- a/v2h_templates.py +++ b/v2h_templates.py @@ -6,6 +6,10 @@ STYLE = ''' body { font-family: sans-serif; font-size: 12pt; + margin: 0px; +} +main { + margin: 10px; } th { font-size: 10pt; @@ -37,7 +41,14 @@ table { max-width: 900px; } tr:hover td:nth-child(n+2) { - background: lightblue; + filter: hue-rotate(-50deg); +} +footer { + background: white; + border-top: 1px solid grey; + bottom: 0px; + padding: 10px; + position: sticky; } ''' @@ -51,9 +62,10 @@ INDEX_HEADER = ''' (s) +

Subway Validation Results

Total good metro networks: {good_cities} of {total_cities}.

-

View on the map

+

View networks on a map

'''.replace('(s)', STYLE) @@ -99,10 +111,11 @@ INDEX_COUNTRY = ''' INDEX_FOOTER = '''
-

Produced by Subway Preprocessor on {date}. +

+ ''' @@ -116,6 +129,7 @@ COUNTRY_HEADER = ''' (s) +

Subway Validation Results for {country}

Return to the countries list.

@@ -168,7 +182,8 @@ COUNTRY_CITY = ''' COUNTRY_FOOTER = '''
-

Produced by Subway Preprocessor on {date}.

+
+ '''