summaryrefslogtreecommitdiff
path: root/web/viewsjs/project.js.erb
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-08-21 14:38:23 +0200
committerJochen Topf <jochen@topf.org>2014-08-21 14:38:23 +0200
commit960a39f5937a50b4d999a3fc5e7465412eb377a0 (patch)
treeafd6af6c77f8f30e862ed80c3f2b3279d577e9f0 /web/viewsjs/project.js.erb
parentcd12010108e17dfab6ebf6f2902663430505bcfe (diff)
downloadtaginfo-960a39f5937a50b4d999a3fc5e7465412eb377a0.tar
taginfo-960a39f5937a50b4d999a3fc5e7465412eb377a0.tar.gz
Add new 'projects' source.
Any kind of project using OSM tags can create a json-formatted taginfo project file and after its URL is added to the taginfo config, taginfo will integrate this data into its database.
Diffstat (limited to 'web/viewsjs/project.js.erb')
-rw-r--r--web/viewsjs/project.js.erb35
1 files changed, 35 insertions, 0 deletions
diff --git a/web/viewsjs/project.js.erb b/web/viewsjs/project.js.erb
new file mode 100644
index 0000000..59af6dd
--- /dev/null
+++ b/web/viewsjs/project.js.erb
@@ -0,0 +1,35 @@
+<%
+ osm = @trans.t.osm
+ misc = @trans.t.misc
+ %>
+var create_flexigrid_for = {
+ tags: function(project) {
+ create_flexigrid('grid-tags', {
+ url: '/api/4/project/tags?project=' + encodeURIComponent(project),
+ colModel: [
+ { display: '<%= h(osm.tag) %>', name: 'tag', width: 260, sortable: true },
+ { display: '<%= h(misc.description) %>', name: 'description', width: 800, sortable: false, align: 'left' }
+ ],
+ searchitems: [
+ { display: '<%= h(osm.key) %>/<%= h(osm.value) %>', name: 'key_value' }
+ ],
+ sortname: 'tag',
+ sortorder: 'asc',
+ preProcess: function(data) {
+ data.rows = jQuery.map(data.data, function(row, i) {
+ return { 'cell': [
+ row.value ? link_to_tag(row.key, row.value) : (link_to_key(row.key) + '=*'),
+ project_tag_desc(row.description, row.doc_url, row.icon_url)
+ ] };
+ });
+ delete data.data;
+ return data;
+ }
+ });
+ }
+};
+
+function page_init() {
+ up = function() { window.location = '/projects'; }
+ page_init2();
+}