]> git.openstreetmap.org Git - rails.git/commitdiff
Emphasize trace tags in import emails
authorAnton Khorev <tony29@yandex.ru>
Thu, 11 Jan 2024 15:07:18 +0000 (18:07 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 11 Jan 2024 15:10:40 +0000 (18:10 +0300)
app/views/user_mailer/_gpx_description.html.erb
test/mailers/user_mailer_test.rb

index 42998213693f4cbdc3b5f1df0211fa07a0b02907..85b4c7cae1c0e9f198a69d75128e722f42a09dac 100644 (file)
@@ -2,7 +2,7 @@
 <% trace_name = link_to(trace_name, @trace_url) if @trace_url %>
 <% trace_description = tag.em(@trace_description) %>
 <% if @trace_tags.length > 0 %>
-  <% tags = @trace_tags.map(&:tag).join(" ") %>
+  <% tags = safe_join @trace_tags.map { |trace_tag| tag.em trace_tag.tag }, ", " %>
   <%= t ".description_with_tags_html", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %>
 <% else %>
   <%= t ".description_with_no_tags_html", :trace_name => trace_name, :trace_description => trace_description %>
index 6df86c15e64b50aeb6ae391cf17a06558baac8bc..751adcd82dc361583bf4e8ea7ca4ad8a8d3ac8f9 100644 (file)
@@ -15,7 +15,7 @@ class UserMailerTest < ActionMailer::TestCase
     end
     email = UserMailer.gpx_success(trace, 100)
 
-    assert_match(/one two three/, email.html_part.body.to_s)
+    assert_match("<em>one</em>, <em>two</em>, <em>three</em>", email.html_part.body.to_s)
   end
 
   def test_gpx_success_all_traces_link