module BrowseHelper
def element_single_current_link(type, object, url)
- link_to url, { :class => element_class(type, object), :title => link_title(object), :rel => (link_follow(object) if type == "node") } do
+ link_to url, { :class => element_class(type, object), :title => element_title(object), :rel => (link_follow(object) if type == "node") } do
element_strikethrough object do
printable_name object
end
end
def element_list_item(type, object, &block)
- tag.li :class => element_class(type, object) do
+ tag.li :class => element_class(type, object), :title => element_title(object) do
element_strikethrough object, &block
end
end
classes.join(" ")
end
- def link_title(object)
+ def element_title(object)
if object.redacted?
""
else
-<% linked_name = link_to printable_name(relation_member.member), { :controller => :browse, :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, { :title => link_title(relation_member.member), :rel => link_follow(relation_member.member) }
+<% linked_name = link_to printable_name(relation_member.member), { :controller => :browse, :action => relation_member.member_type.downcase, :id => relation_member.member_id.to_s }, { :rel => link_follow(relation_member.member) }
type_str = t ".type.#{relation_member.member_type.downcase}" %>
<%= element_list_item relation_member.member_type.downcase, relation_member.member do %>
<%= if relation_member.member_role.blank?
<ul class="list-unstyled">
<% @ways.each do |way| %>
<%= element_list_item "way", way do %>
- <%= link_to printable_name(way, :version => true), { :action => "way", :id => way.way_id.to_s }, { :title => link_title(way) } %>
+ <%= link_to printable_name(way, :version => true), { :action => "way", :id => way.way_id.to_s } %>
<% end %>
<% end %>
</ul>
<ul class="list-unstyled">
<% @relations.each do |relation| %>
<%= element_list_item "relation", relation do %>
- <%= link_to printable_name(relation, :version => true), { :action => "relation", :id => relation.relation_id.to_s }, { :title => link_title(relation) } %>
+ <%= link_to printable_name(relation, :version => true), { :action => "relation", :id => relation.relation_id.to_s } %>
<% end %>
<% end %>
</ul>
<ul class="list-unstyled">
<% @nodes.each do |node| %>
<%= element_list_item "node", node do %>
- <%= link_to printable_name(node, :version => true), { :action => "node", :id => node.node_id.to_s }, { :title => link_title(node), :rel => link_follow(node) } %>
+ <%= link_to printable_name(node, :version => true), { :action => "node", :id => node.node_id.to_s }, { :rel => link_follow(node) } %>
<% end %>
<% end %>
</ul>
assert_equal "node", element_class("node", node_v1)
end
- def test_link_title
+ def test_element_title
node = create(:node, :with_history, :version => 2)
node_v1 = node.old_nodes.find_by(:version => 1)
node_v2 = node.old_nodes.find_by(:version => 2)
add_old_tags_selection(node_v2)
add_old_tags_selection(node_v1)
- assert_equal "", link_title(create(:node))
- assert_equal "", link_title(create(:node, :deleted))
+ assert_equal "", element_title(create(:node))
+ assert_equal "", element_title(create(:node, :deleted))
- assert_equal "building=yes, shop=gift, and tourism=museum", link_title(node)
- assert_equal "building=yes, shop=gift, and tourism=museum", link_title(node_v2)
- assert_equal "", link_title(node_v1)
+ assert_equal "building=yes, shop=gift, and tourism=museum", element_title(node)
+ assert_equal "building=yes, shop=gift, and tourism=museum", element_title(node_v2)
+ assert_equal "", element_title(node_v1)
end
def test_icon_tags