summaryrefslogtreecommitdiff
path: root/web/views
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-12-01 17:14:49 +0100
committerJochen Topf <jochen@topf.org>2010-12-01 17:14:49 +0100
commit8ff120fa123ebe191a55e9a9303a4ffcf67bccbe (patch)
tree77905201850c51b287f36c44a1999d63278153c4 /web/views
parent166884c66f98ceeb14666b62bfa3d75698676bd8 (diff)
downloadtaginfo-8ff120fa123ebe191a55e9a9303a4ffcf67bccbe.tar
taginfo-8ff120fa123ebe191a55e9a9303a4ffcf67bccbe.tar.gz
New favicon; view for embedding into wiki improved
Diffstat (limited to 'web/views')
-rw-r--r--web/views/embed/key.erb19
-rw-r--r--web/views/embed/layout.erb17
-rw-r--r--web/views/embed/tag.erb22
3 files changed, 39 insertions, 19 deletions
diff --git a/web/views/embed/key.erb b/web/views/embed/key.erb
index 6cc5353..6252bd6 100644
--- a/web/views/embed/key.erb
+++ b/web/views/embed/key.erb
@@ -1,15 +1,20 @@
-<a target="_blank" title="More stats at Taginfo" href="http://taginfo.openstreetmap.de/keys?key=<%= escape(@key) %>"><img src="/img/taginfo.32.png" alt="Taginfo"/> Taginfo</a>
+<% if @dbkey.nil? %>
+<a target="_blank" title="More information about key '<%= escape_html(@key) %>' at Taginfo" href="http://taginfo.openstreetmap.de/tags/?key=<%= escape(@key) %>&value=<%= escape(@value) %>"><img src="/img/taginfo.24.png" alt="Taginfo"/> Taginfo</a>
+<p>This key does not appear in the OSM database.</p>
+<% else %>
+<a target="_blank" title="More information about key '<%= escape_html(@key) %>' at Taginfo" href="http://taginfo.openstreetmap.de/keys/?key=<%= escape(@key) %>"><img src="/img/taginfo.24.png" alt="Taginfo"/> Taginfo</a>
<div class="content"><table>
<tr>
- <td><img src="/img/types/node.16.png" alt="Nodes" title="Nodes with key <%= escape_html(@key) %> in database"></td>
- <td><%= @res['count_nodes'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/node.16.png" alt="Nodes" title="Nodes with key '<%= escape_html(@key) %>' in database"></td>
+ <td title="Nodes with key '<%= escape_html(@key) %>' in database"><%= @dbkey['count_nodes'].to_i.to_s_with_ts %></td>
</tr>
<tr>
- <td><img src="/img/types/way.16.png" alt="Ways" title="Ways with key <%= escape_html(@key) %> in database"></td>
- <td><%= @res['count_ways'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/way.16.png" alt="Ways" title="Ways with key '<%= escape_html(@key) %>' in database"></td>
+ <td title="Ways with key '<%= escape_html(@key) %>' in database"><%= @dbkey['count_ways'].to_i.to_s_with_ts %></td>
</tr>
<tr>
- <td><img src="/img/types/relation.16.png" alt="Relations" title="Relations with key <%= escape_html(@key) %> in database"></td>
- <td><%= @res['count_relations'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/relation.16.png" alt="Relations" title="Relations with key '<%= escape_html(@key) %>' in database"></td>
+ <td title="Relations with key '<%= escape_html(@key) %>' in database"><%= @dbkey['count_relations'].to_i.to_s_with_ts %></td>
</tr>
</table></div>
+<% end %>
diff --git a/web/views/embed/layout.erb b/web/views/embed/layout.erb
index b1e37bc..6435192 100644
--- a/web/views/embed/layout.erb
+++ b/web/views/embed/layout.erb
@@ -5,14 +5,15 @@
<style>
body {
font-family: Verdana,Arial,sans-serif;
+ font-size: 0.8em;
padding: 0;
margin: 0;
}
div.main {
width: 180px;
- background-color: #f0f0f0;
- border: 1px solid #e8e8e8;
+ background-color: #ffffff;
+ border: 1px solid #006000;
padding: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
@@ -21,8 +22,10 @@ div.main {
-o-border-radius: 4px;
}
-img {
+a img {
border: none;
+ position: relative;
+ top: 1px;
}
a {
@@ -36,8 +39,12 @@ div.content {
text-align: right;
}
-div.content img {
- padding-right: 4px;
+div.content table {
+ border-collapse: collapse;
+}
+
+div.content td.ft {
+ padding-right: 8px;
}
</style>
diff --git a/web/views/embed/tag.erb b/web/views/embed/tag.erb
index 031eed5..ff58a24 100644
--- a/web/views/embed/tag.erb
+++ b/web/views/embed/tag.erb
@@ -1,15 +1,23 @@
-<a target="_blank" title="More stats at Taginfo" href="http://taginfo.openstreetmap.de/tags?key=<%= escape(@key) %>&value=<%= escape(@value) %>"><img src="/img/taginfo.32.png" alt="Taginfo"/> Taginfo</a>
+<% if @dbtag.nil? %>
+<a target="_blank" title="More information about tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' at Taginfo" href="http://taginfo.openstreetmap.de/tags/?key=<%= escape(@key) %>&value=<%= escape(@value) %>"><img src="/img/taginfo.24.png" alt="Taginfo"/> Taginfo</a>
+<p>This tag does not appear in the OSM database.</p>
+<% else %>
+<a target="_blank" title="More information about tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' at Taginfo" href="http://taginfo.openstreetmap.de/tags/?key=<%= escape(@key) %>&value=<%= escape(@value) %>"><img src="/img/taginfo.24.png" alt="Taginfo"/> Taginfo</a>
<div class="content"><table>
<tr>
- <td><img src="/img/types/node.16.png" alt="Nodes" title="Nodes with tag <%= escape_html(@key) %>=<%= escape_html(@value) %> in database"></td>
- <td><%= @res['count_nodes'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/node.16.png" alt="Nodes" title="Nodes with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"></td>
+ <td class="ft" title="Nodes with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"><%= @dbtag['count_nodes'].to_i.to_s_with_ts %></td>
+ <td title="Fraction of all nodes with key '<%= escape_html(@key) %>'"><%= '%.2f' % (@dbtag['count_nodes'].to_f / @dbkey['count_nodes'].to_f * 100) %>&thinsp;%</td>
</tr>
<tr>
- <td><img src="/img/types/way.16.png" alt="Ways" title="Ways with tag <%= escape_html(@key) %>=<%= escape_html(@value) %> in database"></td>
- <td><%= @res['count_ways'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/way.16.png" alt="Ways" title="Ways with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"></td>
+ <td class="ft" title="Ways with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"><%= @dbtag['count_ways'].to_i.to_s_with_ts %></td>
+ <td title="Fraction of all ways with key '<%= escape_html(@key) %>'"><%= '%.2f' % (@dbtag['count_ways'].to_f / @dbkey['count_ways'].to_f * 100) %>&thinsp;%</td>
</tr>
<tr>
- <td><img src="/img/types/relation.16.png" alt="Relations" title="Relations with tag <%= escape_html(@key) %>=<%= escape_html(@value) %> in database"></td>
- <td><%= @res['count_relations'].to_i.to_s_with_ts %></td>
+ <td class="ft"><img src="/img/types/relation.16.png" alt="Relations" title="Relations with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"></td>
+ <td class="ft" title="Relations with tag '<%= escape_html(@key) %>=<%= escape_html(@value) %>' in database"><%= @dbtag['count_relations'].to_i.to_s_with_ts %></td>
+ <td title="Fraction of all relations with key '<%= escape_html(@key) %>'"><%= '%.2f' % (@dbtag['count_relations'].to_f / @dbkey['count_relations'].to_f * 100) %>&thinsp;%</td>
</tr>
</table></div>
+<% end %>