diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-20 18:01:35 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-20 18:01:35 +0100 |
commit | fe22edeccef4ba8b4b0c78448bbfc292a947a35e (patch) | |
tree | 4ebd00fd8536fa9e3d7ce26b66bf634682d1dcaf | |
parent | 29bf3235f82be1f33f349fdf2f491120fea4a533 (diff) | |
download | taginfo-fe22edeccef4ba8b4b0c78448bbfc292a947a35e.tar taginfo-fe22edeccef4ba8b4b0c78448bbfc292a947a35e.tar.gz |
If no roles data is available, don't try to create chart.
-rw-r--r-- | web/views/relation.erb | 4 | ||||
-rw-r--r-- | web/viewsjs/relation.js.erb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/web/views/relation.erb b/web/views/relation.erb index 0ed3dd9..089100c 100644 --- a/web/views/relation.erb +++ b/web/views/relation.erb @@ -39,8 +39,12 @@ </div> <div id="graph"> <h2><%= t.pages.relation.graph.title %></h2> +<% if @count_relation_roles > 0 %> <div class="canvas"> </div> +<% else %> + <p class="empty"><%= t.pages.relation.roles.no_roles_info %></p> +<% end %> </div> <div id="wiki"> <h2><%= t.pages.relation.wiki_pages.title %></h2> diff --git a/web/viewsjs/relation.js.erb b/web/viewsjs/relation.js.erb index c2e003b..4e9544a 100644 --- a/web/viewsjs/relation.js.erb +++ b/web/viewsjs/relation.js.erb @@ -87,6 +87,10 @@ var create_flexigrid_for = { // Marimekko chart based on http://bl.ocks.org/1005090 function create_role_chart(data) { + if (data.length == 0) { + return; + } + var width = 800, height = 360, margin = 20; |