]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/browse/_relation_member.html.erb
Avoid integer overflow when computing shortcodes
[rails.git] / app / views / browse / _relation_member.html.erb
index ead58490cd6f014e53efcfe30956626e36dd1236..b797081da679d71e7f49233e7df91c4f9f9d69b3 100644 (file)
@@ -1,10 +1,14 @@
+<%
+  member_class = link_class(relation_member.member_type.downcase, relation_member.member)
+  linked_name = link_to h(printable_name(relation_member.member)), { :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, :title => link_title(relation_member.member)
+  type_str = t'browse.relation_member.type.' + relation_member.member_type.downcase 
+%>
 <tr>
-  <td>
-    <%= t 'activerecord.models.'+relation_member.member_type.downcase %>
-    <%= link_to h(printable_name(relation_member.member)), :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s %>
-    <% unless relation_member.member_role.blank? %>
-      <%= t'browse.relation_member.as' %>
-      <%= h(relation_member.member_role) %>
-    <% end %>
-  </td>
+  <td class="<%= member_class %>"><%=
+    if relation_member.member_role.blank?
+      t'browse.relation_member.entry', :type => type_str, :name => linked_name
+    else
+      t'browse.relation_member.entry_role', :type => type_str, :name => linked_name, :role => h(relation_member.member_role)
+    end
+  %></td>
 </tr>