--- a/templates/stop_week.html Mon Mar 12 18:10:58 2018 +0200 +++ b/templates/stop_week.html Thu Mar 29 23:55:36 2018 +0300 @@ -140,6 +140,33 @@ background-color: #331f29; color: white; } + + .routes-legend .route + { + font-weight: bold + } + + .routes-legend .night-route + { + color: blue + } + + .routes-legend + { + border-spacing: 0px; + border-collapse: separate; + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.2); + } + + .routes-legend tr + { + width: 100%; + } + + .routes-legend td.description + { + } </style> </head> {% macro night_class(hour) %} @@ -147,6 +174,12 @@ night {% endif %} {% endmacro %} + +{% macro all_night_routes(entry, description) %} +{% if description['all-night-routes'](entry, description) %} +night-route +{% endif %} +{% endmacro %} <body> <table class='aikataulu' cellspacing="0"> <thead> @@ -155,6 +188,22 @@ <span><img src="../static/pysäkki.png" height="96" /> {{ref}} {{name}}</span> </th> </tr> + <tr> + <td colspan='100'> + <table class='routes-legend'> + {% for entry in description['description'] %} + <tr> + <td> + {% for route in entry[0] %} + <span class="route {{route in description['night-routes'] and 'night-route' or ''}}">{{ route }}</span> + {% endfor %} + </td> + <td class="{{all_night_routes(entry, description)}} description">{{ entry[1] }}</td> + </tr> + {% endfor %} + </table> + </td> + </tr> </thead> <tbody> {% for day in week %} @@ -166,7 +215,9 @@ <th class='hour-column {{night_class(hour)}}'>{{hour}}</th> {% for entry in hour_schedule %} <td class='minute-time'><span>{{'%02d' % entry['minute']}}</span></td> + {% if not description['simple'] %} <td class='minute-route'><span>{{entry['route']}}</span></td> + {% endif %} {% endfor %} </tr> {% endfor %}