summaryrefslogtreecommitdiff
path: root/web/views/download.erb
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-13 22:34:38 +0100
committerJochen Topf <jochen@topf.org>2010-11-13 22:34:38 +0100
commitbcae4dba9ec66d224e3fe0da845a76dd1c6c19a2 (patch)
tree91238e96808d879d0ec19f87cfbb4e34670d5a60 /web/views/download.erb
parent9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d (diff)
downloadtaginfo-bcae4dba9ec66d224e3fe0da845a76dd1c6c19a2.tar
taginfo-bcae4dba9ec66d224e3fe0da845a76dd1c6c19a2.tar.gz
Automatically generate file sizes for downloads
Diffstat (limited to 'web/views/download.erb')
-rw-r--r--web/views/download.erb41
1 files changed, 16 insertions, 25 deletions
diff --git a/web/views/download.erb b/web/views/download.erb
index 4ff6e4c..b7bc4fc 100644
--- a/web/views/download.erb
+++ b/web/views/download.erb
@@ -1,40 +1,31 @@
<h1>Download</h1>
-<p>
- Here you can download the databases used by Taginfo. All the data is stored
- in <img src="/img/link-extern.gif" alt=""/><a class="extlink" href="http://www.sqlite.org/">Sqlite</a> databases. The database
- files are then packed with <img src="/img/link-extern.gif" alt=""/><a class="extlink" href="http://www.bzip.org/">bzip2</a>.
-</p>
+<p>Here you can download the databases used by Taginfo. All the data is stored
+in <img src="/img/link-extern.gif" alt=""/><a class="extlink"
+href="http://www.sqlite.org/">Sqlite</a> databases. The database files are then
+packed with <img src="/img/link-extern.gif" alt=""/><a class="extlink"
+href="http://www.bzip.org/">bzip2</a>.</p>
+
+<p>If you don't want to download these databases, but need automated access to
+the data, you can also use the <a href="/about">API</a>.
<table class="list">
<tr>
<th></th><th></th><th>File</th><th>Packed</th><th>Unpacked</th><th>Description</th><th></th>
</tr>
+<% Source.each do |source| %>
<tr><td class="border"></td>
- <td style="text-align: center;"><img src="/img/sources/db.16.png" alt="Database" width="16" height="16"/></td>
- <td><a href="/download/taginfo-db.db.bz2">taginfo-db.db.bz2</a></td>
- <td style="text-align: right;">~ 540 MB</td><td style="text-align: right;">~ 3.5 GB</td>
- <td>Statistics about each key and each tag from the main OSM database (planet).</td>
- <td class="border"></td></tr>
- <tr><td class="border"></td>
- <td style="text-align: center;"><img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16"/></td>
- <td><a href="/download/taginfo-wiki.db.bz2">taginfo-wiki.db.bz2</a></td>
- <td style="text-align: right;">~ 180 kB</td><td style="text-align: right;">~ 740 kB</td>
- <td>Data from the tag and key pages of the OSM wiki.</td>
- <td class="border"></td></tr>
- <tr><td class="border"></td>
- <td style="text-align: center;"><img src="/img/sources/josm.16.png" alt="JOSM" width="16" height="16"/></td>
- <td><a href="/download/taginfo-josm.db.bz2">taginfo-josm.db.bz2</a></td>
- <td style="text-align: right;">~ 25 kB</td><td style="text-align: right;">~ 200 kB</td>
- <td>Configuration data from the JOSM OSM editor.</td>
+ <td style="text-align: center;"><%= source.img %></td>
+ <td><%= source.link_download %></td>
+ <td style="text-align: right;"><%= source.dbpack %></td><td style="text-align: right;"><%= source.dbsize %></td>
+ <td><%= t.source[source.id].description %></td>
<td class="border"></td></tr>
+<% end %>
<tr><td class="border"></td>
<td style="text-align: center;"><img src="/img/taginfo.32.png" alt="Taginfo" width="32" height="16"/></td>
<td><a href="/download/taginfo-master.db.bz2">taginfo-master.db.bz2</a></td>
- <td style="text-align: right;">~ 60 kB</td><td style="text-align: right;">~ 130 kB</td>
- <td>Some aggregate statistics and miscellaneous data needed for the Taginfo user interface.</td>
+ <td style="text-align: right;"><%= File.size("../../download/taginfo-master.db.bz2").to_bytes rescue '<i>unknown</i>' %></td><td style="text-align: right;"><%= File.size("../../data/taginfo-master.db").to_bytes rescue '<i>unknown</i>' %></td>
+ <td><%= t.source.master.description %></td>
<td class="border"></td></tr>
<tr><th colspan="7"/></tr>
</table>
-
-<p>If you don't want to download these databases, but need automated access to the data, you can also use the <a href="/about">API</a>.