From 09c7c596a1cdc045298018af14c2b1e4ea4d6702 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 14 Mar 2015 11:19:21 +0100 Subject: Add wiki images report. --- web/views/reports/wiki_images.erb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 web/views/reports/wiki_images.erb (limited to 'web/views') 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 @@ +
+

<%= h(t.reports.wiki_images.name) %>

+

<%= h(t.reports.wiki_images.intro) %>

+
+
+
+<% 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'] %> +
+<% end %> +
+
<%= row['lang'] %>
+<% 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 +%> + +
+<% end %> +
+
-- cgit v1.2.3