From 878f6e6d2f4fe4cff0c22e24b20e788690199302 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 21 Apr 2020 22:28:49 +0200 Subject: a11y: Add aria labels to train list elements --- templates/app.html.ep | 69 ++++++++++++++++++++++--------------------- templates/layouts/app.html.ep | 6 ++-- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/templates/app.html.ep b/templates/app.html.ep index 5ceec12..9b7f8ab 100644 --- a/templates/app.html.ep +++ b/templates/app.html.ep @@ -79,7 +79,7 @@ % } % elsif ($departure->{train_no}) { % if (exists $ice_type->{$departure->{train_no}} and $ice_type->{$departure->{train_no}}[1]) { - <%= $ice_type->{$departure->{train_no}}[1] %> + % } <%= $departure->{train_no} %> % } @@ -102,70 +102,71 @@ % } % } -% if ($departure->{info} and length $departure->{info}) { - -%= $departure->{info} - + +%= $departure->{destination} + + +% if (param('detailed')) { +% my $arrow = '→'; +% if (not $departure->{sched_arrival}) { +% $arrow = '↦'; +% } +% elsif (not $departure->{sched_departure}) { +% $arrow = '⇥'; +% } +% if ($show_realtime) { +%= ($departure->{arrival} // q{}) . $arrow . ($departure->{departure} // q{}) +% } +% else { +%= ($departure->{sched_arrival} // q{}) . $arrow . ($departure->{sched_departure} // q{}) +% } % } % else { - -%= $route_str - +%= $departure->{time} % } - -%= $departure->{destination} % if ($departure->{delay} and not $departure->{is_cancelled}) { +% my $aria_delay = sprintf("Verspätung %d Minuten", $departure->{delay}); % if ($show_realtime) { % if ($departure->{delay} > 0) { - (+<%= $departure->{delay} %>) + (+<%= $departure->{delay} %>) % } % else { - (<%= $departure->{delay} %>) + (<%= $departure->{delay} %>) % } % } % else { % if ($departure->{delay} > 0) { - (+<%= $departure->{delay} %>) + (+<%= $departure->{delay} %>) % } % else { - (<%= $departure->{delay} %>) + (<%= $departure->{delay} %>) % } % } % } % if (($departure->{scheduled_platform} and $departure->{platform} and % $departure->{scheduled_platform} ne $departure->{platform}) % or $departure->{changed_platform}) { - + % } % else { - + % } %= $departure->{platform} - -% if (param('detailed')) { -% my $arrow = '→'; -% if (not $departure->{sched_arrival}) { -% $arrow = '↦'; -% } -% elsif (not $departure->{sched_departure}) { -% $arrow = '⇥'; -% } -% if ($show_realtime) { -%= ($departure->{arrival} // q{}) . $arrow . ($departure->{departure} // q{}) -% } -% else { -%= ($departure->{sched_arrival} // q{}) . $arrow . ($departure->{sched_departure} // q{}) -% } +% if ($departure->{info} and length $departure->{info}) { + +%= $departure->{info} + % } % else { -%= $departure->{time} + +%= $route_str + % } - % } diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep index 6485a22..4b594ac 100644 --- a/templates/layouts/app.html.ep +++ b/templates/layouts/app.html.ep @@ -76,12 +76,12 @@ invert_colors % if (stash('hide_opts')) { -
  • edit
  • +
  • edit
  • % } % else { -
  • edit
  • +
  • edit
  • % } -
  • my_location
  • +
  • my_location
  • -- cgit v1.2.3