From: mmd-osm Date: Wed, 31 Jul 2024 17:12:19 +0000 (+0200) Subject: GPX Import email in text format X-Git-Tag: live~381^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2d3988e38f6c05d2e433fae3af2382b62e66e290 GPX Import email in text format Fixes #5025 --- diff --git a/app/views/user_mailer/_gpx_description.text.erb b/app/views/user_mailer/_gpx_description.text.erb new file mode 100644 index 000000000..6f7a97844 --- /dev/null +++ b/app/views/user_mailer/_gpx_description.text.erb @@ -0,0 +1,8 @@ +<% trace_name = @trace_name %> +<% trace_description = @trace_description %> +<% if @trace_tags.length > 0 %> + <% tags = @trace_tags.map { |trace_tag| trace_tag.tag }.join(", ") %> + <%= t ".description_with_tags", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %> +<% else %> + <%= t ".description_with_no_tags", :trace_name => trace_name, :trace_description => trace_description %> +<% end %> diff --git a/app/views/user_mailer/gpx_failure.text.erb b/app/views/user_mailer/gpx_failure.text.erb new file mode 100644 index 000000000..9544c74a9 --- /dev/null +++ b/app/views/user_mailer/gpx_failure.text.erb @@ -0,0 +1,10 @@ +<%= t ".hi", :to_user => @to_user %> + +<%= render :partial => "gpx_description" %> +<%= t ".failed_to_import" %> + +== +<%= @error %> +== + +<%= t ".more_info", :url => t(".import_failures_url") %> diff --git a/app/views/user_mailer/gpx_success.text.erb b/app/views/user_mailer/gpx_success.text.erb new file mode 100644 index 000000000..aee3a0f11 --- /dev/null +++ b/app/views/user_mailer/gpx_success.text.erb @@ -0,0 +1,8 @@ +<%= t ".hi", :to_user => @to_user %> + +<%= render :partial => "gpx_description" %> +<%= t(".loaded", :trace_points => @trace_points, :count => @possible_points) %> + +<%= t ".trace_location", :trace_url => @trace_url %> + +<%= t ".all_your_traces", :url => @my_traces_url %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 3f2e8a93b..278edf364 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1626,11 +1626,14 @@ en: befriend_them: "You can also add them as a friend at %{befriendurl}." befriend_them_html: "You can also add them as a friend at %{befriendurl}." gpx_description: + description_with_tags: "It looks like your GPX file %{trace_name} with the description %{trace_description} and the following tags: %{tags}" description_with_tags_html: "It looks like your GPX file %{trace_name} with the description %{trace_description} and the following tags: %{tags}" + description_with_no_tags: "It looks like your GPX file %{trace_name} with the description %{trace_description} and no tags" description_with_no_tags_html: "It looks like your GPX file %{trace_name} with the description %{trace_description} and no tags" gpx_failure: hi: "Hi %{to_user}," failed_to_import: "failed to import. Here is the error:" + more_info: "More information about GPX import failures and how to avoid them can be found at %{url}." more_info_html: "More information about GPX import failures and how to avoid them can be found at %{url}." import_failures_url: "https://wiki.openstreetmap.org/wiki/GPX_Import_Failures" subject: "[OpenStreetMap] GPX Import failure" @@ -1639,6 +1642,8 @@ en: loaded: one: "loaded successfully with %{trace_points} out of a possible %{count} point." other: "loaded successfully with %{trace_points} out of a possible %{count} points." + trace_location: "Your trace is available at %{trace_url}" + all_your_traces: "All your successfully uploaded GPX traces can be found at %{url}" all_your_traces_html: "All your successfully uploaded GPX traces can be found at %{url}." subject: "[OpenStreetMap] GPX Import success" signup_confirm: