Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions lib/dotcom_web/components/a11y_and_parking.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
defmodule DotcomWeb.Components.A11yParking do
@moduledoc """
A component for showing (or not) parking and a11y icons
"""

use DotcomWeb, :component

attr :stop, :map, required: true

def a11y_and_parking(assigns) do
~H"""
<div class="flex items-center gap-0.5">
<%= if length(@stop.parking_lots) > 0 do %>
<.tooltip title={~t(Parking available)} placement={:top}>
<.icon
name="square-parking"
class="size-4 fill-gray-light"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<span class="sr-only">{~t(No parking)}</span>
<% end %>

<%= if Stops.Stop.accessible?(@stop) do %>
<.tooltip title={~t(Accessible)} placement={:top}>
<.icon
type="icon-svg"
name="icon-accessible-default"
class="size-4 fill-brand-primary"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<%= if Stops.Stop.accessibility_known?(@stop) do %>
<span class="sr-only">{~t(Not accessible)}</span>
<% else %>
<span class="sr-only">{~t(May not be accessible)}</span>
<% end %>
<% end %>
</div>
"""
end
end
32 changes: 2 additions & 30 deletions lib/dotcom_web/components/new_timetable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule DotcomWeb.Components.NewTimetable do
"""

use DotcomWeb, :component
import DotcomWeb.Components.A11yParking

alias Dotcom.Timetables

Expand Down Expand Up @@ -88,36 +89,7 @@ defmodule DotcomWeb.Components.NewTimetable do
>
<div class={"#{header_column_classes()} px-2 py-1 font-medium #{font_size_classes()} border-r-xs border-gray-lighter flex gap-2"}>
<.link navigate={~p"/stops/#{row.stop.id}"} class="mr-auto">{row.stop.name}</.link>
<div class="flex items-center gap-0.5">
<%= if length(row.stop.parking_lots) > 0 do %>
<.tooltip title={~t(Parking available)} placement={:top}>
<.icon
name="square-parking"
class="size-4 fill-gray-light"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<span class="sr-only">{~t(No parking)}</span>
<% end %>

<%= if Stops.Stop.accessible?(row.stop) do %>
<.tooltip title={~t(Accessible)} placement={:top}>
<.icon
type="icon-svg"
name="icon-accessible-default"
class="size-4 fill-brand-primary"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<%= if Stops.Stop.accessibility_known?(row.stop) do %>
<span class="sr-only">{~t(Not accessible)}</span>
<% else %>
<span class="sr-only">{~t(May not be accessible)}</span>
<% end %>
<% end %>
</div>
<.a11y_and_parking stop={row.stop} />
</div>
<.shadow />
</th>
Expand Down
32 changes: 2 additions & 30 deletions lib/dotcom_web/components/timetable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule DotcomWeb.Components.Timetable do
"""

use DotcomWeb, :component
import DotcomWeb.Components.A11yParking

import DotcomWeb.ScheduleView, only: [timetable_crowding_description: 1]

Expand Down Expand Up @@ -248,36 +249,7 @@ defmodule DotcomWeb.Components.Timetable do
<.link navigate={~p"/stops/#{@stop.id}"} class="m-timetable__stop-link">
{break_text_at_slash(@stop.name)}
</.link>
<div class="m-timetable__stop-icons">
<%= if length(@stop.parking_lots) > 0 do %>
<.tooltip title={~t(Parking available)} placement={:top}>
<.icon
name="square-parking"
class="size-4 fill-gray-light"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<span class="sr-only">{~t(No parking)}</span>
<% end %>

