summaryrefslogtreecommitdiff
path: root/web/views/relation.erb
blob: cbda1be89d66dd7b8fb4c586e4d8b372ea57d7c1 (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
<div class="pre">
    <div id="tools" class="no-print">
        <% if @count_all_values <= TaginfoConfig.get('xapi.max_results', 1000) %>
            <%= xapi_link('relation', 'type', @rtype) %> <%= josm_link('relation', 'type', @rtype) %>
        <% else %>
            <span class="button disabled" title="<%= h(t.pages.relation.button_disabled) %>">XAPI</span>
            <span class="button disabled" title="<%= h(t.pages.relation.button_disabled) %>">JOSM</span>
        <% end %>
        <%= turbo_link(@count_all_values, 'relations', 'type', @rtype) %>
    </div>
    <h1></h1>
    <p><%= @desc %></p>
</div>
<div id="tabs">
    <ul>
        <li><a href="#overview"><%= h(t.pages.relation.overview.tab) %></a></li>
        <li><a href="#roles"><%= h(t.pages.relation.roles.tab) %></a></li>
        <li><a href="#graph"><%= h(t.pages.relation.graph.tab) %></a></li>
        <li><a href="#wiki"><%= h(t.sources.wiki.name) %></a></li>
        <li><a href="#projects"><%= h(t.taginfo.projects) %></a></li>
    </ul>
    <div id="overview">
<% if @image_url %>
        <div class="wiki_image">
            <img src="<%= @image_url.sub(/^http:/, '') %>" alt=""/>
        </div>
<% end %>
        <h2><%= h(t.pages.relation.overview.title) %></h2>
        <table id="grid-overview">
        </table>
        <p><%= h(t.pages.relation.overview.see_also) %>: type=<span id="taglink"></span></p>
    </div>
    <div id="roles">
        <h2><%= h(t.pages.relation.roles.title) %></h2>
<% if @count_relation_roles > 0 %>
        <table id="grid-roles">
        </table>
<% else %>
        <p class="empty"><%= h(t.pages.relation.roles.no_roles_info) %></p>
<% end %>
    </div>
    <div id="graph">
        <h2><%= h(t.pages.relation.graph.title) %></h2>
<% if @count_relation_roles > 0 %>
        <div class="canvas">
        </div>
<% else %>
        <p class="empty"><%= h(t.pages.relation.roles.no_roles_info) %></p>
<% end %>
    </div>
    <div id="wiki">
        <h2><%= h(t.pages.relation.wiki_pages.title) %></h2>
        <% if @wiki_count > 0 %>
            <table id="grid-wiki">
            </table>
        <% else %>
            <p class="empty"><%= h(t.pages.relation.wiki_pages.none_found) %></p>
            <p><a class="extlink" target="_blank" rel="nofollow" href="//wiki.openstreetmap.org/w/index.php?action=edit&title=Relation:<%= @rtype_uri %>"><%= h(t.pages.relation.wiki_pages.create) %></a></p>
        <% end %>
    </div>
    <div id="projects">
        <h2><%= h(t.pages.relation.projects.title) %></h2>
        <table id="grid-projects">
        </table>
    </div>
</div>
<% javascript do
    JS.raw(<<"JAVASCRIPT")
function page_init2() {
    var rtype = #{ @rtype.to_json },
        roles = #{ @roles.to_json.gsub(/\},/, "},\n") };
    jQuery('h1').html("#{ t.pages.relation.name } '" + fmt_rtype(rtype) + "'");
    jQuery('span#taglink').html(link_to_value('type', rtype));
    init_tabs([rtype]);
    create_role_chart(roles);
}
JAVASCRIPT
end
%>