summaryrefslogtreecommitdiff
path: root/web/views/tag.erb
blob: 34644d616a451bc8b044be094f358198ae5d59bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<div class="pre">
    <form id="filter-form">
        <label for="filter"><%= t.pages.key.filter.label %></label>
        <select id="filter" name="filter">
            <option value="all"<%=       @sel['all']       %>><%= t.pages.key.filter.none %></option>
            <option value="nodes"<%=     @sel['nodes']     %>><%= t.pages.key.filter.nodes %></option>
            <option value="ways"<%=      @sel['ways']      %>><%= t.pages.key.filter.ways %></option>
            <option value="relations"<%= @sel['relations'] %>><%= t.pages.key.filter.relations %></option>
        </select>
    </form>
    <div id="tools">
        <% if @count_all < TaginfoConfig.get('xapi.max_results', 1000) %>
            <%= xapi_link(@filter_xapi, @key, @value) %> <%= josm_link(@filter_xapi, @key, @value) %>
        <% else %>
            <span class="button disabled" title="Button disabled, because there are too many objects with this key">XAPI</span>
            <span class="button disabled" title="Button disabled, because there are too many objects with this key">JOSM</span>
        <% end %>
    </div>
    <h1></h1>
    <p><%= @desc %></p>
</div>
<div id="tabs">
    <ul>
        <li><a href="#overview"><%= t.taginfo.overview %></a></li>
        <li><a href="#combinations"><%= t.taginfo.combinations %></a></li>
        <li><a href="#wiki"><%= t.sources.wiki.name %></a></li>
        <li><a href="#josm"><%= t.sources.josm.name %></a></li>
    </ul>
    <div id="overview">
<% if @image_url %>
        <div class="wiki_image">
            <img src="<%= @image_url %>" alt=""/>
        </div>
<% end %>
        <h2><%= t.taginfo.overview %></h2>
        <table id="grid-overview">
        </table>
<% if @has_rtype_link %>
        <p><%= t.pages.tag.overview.see_also %>: <span id="relationlink"></span></p>
<% end %>
    </div>
    <div id="combinations">
        <div class="boxpre">
            <h2><%= t.pages.tag.combinations.title %></h2>
            <p><%= t.pages.tag.combinations.description %></p>
        </div>
        <table id="grid-combinations">
        </table>
    </div>
    <div id="wiki">
        <h2><%= t.pages.tag.wiki_pages.title %></h2>
        <% if @wiki_count > 0 %>
            <table id="grid-wiki">
            </table>
        <% else %>
            <p class="empty"><%= t.pages.tag.wiki_pages.none_found %> <%= @wiki_count_key > 0 ? t.pages.tag.wiki_pages.suggest_key_wiki_page('<span id="keylink"></span>') : '' %></p>
            <p><a class="extlink" target="_blank" rel="nofollow" href="http://wiki.openstreetmap.org/w/index.php?action=edit&title=Tag:<%= escape(@tag) %>"><%= t.pages.tag.wiki_pages.create %></a></p>
        <% end %>
    </div>
    <div id="josm">
        <h2><%= t.pages.tag.josm.title %></h2>
<!--        <form>
            <label for="josm-style"><%= t.pages.tag.josm.choice %></label>
            <select id="josm-style" name="josm-style">
                <option>Standard</option>
            </select>
        </form>-->
<% if @josm_count > 0 %>
        <table id="grid-josm">
        </table>
<% else %>
        <p class="empty"><%= t.pages.key.josm.no_styles %></p>
<% end %>
    </div>
</div>
<iframe id="josmiframe" name="josmiframe"></iframe>
<% javascript do
    JS.raw(<<"JAVASCRIPT")
function page_init2() {
    var key = #{ @key.to_json },
        value = #{ @value.to_json };
    up = function() { window.location = url_for_key(key); };
    jQuery('h1').html(link_to_key(key) + '=' + fmt_value(value));
    jQuery('span#keylink').html(link_to_key(key));
    jQuery('span#relationlink').html(link_to_rtype(value));
    init_tabs([key, value, #{ @filter_type.to_json }]);
}
JAVASCRIPT
end
%>