summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-07-16 00:38:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-07-16 00:38:58 +0200
commitf1db6f88d73cc617567fae9fdf7402bd4d5dd00b (patch)
tree3c76852b99f5171c5e80b09a952948ed0503b02b
parent29a3b1a904637a8be5fbec6e2a4ff880dd4c1ea0 (diff)
use shifted div for anchor to account for header bar
-rw-r--r--sass/app.scss5
-rw-r--r--templates/departure_list.html9
2 files changed, 9 insertions, 5 deletions
diff --git a/sass/app.scss b/sass/app.scss
index ab7f497..a0fcaa1 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -169,6 +169,11 @@ ul.stops {
border-bottom: 1px solid grey;
background-color: $bg;
+ > .anchor {
+ position: relative;
+ top: -12em;
+ }
+
a {
color: $fg;
text-decoration: none;
diff --git a/templates/departure_list.html b/templates/departure_list.html
index 090e47c..08be97e 100644
--- a/templates/departure_list.html
+++ b/templates/departure_list.html
@@ -1,9 +1,8 @@
{% for departure in departures %}
- {% if departure.line.productName and departure.line.fahrtNr %}
- <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}" id="{{departure.line.productName}}{{departure.line.fahrtNr}}">
- {% else %}
- <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}">
- {% endif %}
+ <li class="{{ departure.classes }}" data-timestamp="{{ departure.sort_by }}">
+ {% if departure.line.productName and departure.line.fahrtNr %}
+ <div class="anchor" id="{{departure.line.productName}}{{departure.line.fahrtNr}}">
+ {% endif %}
<a href="/trip/{{ departure.tripId }}?line={{ departure.quoted_line_name }}&amp;highlight={{ departure.quoted_stop_name }}&amp;platform={{ departure.quoted_platform() }}">
<span class="line {{ departure.line.css_class }}">{{ departure.line.name }}</span>
{% if departure.direction_area %}