From f9f563d84badf9776846f6e2108cb52956b80980 Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Thu, 19 Dec 2024 08:57:45 +0100 Subject: [PATCH] =?UTF-8?q?Supprimer=20traduction=20horaires=20th=C3=A9ori?= =?UTF-8?q?ques=20(#4394)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/transport/lib/db/dataset.ex | 2 +- .../lib/transport_web/templates/dataset/details.html.heex | 8 -------- apps/transport/lib/transport_web/views/dataset_view.ex | 6 ------ apps/transport/priv/gettext/db-dataset.pot | 2 +- apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po | 2 +- apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po | 4 ++-- apps/transport/test/transport/data_checker_test.exs | 2 +- .../transport_web/controllers/dataset_controller_test.exs | 2 +- .../transport_web/controllers/dataset_search_test.exs | 4 ++-- .../live_views/followed_datasets_live_test.exs | 2 +- 10 files changed, 10 insertions(+), 24 deletions(-) diff --git a/apps/transport/lib/db/dataset.ex b/apps/transport/lib/db/dataset.ex index 02ad3a5d8f..75a6731c67 100644 --- a/apps/transport/lib/db/dataset.ex +++ b/apps/transport/lib/db/dataset.ex @@ -154,7 +154,7 @@ defmodule DB.Dataset do @spec type_to_str_map() :: %{binary() => binary()} def type_to_str_map, do: %{ - "public-transit" => dgettext("db-dataset", "Public transit - static schedules"), + "public-transit" => dgettext("db-dataset", "Public transit"), "carpooling-areas" => dgettext("db-dataset", "Carpooling areas"), "carpooling-lines" => dgettext("db-dataset", "Carpooling lines"), "carpooling-offers" => dgettext("db-dataset", "Carpooling offers"), diff --git a/apps/transport/lib/transport_web/templates/dataset/details.html.heex b/apps/transport/lib/transport_web/templates/dataset/details.html.heex index accdd4cbe0..686432d3a2 100644 --- a/apps/transport/lib/transport_web/templates/dataset/details.html.heex +++ b/apps/transport/lib/transport_web/templates/dataset/details.html.heex @@ -271,14 +271,6 @@ text: Dataset.type_to_str(@dataset.type), icon: icon_type_path(@dataset) ) %> - <%= if real_time_public_transit?(@dataset) do %> - <%= render("_dataset_type.html", - conn: @conn, - link: dataset_path(@conn, :index, type: "public-transit", filter: "has_realtime"), - text: dgettext("page-index", "Public transport - realtime traffic"), - icon: icon_type_path("real-time-public-transit") - ) %> - <% end %>
<%= render("_licence.html", conn: @conn, dataset: @dataset) %> diff --git a/apps/transport/lib/transport_web/views/dataset_view.ex b/apps/transport/lib/transport_web/views/dataset_view.ex index ecf07a04db..4614bdd04c 100644 --- a/apps/transport/lib/transport_web/views/dataset_view.ex +++ b/apps/transport/lib/transport_web/views/dataset_view.ex @@ -367,12 +367,6 @@ defmodule TransportWeb.DatasetView do |> Enum.filter(&Resource.documentation?/1) end - def real_time_public_transit?(%Dataset{type: "public-transit"} = dataset) do - not Enum.empty?(real_time_official_resources(dataset)) - end - - def real_time_public_transit?(%Dataset{}), do: false - def community_resources(dataset), do: Dataset.community_resources(dataset) def licence_url(licence) when licence in ["fr-lo", "lov2"], diff --git a/apps/transport/priv/gettext/db-dataset.pot b/apps/transport/priv/gettext/db-dataset.pot index 5fbb0754fc..38a0347f40 100644 --- a/apps/transport/priv/gettext/db-dataset.pot +++ b/apps/transport/priv/gettext/db-dataset.pot @@ -75,7 +75,7 @@ msgid "Charging & refuelling stations" msgstr "" #, elixir-autogen, elixir-format -msgid "Public transit - static schedules" +msgid "Public transit" msgstr "" #, elixir-autogen, elixir-format diff --git a/apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po b/apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po index fe4d7b66cc..4e092e1180 100644 --- a/apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po +++ b/apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po @@ -76,7 +76,7 @@ msgid "Charging & refuelling stations" msgstr "" #, elixir-autogen, elixir-format, fuzzy -msgid "Public transit - static schedules" +msgid "Public transit" msgstr "" #, elixir-autogen, elixir-format diff --git a/apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po b/apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po index bc96cfb20f..f605986ae6 100644 --- a/apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po +++ b/apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po @@ -76,8 +76,8 @@ msgid "Charging & refuelling stations" msgstr "Stations de réapprovisionnement de véhicules" #, elixir-autogen, elixir-format, fuzzy -msgid "Public transit - static schedules" -msgstr "Transport public collectif - horaires théoriques" +msgid "Public transit" +msgstr "Transport public collectif" #, elixir-autogen, elixir-format msgid "Road data" diff --git a/apps/transport/test/transport/data_checker_test.exs b/apps/transport/test/transport/data_checker_test.exs index 44b9be7ced..509c0f3143 100644 --- a/apps/transport/test/transport/data_checker_test.exs +++ b/apps/transport/test/transport/data_checker_test.exs @@ -340,7 +340,7 @@ defmodule Transport.DataCheckerTest do subject: "Nouveaux jeux de données référencés", text_body: nil, html_body: - ~r|
  • #{dataset.custom_title} - \(Transport public collectif - horaires théoriques\)
  • | + ~r|
  • #{dataset.custom_title} - \(Transport public collectif\)
  • | ) assert [ diff --git a/apps/transport/test/transport_web/controllers/dataset_controller_test.exs b/apps/transport/test/transport_web/controllers/dataset_controller_test.exs index f84498b915..c57436d36e 100644 --- a/apps/transport/test/transport_web/controllers/dataset_controller_test.exs +++ b/apps/transport/test/transport_web/controllers/dataset_controller_test.exs @@ -850,7 +850,7 @@ defmodule TransportWeb.DatasetControllerTest do test "dataset-page-title", %{conn: conn} do [ - {%{"type" => "public-transit"}, "Transport public collectif - horaires théoriques"}, + {%{"type" => "public-transit"}, "Transport public collectif"}, {%{"type" => "public-transit", "filter" => "has_realtime"}, "Transport public collectif - horaires temps réel"}, {%{"modes" => ["rail"]}, "Transport ferroviaire"} ] diff --git a/apps/transport/test/transport_web/controllers/dataset_search_test.exs b/apps/transport/test/transport_web/controllers/dataset_search_test.exs index 29fdd8b474..7c3d8c0349 100644 --- a/apps/transport/test/transport_web/controllers/dataset_search_test.exs +++ b/apps/transport/test/transport_web/controllers/dataset_search_test.exs @@ -62,7 +62,7 @@ defmodule TransportWeb.DatasetSearchControllerTest do test "GET /datasets filter", %{conn: conn} do conn = conn |> get(dataset_path(conn, :index)) # info dans les filtres à gauche des datasets - assert html_response(conn, 200) =~ "Transport public collectif - horaires théoriques (2)" + assert html_response(conn, 200) =~ "Transport public collectif (2)" end describe "list datasets" do @@ -156,7 +156,7 @@ defmodule TransportWeb.DatasetSearchControllerTest do test "GET /datasets?type=public-transit&licence=odc-odbl", %{conn: conn} do conn = conn |> get(dataset_path(conn, :index), %{type: "public-transit", licence: "odc-odbl"}) - assert html_response(conn, 200) =~ "Transport public collectif - horaires théoriques (1)" + assert html_response(conn, 200) =~ "Transport public collectif (1)" assert html_response(conn, 200) =~ "Horaires Angers" refute html_response(conn, 200) =~ "Horaires Laval" diff --git a/apps/transport/test/transport_web/live_views/followed_datasets_live_test.exs b/apps/transport/test/transport_web/live_views/followed_datasets_live_test.exs index 023e8f7fe1..8ec358c8ab 100644 --- a/apps/transport/test/transport_web/live_views/followed_datasets_live_test.exs +++ b/apps/transport/test/transport_web/live_views/followed_datasets_live_test.exs @@ -27,7 +27,7 @@ defmodule TransportWeb.Live.FollowedDatasetsLiveTest do {"select", [{"id", "type"}, {"name", "type"}], [ {"option", [{"selected", "selected"}, {"value", ""}], ["Tout"]}, - {"option", [{"value", "public-transit"}], ["Transport public collectif - horaires théoriques"]}, + {"option", [{"value", "public-transit"}], ["Transport public collectif"]}, {"option", [{"value", "bike-scooter-sharing"}], ["Vélos et trottinettes en libre-service"]} ]} ] == view |> element("form select") |> render() |> Floki.parse_document!()