diff --git a/web/i18n/en.yml b/web/i18n/en.yml index dfabf9fc..f0b9ab28 100644 --- a/web/i18n/en.yml +++ b/web/i18n/en.yml @@ -228,6 +228,7 @@ pages: nodes_tooltip: Relation members of type node with this role (and as percentage of all members of type node) for this relation type. ways_tooltip: Relation members of type way with this role (and as percentage of all members of type way) for this relation type. relations_tooltip: Relation members of type relation with this role (and as percentage of all members of type relation) for this relation type. + no_roles_info: There is no information about roles for this relation type (most likely because there are only very few of those relations). flexigrid: pagetext: Page diff --git a/web/lib/ui/relation.rb b/web/lib/ui/relation.rb index ab3bc8f0..1a3a0540 100644 --- a/web/lib/ui/relation.rb +++ b/web/lib/ui/relation.rb @@ -13,6 +13,10 @@ class Taginfo < Sinatra::Base @desc = 'XXX' + @count_relation_roles = @db.count('relation_roles'). + condition("rtype=?", rtype). + get_first_value().to_i + javascript "#{ r18n.locale.code }/relation" erb :relation end diff --git a/web/views/relation.erb b/web/views/relation.erb index e2e60bce..19dcc9f6 100644 --- a/web/views/relation.erb +++ b/web/views/relation.erb @@ -12,8 +12,12 @@

<%= t.pages.relation.roles.title %>

+<% if @count_relation_roles > 0 %>
+<% else %> +

<%= t.pages.relation.roles.no_roles_info %>

+<% end %>
<% javascript do