# away redacted version tag information.
unless object.redacted?
if object.tags.include? "name:#{I18n.locale}"
- name = t 'printable_name.with_name', :name => object.tags["name:#{I18n.locale}"].to_s, :id => name
+ name = t 'printable_name.with_name_html', :name => content_tag(:bdi, object.tags["name:#{I18n.locale}"].to_s ), :id => name
elsif object.tags.include? 'name'
- name = t 'printable_name.with_name', :name => object.tags['name'].to_s, :id => name
+ name = t 'printable_name.with_name_html', :name => content_tag(:bdi, object.tags['name'].to_s ), :id => name
end
end
- return name
+ name
end
def link_class(type, object)
<h4><%= t 'browse.part_of' %></h4>
<ul>
<% node.ways.uniq.each do |way| %>
- <li><%= link_to h(printable_name(way)), { :action => "way", :id => way.id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
+ <li><%= link_to printable_name(way), { :action => "way", :id => way.id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
<% end %>
<%= render :partial => "containing_relation", :collection => node.containing_relation_members.uniq %>
</ul>
<%
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)
+ linked_name = link_to 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
%>
<li class="<%= member_class %>"><%=
else
raw t'browse.relation_member.entry_role', :type => type_str, :name => linked_name, :role => h(relation_member.member_role)
end
- %></li>
\ No newline at end of file
+ %></li>
<ul>
<% way.way_nodes.each do |wn| %>
<li>
- <%= link_to h(printable_name(wn.node)), { :action => "node", :id => wn.node_id.to_s }, :class => link_class('node', wn.node), :title => link_title(wn.node) %>
+ <%= link_to printable_name(wn.node), { :action => "node", :id => wn.node_id.to_s }, :class => link_class('node', wn.node), :title => link_title(wn.node) %>
<% related_ways = wn.node.ways.reject { |w| w.id == wn.way_id } %>
<% if related_ways.size > 0 then %>
- (<%= raw t 'browse.way.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(h(printable_name(w)), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
+ (<%= raw t 'browse.way.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(printable_name(w), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
<% end %>
</li>
<% end %>
</h4>
<ul>
<% @ways.each do |way| %>
- <li><%= link_to h(printable_name(way, true)), { :action => "way", :id => way.way_id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
+ <li><%= link_to printable_name(way, true), { :action => "way", :id => way.way_id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
<% end %>
</ul>
<% end %>
</h4>
<ul>
<% @relations.each do |relation| %>
- <li><%= link_to h(printable_name(relation, true)), { :action => "relation", :id => relation.relation_id.to_s }, :class => link_class('relation', relation), :title => link_title(relation) %></li>
+ <li><%= link_to printable_name(relation, true), { :action => "relation", :id => relation.relation_id.to_s }, :class => link_class('relation', relation), :title => link_title(relation) %></li>
<% end %>
</ul>
<% end %>
</h4>
<ul>
<% @nodes.each do |node| %>
- <li><%= link_to h(printable_name(node, true)), { :action => "node", :id => node.node_id.to_s }, :class => link_class('node', node), :title => link_title(node) %></li>
+ <li><%= link_to printable_name(node, true), { :action => "node", :id => node.node_id.to_s }, :class => link_class('node', node), :title => link_title(node) %></li>
<% end %>
</ul>
<% end %>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
- <%= t("browse.#{@type}.title", :name => printable_name(@feature)) %>
+ <%= raw t("browse.#{@type}.title", :name => printable_name(@feature)) %>
</h2>
<%= render :partial => @type, :object => @feature %>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
- <%= t("browse.#{@type}.history_title", :name => printable_name(@feature)) %>
+ <%= raw t("browse.#{@type}.history_title", :name => printable_name(@feature)) %>
</h2>
<%= render :partial => @type, :collection => @feature.send("old_#{@type}s").reverse %>
printable_name:
with_id: "%{id}"
with_version: "%{id}, v%{version}"
- with_name: "%{name} (%{id})"
+ with_name_html: "%{name} (%{id})"
editor:
default: "Default (currently %{name})"
potlatch:
def test_printable_name
assert_equal "17", printable_name(current_nodes(:redacted_node))
- assert_equal "Test Node (18)", printable_name(current_nodes(:node_with_name))
- assert_equal "Test Node (18)", printable_name(nodes(:node_with_name_current_version))
+ assert_equal "<bdi>Test Node</bdi> (18)", printable_name(current_nodes(:node_with_name))
+ assert_equal "<bdi>Test Node</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
- assert_equal "Test Node (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+ assert_equal "<bdi>Test Node</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
I18n.locale = "ru"
assert_equal "17", printable_name(current_nodes(:redacted_node))
- assert_equal "проверки узла (18)", printable_name(current_nodes(:node_with_name))
- assert_equal "проверки узла (18)", printable_name(nodes(:node_with_name_current_version))
+ assert_equal "<bdi>проверки узла</bdi> (18)", printable_name(current_nodes(:node_with_name))
+ assert_equal "<bdi>проверки узла</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
- assert_equal "проверки узла (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+ assert_equal "<bdi>проверки узла</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
I18n.locale = "de"
assert_equal "17", printable_name(current_nodes(:redacted_node))
- assert_equal "Test Node (18)", printable_name(current_nodes(:node_with_name))
- assert_equal "Test Node (18)", printable_name(nodes(:node_with_name_current_version))
+ assert_equal "<bdi>Test Node</bdi> (18)", printable_name(current_nodes(:node_with_name))
+ assert_equal "<bdi>Test Node</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
- assert_equal "Test Node (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+ assert_equal "<bdi>Test Node</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
end