def type_and_paginated_count(type, pages)
if pages.page_count == 1
- t "browse.changeset.#{type}",
+ t ".#{type.pluralize}",
:count => pages.item_count
else
- t "browse.changeset.#{type}_paginated",
+ t ".#{type.pluralize}_paginated",
:x => pages.current_page.first_item,
:y => pages.current_page.last_item,
:count => pages.item_count
coordinates_html: "%{latitude}, %{longitude}"
changeset:
belongs_to: "Author"
- node: "Nodes (%{count})"
- node_paginated: "Nodes (%{x}-%{y} of %{count})"
- way: "Ways (%{count})"
- way_paginated: "Ways (%{x}-%{y} of %{count})"
- relation: "Relations (%{count})"
- relation_paginated: "Relations (%{x}-%{y} of %{count})"
node:
title_html: "Node: %{name}"
history_title_html: "Node History: %{name}"
hidden_comment_by_html: "Hidden comment from %{user} %{time_ago}"
changesetxml: "Changeset XML"
osmchangexml: "osmChange XML"
+ paging_nav:
+ nodes: "Nodes (%{count})"
+ nodes_paginated: "Nodes (%{x}-%{y} of %{count})"
+ ways: "Ways (%{count})"
+ ways_paginated: "Ways (%{x}-%{y} of %{count})"
+ relations: "Relations (%{count})"
+ relations_paginated: "Relations (%{x}-%{y} of %{count})"
timeout:
sorry: "Sorry, the list of changesets you requested took too long to retrieve."
changeset_comments:
def test_show_element_links
changeset = create(:changeset)
node = create(:node, :with_history, :changeset => changeset)
+ way = create(:way, :with_history, :changeset => changeset)
+ relation = create(:relation, :with_history, :changeset => changeset)
sidebar_browse_check :changeset_path, changeset.id, "changesets/show"
assert_dom "a[href='#{node_path node}']", :count => 1
assert_dom "a[href='#{old_node_path node, 1}']", :count => 1
+ assert_dom "a[href='#{way_path way}']", :count => 1
+ assert_dom "a[href='#{old_way_path way, 1}']", :count => 1
+ assert_dom "a[href='#{relation_path relation}']", :count => 1
+ assert_dom "a[href='#{old_relation_path relation, 1}']", :count => 1
+ end
+
+ def test_show_paginated_element_links
+ page_size = 20
+ changeset = create(:changeset)
+ nodes = create_list(:node, page_size + 1, :with_history, :changeset => changeset)
+ ways = create_list(:way, page_size + 1, :with_history, :changeset => changeset)
+ relations = create_list(:relation, page_size + 1, :with_history, :changeset => changeset)
+
+ sidebar_browse_check :changeset_path, changeset.id, "changesets/show"
+ page_size.times do |i|
+ assert_dom "a[href='#{node_path nodes[i]}']", :count => 1
+ assert_dom "a[href='#{old_node_path nodes[i], 1}']", :count => 1
+ assert_dom "a[href='#{way_path ways[i]}']", :count => 1
+ assert_dom "a[href='#{old_way_path ways[i], 1}']", :count => 1
+ assert_dom "a[href='#{relation_path relations[i]}']", :count => 1
+ assert_dom "a[href='#{old_relation_path relations[i], 1}']", :count => 1
+ end
end
##