Ticket #132: node.tt

File node.tt, 4.3 kB (added by cds, 2 years ago)
Line 
1[% USE CGI %]
2[% INCLUDE header.tt %]
3[% INCLUDE banner.tt %]
4<div id="content">
5[% INCLUDE navbar.tt %]
6<div id="maincontent">
7[% IF oldid %]
8<div id="redirect_message">(redirected from <a href="[% full_cgi_url %]?id=[% oldid %];redirect=0">[% oldid.replace('_', ' ') %]</a>)</div>
9[% END %]
10
11[% IF wgs84_lat AND wgs84_long AND display_google_maps and gmaps_api_key %]
12  <div id="map" style="float:right; width: 300px; height: 200px"></div>
13  <script defer="defer" type="text/javascript">
14  //<![CDATA[
15    var map = new GMap(document.getElementById("map"));
16    map.addControl(new GSmallMapControl());
17    map.centerAndZoom(new GPoint([% longitude %], [% latitude %]), 3);
18    var point0 = new GPoint([% wgs84_long %], [% wgs84_lat %]);
19    var marker0 = new GMarker(point0,baseIcon);
20    GEvent.addListener(marker0, "click", function() {
21      marker0.openInfoWindowHtml("[% node_name %]");
22      });
23    map.addOverlay(marker0);
24  //]]>
25  </script>
26[% END %]
27
28[% IF current %]
29  [% IF backlinks_in_title AND is_indexable_node %]
30    <h1><a href="[% cgi_url %]?action=index;index_type=[% CGI.escape(index_type) %];index_value=[% CGI.escape(index_value) %]">[% node_name %]</a></h1>
31  [% ELSIF backlinks_in_title %]
32    <h1><a href="[% cgi_url %]?action=show_backlinks&id=[% CGI.escape(node_name) %]">[% node_name %]</a></h1>
33  [% ELSE %]
34    <h1>[% node_name %]</h1>
35  [% END %]
36[% ELSE %]
37  <h1>
38    <em>Historical version [% version %] of
39    <span class="node_name">[% node_name %]</span></em>
40  </h1>
41[% END %]
42[% IF not (content || coord_field_1_value || coord_field_2_value || latitude || longitude) %]
43We don't have a node called "[% node_param %]". Would you like to <a href="[% full_cgi_url %]?action=edit;id=[% node_param %]">create it</a>?
44[% ELSE %]
45[% INCLUDE display_metadata.tt %]
46
47<!-- NODE CONTENT STARTS -->
48[% content %]
49<!-- NODE CONTENT ENDS -->
50
51<div id="bottom_container">
52
53[% TRY %]
54  [% INCLUDE custom_node.tt %]
55[% CATCH %]
56[% END %]
57                         
58[% IF coord_field_1_value AND coord_field_2_value %]
59  <div id="find_within_distance">
60    <form action="search.cgi">
61      <label for="distance">Find all things within</label>
62      <select name="[% dist_field %]" id="distance">
63        <option value="500">500 metres</option>
64        <option value="1000">1 kilometre</option>
65        <option value="1500">1.5 kilometres</option>
66        <option value="2000">2 kilometres</option>
67      </select>
68      of here.
69      <input type="hidden" name="[% coord_field_1 %]" value="[% coord_field_1_value %]" />
70      <input type="hidden" name="[% coord_field_2 %]" value="[% coord_field_2_value %]" />
71      <input type="submit" name="Go" value="Go" class="form_button" />
72    </form>
73  </div>
74[% END %]
75[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y) %]
76<div id="coordinates">
77[% END %]
78[% IF os_x AND os_y %]
79  <small>OS X co-ord: [% CGI.escapeHTML(os_x) %]</small>
80  &nbsp;&nbsp;&nbsp;
81  <small>OS Y co-ord: [% CGI.escapeHTML(os_y) %]</small>
82  &nbsp;&nbsp;&nbsp;
83[% ELSIF osie_x AND osie_y %]
84  <small>OS IE X co-ord: [% CGI.escapeHTML(osie_x) %]</small>
85  &nbsp;&nbsp;&nbsp;
86  <small>OS IE Y co-ord: [% CGI.escapeHTML(osie_y) %]</small>
87  &nbsp;&nbsp;&nbsp;
88[% END %]
89[% IF latitude AND longitude %]
90  <small>(Latitude: [% latitude %] Longitude: [% longitude %])</small>
91[% END %]
92[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y)%]
93</div>
94[% END %]
95<div id="rdf_link">
96  <a href="[% cgi_url %]?id=[% node_param %];format=rdf">RDF/XML for this
97  node</a>
98  [% IF rss_locale_url %]
99    / <a href="[% rss_locale_url %]">RSS feed for this locale</a>
100  [% END %]
101  [% IF rss_category_url %]
102    / <a href="[% rss_category_url %]">RSS feed for this category</a>
103  [% END %]
104</div>
105<div id="version">
106[% IF current %]
107  Last edited [% last_modified %]
108  [% IF version == 1 %]
109    (version [% version %])
110  [% ELSE %]
111    (version [% version %];
112    <a href="[% cgi_url %]?id=[% node_param %];version=[% version - 1 %];diffversion=[% version %]">diff</a>).
113  [% END %]
114[% ELSE %]
115  This is version [% version %] (as of [% last_modified %]).
116  <a href="[% cgi_url %]?[% node_param %]">View current version.</a>
117[% END %]
118[% IF version AND version > 1 %]
119<a href="[% cgi_url %]?action=list_all_versions;id=[% node_param %]">List all
120versions.</a>
121[% END %]
122</div></div>
123[% END %]
124</div>
125[% INCLUDE footer.tt %]