Skip to content

Commit

Permalink
Supprimer traduction horaires théoriques (#4394)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti authored Dec 19, 2024
1 parent 78a21db commit f9f563d
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/transport/lib/db/dataset.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
</div>
<div class="pt-12">
<%= render("_licence.html", conn: @conn, dataset: @dataset) %>
Expand Down
6 changes: 0 additions & 6 deletions apps/transport/lib/transport_web/views/dataset_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/db-dataset.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/en/LC_MESSAGES/db-dataset.po
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/transport/priv/gettext/fr/LC_MESSAGES/db-dataset.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/test/transport/data_checker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ defmodule Transport.DataCheckerTest do
subject: "Nouveaux jeux de données référencés",
text_body: nil,
html_body:
~r|<li><a href="http://127.0.0.1:5100/datasets/#{dataset.slug}">#{dataset.custom_title}</a> - \(Transport public collectif - horaires théoriques\)</li>|
~r|<li><a href="http://127.0.0.1:5100/datasets/#{dataset.slug}">#{dataset.custom_title}</a> - \(Transport public collectif\)</li>|
)

assert [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
Expand Down

0 comments on commit f9f563d

Please sign in to comment.