<%= if Stops.Stop.accessible?(@stop) do %>
<.tooltip title={~t(Accessible)} placement={:top}>
<.icon
type="icon-svg"
name="icon-accessible-default"
class="size-4 fill-brand-primary"
aria-hidden="true"
/>
</.tooltip>
<% else %>
<%= if Stops.Stop.accessibility_known?(@stop) do %>
<span class="sr-only">{~t(Not accessible)}</span>
<% else %>
<span class="sr-only">{~t(May not be accessible)}</span>
<% end %>
<% end %>
</div>
<.a11y_and_parking stop={@stop} />
</div>
</th>
"""
Expand Down
15 changes: 5 additions & 10 deletions priv/gettext/dotcom.pot
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ msgstr ""
msgid "Accessibility at %{name}"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/transit_icons.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -2515,8 +2514,7 @@ msgstr ""
msgid "Mattapan Trolley"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "May not be accessible"
msgstr ""
Expand Down Expand Up @@ -2744,8 +2742,7 @@ msgstr ""
msgid "No events"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "No parking"
msgstr ""
Expand Down Expand Up @@ -2793,9 +2790,8 @@ msgstr ""
msgid "Northbound"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/stops/accessibility_amenity.html.heex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
msgid "Not accessible"
Expand Down Expand Up @@ -3041,8 +3037,7 @@ msgstr ""
msgid "Parking at %{name}"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "Parking available"
msgstr ""
Expand Down
15 changes: 5 additions & 10 deletions priv/gettext/en/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ msgstr ""
msgid "Accessibility at %{name}"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/transit_icons.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -2515,8 +2514,7 @@ msgstr ""
msgid "Mattapan Trolley"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "May not be accessible"
msgstr ""
Expand Down Expand Up @@ -2744,8 +2742,7 @@ msgstr ""
msgid "No events"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "No parking"
msgstr ""
Expand Down Expand Up @@ -2793,9 +2790,8 @@ msgstr ""
msgid "Northbound"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/stops/accessibility_amenity.html.heex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
msgid "Not accessible"
Expand Down Expand Up @@ -3041,8 +3037,7 @@ msgstr ""
msgid "Parking at %{name}"
msgstr ""

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "Parking available"
msgstr ""
Expand Down
15 changes: 5 additions & 10 deletions priv/gettext/es/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ msgstr "Recursos de accesibilidad"
msgid "Accessibility at %{name}"
msgstr "accesibilidad en %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/transit_icons.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -2524,8 +2523,7 @@ msgstr "Massport enlace %{route_number}"
msgid "Mattapan Trolley"
msgstr "Mattapan Trolley"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "May not be accessible"
msgstr "Puede que no sea accesible"
Expand Down Expand Up @@ -2756,8 +2754,7 @@ msgstr "No se publicaron cambios durante los próximos 7 días"
msgid "No events"
msgstr "Sin eventos"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "No parking"
msgstr "Prohibido parquear"
Expand Down Expand Up @@ -2805,9 +2802,8 @@ msgstr "servicio normal"
msgid "Northbound"
msgstr "Dirección norte"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/stops/accessibility_amenity.html.heex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
msgid "Not accessible"
Expand Down Expand Up @@ -3054,8 +3050,7 @@ msgstr "Tarifas de parqueadero"
msgid "Parking at %{name}"
msgstr "Parqueadero en %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "Parking available"
msgstr "Parqueadero disponible"
Expand Down
15 changes: 5 additions & 10 deletions priv/gettext/fr-FR/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ msgstr "Ressources d’accessibilité"
msgid "Accessibility at %{name}"
msgstr "L’accessibilité chez %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/transit_icons.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -2525,8 +2524,7 @@ msgstr "Massport navette %{route_number}"
msgid "Mattapan Trolley"
msgstr "Mattapan Trolley"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "May not be accessible"
msgstr "Ce n’est peut-être pas accessible"
Expand Down Expand Up @@ -2757,8 +2755,7 @@ msgstr "Aucun changement n’a été publié pour les 7 jours suivants"
msgid "No events"
msgstr "Aucun événement"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "No parking"
msgstr "Pas de stationnement"
Expand Down Expand Up @@ -2806,9 +2803,8 @@ msgstr "service normal"
msgid "Northbound"
msgstr "Direction nord"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/stops/accessibility_amenity.html.heex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
msgid "Not accessible"
Expand Down Expand Up @@ -3056,8 +3052,7 @@ msgstr "Tarifs de stationnement"
msgid "Parking at %{name}"
msgstr "Parking à %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "Parking available"
msgstr "Places de stationnement disponibles"
Expand Down
15 changes: 5 additions & 10 deletions priv/gettext/ht/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ msgstr "Resous Aksè"
msgid "Accessibility at %{name}"
msgstr "aksesiblite nan %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/transit_icons.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -2521,8 +2520,7 @@ msgstr "Massport navèt %{route_number}"
msgid "Mattapan Trolley"
msgstr "Mattapan Trolley"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "May not be accessible"
msgstr "Li ka pa aksesib"
Expand Down Expand Up @@ -2751,8 +2749,7 @@ msgstr "Pa gen okenn chanjman ki afiche pou 7 jou kap vini yo"
msgid "No events"
msgstr "Pa gen evènman"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "No parking"
msgstr "Pa gen pakin"
Expand Down Expand Up @@ -2800,9 +2797,8 @@ msgstr "sèvis nòmal"
msgid "Northbound"
msgstr "Direksyon nò"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#: lib/dotcom_web/components/stops/accessibility_amenity.html.heex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/trip_planner/itinerary_summary.ex
#, elixir-autogen, elixir-format
msgid "Not accessible"
Expand Down Expand Up @@ -3048,8 +3044,7 @@ msgstr "Tarif Pakin"
msgid "Parking at %{name}"
msgstr "Pakin nan %{name}"

#: lib/dotcom_web/components/new_timetable.ex
#: lib/dotcom_web/components/timetable.ex
#: lib/dotcom_web/components/a11y_and_parking.ex
#, elixir-autogen, elixir-format
msgid "Parking available"
msgstr "Pakin disponib"
Expand Down
Loading
Loading