Refactor trace guidance to avoid raw html in translations

Also rearrange to avoid multiple sentences in a heading.
This commit is contained in:
Andy Allan 2023-02-08 14:33:46 +00:00
parent 317b1871f4
commit 10e035df93
3 changed files with 9 additions and 3 deletions

View file

@ -76,5 +76,7 @@
<%= render "trace_paging_nav", :page => @page, :page_size => @page_size, :traces => @traces, :params => @params %>
<% else %>
<h4><%= t ".empty_html", :upload_link => new_trace_path %></h4>
<h2><%= t ".empty_title" %></h2>
<p><%= t ".empty_upload_html", :upload_link => link_to(t(".upload_new"), new_trace_path),
:wiki_link => link_to(t(".wiki_page"), t(".wiki_page_url")) %></p>
<% end %>

View file

@ -2396,7 +2396,11 @@ en:
public_traces_from: "Public GPS Traces from %{user}"
description: "Browse recent GPS trace uploads"
tagged_with: " tagged with %{tags}"
empty_html: "Nothing here yet. <a href='%{upload_link}'>Upload a new trace</a> or learn more about GPS tracing on the <a href='https://wiki.openstreetmap.org/wiki/Beginners_Guide_1.2'>wiki page</a>."
empty_title: Nothing here yet
empty_upload_html: "%{upload_link} or learn more about GPS tracing on the %{wiki_link}."
upload_new: Upload a new trace
wiki_page: wiki page
wiki_page_url: https://wiki.openstreetmap.org/wiki/Beginners_Guide_1.2
upload_trace: "Upload a trace"
all_traces: "All Traces"
my_traces: "My Traces"

View file

@ -756,7 +756,7 @@ class TracesControllerTest < ActionDispatch::IntegrationTest
assert_template "index"
if traces.empty?
assert_select "h4", /Nothing here yet/
assert_select "h2", /Nothing here yet/
else
assert_select "table#trace_list tbody", :count => 1 do
assert_select "tr", :count => traces.length do |rows|