aboutsummaryrefslogtreecommitdiff
path: root/web/views
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2015-03-14 11:19:21 +0100
committerJochen Topf <jochen@topf.org>2015-03-14 11:19:21 +0100
commit09c7c596a1cdc045298018af14c2b1e4ea4d6702 (patch)
treeeac337208646281fc5f4b7af6cbfacbc4aa68dd6 /web/views
parent5ee19155669c1248d5ea9a2613cbd2eb5e478b3d (diff)
downloadtaginfo-09c7c596a1cdc045298018af14c2b1e4ea4d6702.tar
taginfo-09c7c596a1cdc045298018af14c2b1e4ea4d6702.tar.gz
Add wiki images report.
Diffstat (limited to 'web/views')
-rw-r--r--web/views/reports/wiki_images.erb26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/views/reports/wiki_images.erb b/web/views/reports/wiki_images.erb
new file mode 100644
index 0000000..26dbc3e
--- /dev/null
+++ b/web/views/reports/wiki_images.erb
@@ -0,0 +1,26 @@
+<div class="pre">
+ <h1><%= h(t.reports.wiki_images.name) %></h1>
+ <p><%= h(t.reports.wiki_images.intro) %></p>
+</div>
+<div class="box">
+ <table class="wiki-images"><tr><td colspan="2">
+<% lastkey = ''
+ @db.select("SELECT p.key, p.title, p.lang, i.width, i.height, i.image_url, i.thumb_url_prefix, i.thumb_url_suffix FROM wiki.wikipages p, wiki.wiki_images i WHERE i.image=p.image AND p.value IS NULL ORDER BY p.key, p.lang").execute() do |row| %>
+<% if lastkey != row['key']
+ lastkey = row['key'] %>
+ </td></tr><tr><td class="key"><a class="keyimg" href=""></a></td><td class="images">
+<% end %>
+ <div class="langimg">
+ <div><%= row['lang'] %></div>
+<% imagesize = 50
+ if row['width'].to_i <= imagesize && row['height'].to_i <= imagesize
+ src = row['image_url']
+ else
+ src = row['thumb_url_prefix'] + imagesize.to_s + row['thumb_url_suffix']
+ end
+%>
+ <a href="http://wiki.openstreetmap.org/wiki/<%= row['title'] %>"><img src="<%= src %>"/></a>
+ </div>
+<% end %>
+ </td></tr></table>
+</div>