summaryrefslogtreecommitdiff
path: root/web/views/taginfo
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-06 12:26:56 +0100
committerJochen Topf <jochen@topf.org>2013-01-06 12:28:43 +0100
commit94cf8b600b3b59e3bad066b6a4b7bf010007e84e (patch)
tree87d02818a7812b9e03f15d838dd6f25a9bc6d7fd /web/views/taginfo
parent71577075ff777cf2a6f3b4e7b6c8fd37d206d960 (diff)
downloadtaginfo-94cf8b600b3b59e3bad066b6a4b7bf010007e84e.tar
taginfo-94cf8b600b3b59e3bad066b6a4b7bf010007e84e.tar.gz
Started work on API version 4.
Diffstat (limited to 'web/views/taginfo')
-rw-r--r--web/views/taginfo/apidoc.erb22
-rw-r--r--web/views/taginfo/index.erb2
2 files changed, 17 insertions, 7 deletions
diff --git a/web/views/taginfo/apidoc.erb b/web/views/taginfo/apidoc.erb
index 3dab6d2..864dacc 100644
--- a/web/views/taginfo/apidoc.erb
+++ b/web/views/taginfo/apidoc.erb
@@ -2,6 +2,12 @@
<p>See <a href="http://wiki.openstreetmap.org/wiki/Taginfo/API">the OSM wiki</a> for general information about the API.</p>
+<% if params[:show_deprecated] %>
+<p><span class="button"><a href="/taginfo/apidoc">Do not show deprecated API calls</a></span></p>
+<% else %>
+<p><span class="button"><a href="/taginfo/apidoc?show_deprecated=true">Also show deprecated API calls</a></span></p>
+<% end %>
+
<h2>Table of Contents</h2>
<p style="color: red;">This list of API calls and their descriptions are not complete!</p>
@@ -9,17 +15,20 @@
<ul>
<% API.paths.keys.sort.each do |version|
API.paths[version].keys.sort.each do |path|
- doc = API.paths[version][path] %>
- <li><a href="#<%= doc.complete_path.tr('/', '_')[1,1000] %>"><%= doc.complete_path %></li>
-<% end
+ doc = API.paths[version][path]
+ if !doc.deprecated? || params[:show_deprecated] %>
+ <li><a href="#<%= doc.complete_path.tr('/', '_')[1,1000] %>"><%= doc.complete_path %></a><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></li>
+<% end
+ end
end %>
</ul>
<% API.paths.keys.sort.each do |version|
API.paths[version].keys.sort.each do |path|
- doc = API.paths[version][path] %>
+ doc = API.paths[version][path]
+ if !doc.deprecated? || params[:show_deprecated] %>
<a name="<%= doc.complete_path.tr('/', '_')[1,1000] %>"></a>
-<h2><%= doc.complete_path %></h2>
+<h2><%= doc.complete_path %><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></h2>
<table class="desc">
</tr>
<tr>
@@ -60,5 +69,6 @@
<td><a href="<%= doc.show_ui %>" target="_blank"><%= doc.show_ui %></a></td>
</tr>
</table>
-<% end
+<% end
+ end
end %>
diff --git a/web/views/taginfo/index.erb b/web/views/taginfo/index.erb
index 893bfe9..40f4790 100644
--- a/web/views/taginfo/index.erb
+++ b/web/views/taginfo/index.erb
@@ -15,5 +15,5 @@
<tr><td><%= k %></td><td><%= TaginfoConfig.get("instance.#{k}") %></td></tr>
<% end %>
</table>
- <p>These config settings are also available from the <tt>/api/2/site</tt> <a href="/taginfo/apidoc#api_2_site">API call</a>.</p>
+ <p style="margin-top: 10px;">These config settings are also available from the <tt>/api/4/site</tt> <a href="/taginfo/apidoc#api_4_site">API call</a>.</p>
</div>