Skip to content

Commit

Permalink
Show "no info" message when we don't have infos about roles.
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Jan 14, 2013
1 parent 9f39838 commit e103095
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/i18n/en.yml
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions web/lib/ui/relation.rb
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions web/views/relation.erb
Expand Up @@ -12,8 +12,12 @@
</div>
<div id="roles">
<h2><%= t.pages.relation.roles.title %></h2>
<% if @count_relation_roles > 0 %>
<table id="grid-roles">
</table>
<% else %>
<p class="empty"><%= t.pages.relation.roles.no_roles_info %></p>
<% end %>
</div>
</div>
<% javascript do
Expand Down

0 comments on commit e103095

Please sign in to comment.