]> git.openstreetmap.org Git - rails.git/commitdiff
Don't linkify comments in the changeset list
authorTom Hughes <tom@compton.nu>
Sun, 8 Dec 2013 13:11:48 +0000 (13:11 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 8 Dec 2013 13:11:48 +0000 (13:11 +0000)
It's confusing to make links in comments active in the changeset list
as the rest of the comment is an active link to the changeset.

We do want to make them active in the changeset view however, so add
linkification to the comment there.

Fixes https://trac.openstreetmap.org/ticket/5061

app/views/browse/changeset.html.erb
app/views/changeset/_changeset.html.erb

index 736abf12fbc44efd23fa708d862ce1cbeda0f3fd..31799f0e9f9e5e592537decb6bfe65e1cc9223ef 100644 (file)
@@ -6,7 +6,7 @@
 </h2>
 
 <div class="browse-section">
-  <h4><%= @changeset.tags['comment'].to_s.presence || t('browse.no_comment') %></h4>
+  <h4><%= linkify(h(@changeset.tags['comment'].to_s.presence || t('browse.no_comment'))) %></h4>
   <div class="details"><%= changeset_details(@changeset) %></div>
 
   <%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>
index 5c5ad670b6c91d4c8cc484dfb51f009723a4efe9..cbc60695b80a137e8d3fbffbe2bd2c06b6d84155 100644 (file)
 <%= content_tag "li", :id => "changeset_#{changeset.id}", :data => {:changeset => changeset_data} do %>
   <h4>
     <a class="changeset_id" href="<%= changeset_path(changeset.id) %>">
-      <% if changeset.tags['comment'].to_s != '' %>
-        <%= linkify(h(changeset.tags['comment'])) %>
-      <% else %>
-        <%= t 'browse.no_comment' %>
-      <% end %>
+      <%= changeset.tags['comment'].to_s.presence || t('browse.no_comment') %>
     </a>
   </h4>
   <div class="details">