Skip to content

Commit

Permalink
Un peu de nettoyage
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitfred committed Feb 26, 2025
1 parent 428a692 commit 816c9b0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@

<.analysis_step :if={@current_step == :analysis} diff_logs={assigns[:diff_logs]} error_msg={assigns[:error_msg]} />

<.results_step :if={@current_step == :results} results={assigns[:results]} error_msg={assigns[:error_msg]} profile={@profile} />
<.results_step
:if={@current_step == :results}
results={assigns[:results]}
error_msg={assigns[:error_msg]}
profile={@profile}
/>
</section>

<script defer type="text/javascript" src={static_path(@socket, "/js/app.js")}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule TransportWeb.Live.GTFSDiffSelectLive.Results do
gtfs_original_file_name_1: _,
gtfs_original_file_name_2: _,
profile: _,
selected_file: _,
selected_file: _
} = assigns
) do
~H"""
Expand Down Expand Up @@ -150,7 +150,9 @@ defmodule TransportWeb.Live.GTFSDiffSelectLive.Results do
"""
end

defp diff_summaries(%{files_with_changes: _, selected_file: _, diff_summary: _, diff_explanations: _, profile: _} = assigns) do
defp diff_summaries(
%{files_with_changes: _, selected_file: _, diff_summary: _, diff_explanations: _, profile: _} = assigns
) do
~H"""
<div class="pt-24">
<div class="dashboard">
Expand Down Expand Up @@ -221,7 +223,7 @@ defmodule TransportWeb.Live.GTFSDiffSelectLive.Results do
) %>
</p>
<ul>
<li :for={filename <- Transport.GTFSDiff.files_to_analyze("core")} filename={filename}>
<li :for={filename <- Transport.GTFSDiff.files_to_analyze("core")}>
<code><%= filename %></code>
</li>
</ul>
Expand All @@ -232,26 +234,28 @@ defmodule TransportWeb.Live.GTFSDiffSelectLive.Results do
defp differencies(%{diff_summary: _, selected_file: _, diff_explanations: _} = assigns) do
~H"""
<div class="main">
<p><%= dgettext("validations", "Differences Overview") %></p>
<h4><%= dgettext("validations", "Summary") %></h4>
<.diff_summaries_for_file diff_summary={@diff_summary} selected_file={@selected_file} />
<%= if assigns[:diff_explanations] do %>
<% active_explanations =
@diff_explanations
|> Enum.filter(fn {file, _} -> file == @selected_file end)
|> Enum.map(fn {_, explanation} -> explanation end) %>
<p :if={not Enum.empty?(active_explanations)}><%= dgettext("validations", "Detail") %></p>
<ul>
<%= for explanation <- active_explanations do %>
<li>
<%= explanation %>
</li>
<% end %>
</ul>
<.detailed_explanations :if={not Enum.empty?(active_explanations)} active_explanations={active_explanations} />
<% end %>
</div>
"""
end

defp detailed_explanations(%{active_explanations: _} = assigns) do
~H"""
<h4><%= dgettext("validations", "Detail") %></h4>
<ul>
<li :for={explanation <- @active_explanations}><%= explanation %></li>
</ul>
"""
end

defp similar_files(file1, file2) do
dgettext(
"validations",
Expand Down
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/en/LC_MESSAGES/validations.po
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,6 @@ msgstr ""
msgid "Previous validations"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Differences Overview"
msgstr ""

#, elixir-autogen, elixir-format, fuzzy
msgid "Drop your GTFS files here or click to browse your local drive"
msgstr ""
Expand Down Expand Up @@ -555,3 +551,7 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Looking for other files?"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Summary"
msgstr ""
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/fr/LC_MESSAGES/validations.po
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,6 @@ msgstr "Nombre d'occurences"
msgid "Previous validations"
msgstr "Validations précédentes"

#, elixir-autogen, elixir-format
msgid "Differences Overview"
msgstr "Résumé"

#, elixir-autogen, elixir-format, fuzzy
msgid "Drop your GTFS files here or click to browse your local drive"
msgstr "Glissez des fichiers GTFS ici ou cliquez pour parcourir vos répertoires locaux"
Expand Down Expand Up @@ -555,3 +551,7 @@ msgstr "Autres fichiers…"
#, elixir-autogen, elixir-format
msgid "Looking for other files?"
msgstr "À la recherche d’autres fichiers ?"

#, elixir-autogen, elixir-format
msgid "Summary"
msgstr "Résumé"
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/validations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ msgstr ""
msgid "Previous validations"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Differences Overview"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Drop your GTFS files here or click to browse your local drive"
msgstr ""
Expand Down Expand Up @@ -553,3 +549,7 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Looking for other files?"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Summary"
msgstr ""

0 comments on commit 816c9b0

Please sign in to comment.