diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-18 09:12:46 -0800 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-18 09:12:46 -0800 |
commit | 95eabe7a9f66c49c164115502e4073adb08cd864 (patch) | |
tree | 7041725d3f95dbe7885923af82107a0bd093c58f | |
parent | c5428074f4380471e2da6f17c6f7a2375f262bca (diff) | |
parent | 055dc3a28428fb6914f02bab35933a4cea614731 (diff) | |
download | taginfo-95eabe7a9f66c49c164115502e4073adb08cd864.tar taginfo-95eabe7a9f66c49c164115502e4073adb08cd864.tar.gz |
Merge pull request #13 from IrlJidel/master
Use rtype as param for api/4/relation/roles call
-rw-r--r-- | web/lib/api/v4/relation.rb | 6 | ||||
-rw-r--r-- | web/viewsjs/relation.js.erb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/web/lib/api/v4/relation.rb b/web/lib/api/v4/relation.rb index 4982f07..73c5a15 100644 --- a/web/lib/api/v4/relation.rb +++ b/web/lib/api/v4/relation.rb @@ -5,7 +5,7 @@ class Taginfo < Sinatra::Base api(4, 'relation/roles', { :description => 'Member role statistics for a relation of given type.', :parameters => { - :type => 'Relation type (required).', + :rtype => 'Relation type (required).', :query => 'Only show results where the role matches this query (substring match, optional).' }, :paging => :optional, @@ -22,10 +22,10 @@ class Taginfo < Sinatra::Base [:count_relation_members, :INT, 'Number of members of type relation with this role.'], [:count_relation_members_fraction, :FLOAT, 'Number of members of type relation with this role devided by all members of type relation.'] ]), - :example => { :role => 'multipolygon', :page => 1, :rp => 10 }, + :example => { :rtype => 'multipolygon', :page => 1, :rp => 10 }, :ui => '/reports/relation_types#roles' }) do - rtype = params[:type] + rtype = params[:rtype] relation_type_info = @db.select('SELECT * FROM relation_types'). condition("rtype=?", rtype). diff --git a/web/viewsjs/relation.js.erb b/web/viewsjs/relation.js.erb index 6c4ad7e..eb4ff9d 100644 --- a/web/viewsjs/relation.js.erb +++ b/web/viewsjs/relation.js.erb @@ -28,7 +28,7 @@ var create_flexigrid_for = { }, roles: function(rtype) { create_flexigrid('grid-roles', { - url: '/api/4/relation/roles?type=' + encodeURIComponent(rtype), + url: '/api/4/relation/roles?rtype=' + encodeURIComponent(rtype), colModel: [ { display: '<%= osm.relation_member_role %>', name: 'role', width: 250, sortable: true }, { display: '<span title="<%= page.roles.objects_tooltip %>"><img src="/img/types/all.16.png" width="16" height="16" alt=""/> <%= osm.relation_members %></span>', name: 'count_all_members', width: 250, sortable: true, align: 'center' }, |