diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-20 11:17:59 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-20 11:17:59 +0100 |
commit | ad0df22a8f4b6e2546734f5990ea74bd73329d56 (patch) | |
tree | 0de94ec1625b4e42c4c93f1688771a2fe8a007ec /web/viewsjs | |
parent | eaf29ca05a1b4ea7f61c44e262c17d7c5feb1a0a (diff) | |
download | taginfo-ad0df22a8f4b6e2546734f5990ea74bd73329d56.tar taginfo-ad0df22a8f4b6e2546734f5990ea74bd73329d56.tar.gz |
Add wiki tab to relation page
Diffstat (limited to 'web/viewsjs')
-rw-r--r-- | web/viewsjs/relation.js.erb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/web/viewsjs/relation.js.erb b/web/viewsjs/relation.js.erb index 5d38ffb..c2e003b 100644 --- a/web/viewsjs/relation.js.erb +++ b/web/viewsjs/relation.js.erb @@ -1,5 +1,6 @@ <% osm = @trans.t.osm + misc = @trans.t.misc page = @trans.t.pages.relation %> var create_flexigrid_for = { @@ -54,6 +55,33 @@ var create_flexigrid_for = { return data; } }); + }, + wiki: function(rtype) { + create_flexigrid('grid-wiki', { + url: '/api/4/relation/wiki_pages?rtype=' + encodeURIComponent(rtype), + colModel: [ + { display: '<%= misc.language %>', name: 'lang', width: 150, sortable: false }, + { display: '<%= page.wiki_pages.wiki_page %>', name: 'title', width: 160, sortable: false, align: 'right' }, + { display: '<%= misc.description %>', name: 'description', width: 500, sortable: false }, + { display: '<%= misc.image %>', name: 'image', width: 300, sortable: false } + ], + usepager: false, + useRp: false, + preProcess: function(data) { + return { + total: data.size, + page: 1, + rows: jQuery.map(data, function(row, i) { + return { 'cell': [ + fmt_language(row.lang, row.language, row.language_en), + link_to_wiki(row.title), + row.description, + fmt_wiki_image_popup(row.image) + ]}; + }) + }; + } + }); } }; |