Skip to content
Merged
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
4 changes: 3 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ config :laboratory,
"Uses the new timetable component and logic for all timetables"},
{:use_smartling_translations, "Smartling translations",
"Uses Smartling's translation workflows"},
{:fares_v2, "Fares v2", "Exposes information from GTFS Fares V2 in trip plans"}
{:fares_v2, "Fares v2", "Exposes information from GTFS Fares V2 in trip plans"},
{:line_diagram, "New Line Diagram",
"Adds a tab to the schedules page for the new line diagram"}
],
cookie: [
# one month,
Expand Down
4 changes: 3 additions & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ config :laboratory,
{:test_flag, "Cool Bean", "cool bean for test"},
{:use_smartling_translations, "Smartling translations",
"Uses Smartling's translation workflows"},
{:fares_v2, "Fares v2", "Exposes information from GTFS Fares V2 in trip plans"}
{:fares_v2, "Fares v2", "Exposes information from GTFS Fares V2 in trip plans"},
{:line_diagram, "New Line Diagram",
"Adds a tab to the schedules page for the new line diagram"}
],
cookie: [
# one month,
Expand Down
28 changes: 28 additions & 0 deletions lib/dotcom_web/live/line_diagram_live.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
defmodule DotcomWeb.LineDiagramLive do
@moduledoc """
The primary view for looking up stops, maps, and schedules for a particular line
"""

use DotcomWeb, :live_view
@route_patterns_repo Application.compile_env!(:dotcom, :repo_modules)[:route_patterns]

def mount(params, _session, socket) do
route_id = params |> Map.get("route_id")
direction_id = params |> Map.get("direction_id", "1")
route_patterns = @route_patterns_repo.by_route_id(route_id)

{:ok,
socket
|> assign(:direction_id, direction_id)
|> assign(:route_patterns, route_patterns)
|> assign(:route_id, route_id)}
end

def render(assigns) do
~H"""
<marquee style="font-size:2cm" scrollamount="16" scrolldelay="60">
Comment thread
lvachon1 marked this conversation as resolved.
🚧 Under Construction 🚧
</marquee>
"""
end
end
11 changes: 11 additions & 0 deletions lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ defmodule DotcomWeb.Router do
end
end

scope "/schedules", DotcomWeb do
import Phoenix.LiveView.Router
pipe_through([:browser, :browser_live])

live_session :schedules,
layout: {DotcomWeb.LayoutView, :live},
on_mount: DotcomWeb.Plugs.PutFlagsInAssignsHook do
live("/:route_id/line_new", LineDiagramLive)
end
end

scope "/", DotcomWeb do
pipe_through([:secure, :browser])

Expand Down
15 changes: 15 additions & 0 deletions lib/dotcom_web/views/schedule_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ defmodule DotcomWeb.ScheduleView do
route = conn.assigns.route
tab_params = conn.assigns.tab_params
info_link = line_path(conn, :show, route.id, tab_params)
line_path = info_link |> String.replace("/line", "/line_new")
timetable_link = timetable_path(conn, :show, route.id, tab_params)
alerts_link = alerts_path(conn, :show, route.id, tab_params)

Expand All @@ -303,6 +304,20 @@ defmodule DotcomWeb.ScheduleView do
}
]

tabs =
if conn.assigns |> Map.get(:line_diagram, false) do
[
%HeaderTab{
id: "new_line_diagram",
name: ~t"Schedules & Maps (new)",
href: line_path
}
| tabs
]
else
tabs
end

tabs =
case route.type do
n when n in [2, 4] ->
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/dotcom.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5377,6 +5377,11 @@ msgstr ""
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr ""

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr ""

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/en/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5377,6 +5377,11 @@ msgstr ""
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr ""

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr ""

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/es/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5400,6 +5400,11 @@ msgstr "Trenes"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "%{direction_name} calendario para %{route_name}, %{formatted_date}"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "horario & Mapas (nuevo)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/fr-FR/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5400,6 +5400,11 @@ msgstr "Trains"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "%{direction_name} calendrier pour %{route_name}, %{formatted_date}"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "Horaire & Cartes (nouveau)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/ht/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5387,6 +5387,11 @@ msgstr "Tren yo"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "Orè %{direction_name} pou %{route_name}, %{formatted_date}"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "orè ak Kat (nouvo)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/pt-BR/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5396,6 +5396,11 @@ msgstr "Trens"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "Horário %{direction_name} para %{route_name}, %{formatted_date}"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "Horário e mapas (novo)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/vi/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5391,6 +5391,11 @@ msgstr "Tàu hỏa"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "%{direction_name} thời khóa biểu cho %{route_name}, %{formatted_date}"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "lịch trình & Bản đồ (mới)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/zh-CN/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5371,6 +5371,11 @@ msgstr "火车"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "%{direction_name} %{route_name}、%{formatted_date} 的时间表"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "时刻表和地图(新增)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
5 changes: 5 additions & 0 deletions priv/gettext/zh-TW/LC_MESSAGES/dotcom.po
Original file line number Diff line number Diff line change
Expand Up @@ -5371,6 +5371,11 @@ msgstr "火車"
msgid "%{direction_name} timetable for %{route_name}, %{formatted_date}"
msgstr "%{direction_name} %{route_name}、%{formatted_date} 的時間表"

#: lib/dotcom_web/views/schedule_view.ex
#, elixir-autogen, elixir-format
msgid "Schedules & Maps (new)"
msgstr "時刻表和地圖(新增)"

#: lib/dotcom_web/templates/schedule/_timetable.html.heex
#, elixir-autogen, elixir-format
msgid "Clockwise Loop"
Expand Down
Loading