aboutsummaryrefslogtreecommitdiff
path: root/web/viewsjs
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-09-14 16:23:29 +0200
committerJochen Topf <jochen@topf.org>2014-09-14 16:23:29 +0200
commitad287a979900246b90637bd46b4961b5de7eb812 (patch)
treedf5eb95b1bed5666c067cdcc7f1274a1ccf29bb7 /web/viewsjs
parentac488e8fa2797b32b75b7e0879ed29547c60b589 (diff)
downloadtaginfo-ad287a979900246b90637bd46b4961b5de7eb812.tar
taginfo-ad287a979900246b90637bd46b4961b5de7eb812.tar.gz
Add projects to relation pages.
Diffstat (limited to 'web/viewsjs')
-rw-r--r--web/viewsjs/relation.js.erb24
1 files changed, 24 insertions, 0 deletions
diff --git a/web/viewsjs/relation.js.erb b/web/viewsjs/relation.js.erb
index f192ffd..ad34fc3 100644
--- a/web/viewsjs/relation.js.erb
+++ b/web/viewsjs/relation.js.erb
@@ -1,6 +1,7 @@
<%
osm = @trans.t.osm
misc = @trans.t.misc
+ taginfo = @trans.t.taginfo
page = @trans.t.pages.relation
%>
var create_flexigrid_for = {
@@ -82,6 +83,29 @@ var create_flexigrid_for = {
};
}
});
+ },
+ projects: function(rtype) {
+ create_flexigrid('grid-projects', {
+ url: '/api/4/relation/projects?rtype=' + encodeURIComponent(rtype),
+ colModel: [
+ { display: '<%= h(taginfo.project) %>', name: 'project_name', width: 280, sortable: true },
+ { display: '<%= h(page.projects.description) %>', name: 'description', width: 600, sortable: false, align: 'left' }
+ ],
+ searchitems: [
+ { display: '<%= h(taginfo.project) %>/<%= h(osm.value) %>', name: 'project_value' }
+ ],
+ sortname: 'project_name',
+ sortorder: 'asc',
+ preProcess: function(data) {
+ data.rows = jQuery.map(data.data, function(row, i) {
+ return { 'cell': [
+ link_to_project(row.project_id, row.project_name, row.project_icon_url),
+ project_tag_desc(row.description, row.icon_url, row.doc_url)
+ ] };
+ });
+ return data;
+ }
+ });
}
};