root/sites/oxford.openguides.org/templates/node.tt

Revision 1113, 6.1 kB (checked in by dom, 17 months ago)

Use tile.openstreetmap.org instead

Line 
1[% USE CGI %]
2[% INCLUDE header.tt %]
3[% INCLUDE banner.tt %]
4<div id="content">
5[% IF !config.content_above_navbar_in_html %]
6  [% INCLUDE navbar.tt %]
7[% END %]
8<div id="maincontent" class="hreview">
9[% IF oldid %]
10<div id="redirect_message">(redirected from <a href="[% full_cgi_url %]?id=[% oldid %];redirect=0">[% oldid.replace('_', ' ') %]</a>)</div>
11[% END %]
12
13[% IF wgs84_lat AND wgs84_long AND display_google_maps and gmaps_api_key %]
14  <div id="map" style="float:right; width: 300px; height: 200px"></div>
15  <script defer="defer" type="text/javascript">
16  //<![CDATA[
17    var map = new GMap2(document.getElementById("map"));
18    new GKeyboardHandler(map);
19    var copycol = new GCopyrightCollection("");
20    var copy = new GCopyright(1, new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)), 0, "<a href='http://www.openstreetmap.org>OpenStreetMap</a>");
21    copycol.addCopyright(copy);
22    var tileMapnik = new GTileLayer(copycol,1,18);
23    tileMapnik.myBaseURL = "http://tile.openstreetmap.org/";
24    tileMapnik.getTileUrl=MapnikGetTileUrl;
25    tileMapnik.isPng = function () { return true;}
26    tileMapnik.getOpacity = function() {return 1.0;}
27
28    var layer0 = [tileMapnik];
29    var mapnikMap = new GMapType(layer0, G_SATELLITE_MAP.getProjection(), "OSM", G_SATELLITE_MAP);
30    map.addMapType(mapnikMap);
31   
32
33    map.addControl(new GMapTypeControl());
34    map.setCenter(new GLatLng([% wgs84_lat %], [% wgs84_long %]), 14);
35    map.setMapType(mapnikMap);
36    map.addControl(new GSmallMapControl());
37    var point0 = new GPoint([% wgs84_long %], [% wgs84_lat %]);
38    var marker0 = new GMarker(point0,baseIcon);
39    GEvent.addListener(marker0, "click", function() {
40      marker0.openInfoWindowHtml("[% node_name %]");
41      });
42    map.addOverlay(marker0);
43   
44  //]]>
45  </script>
46[% END %]
47
48<div id="node_title">
49[% IF current %]
50  [% IF backlinks_in_title AND is_indexable_node %]
51    <h2 class="node_name"><a href="[% cgi_url %]?action=index;index_type=[% CGI.escape(index_type) %];index_value=[% CGI.escape(index_value) %]">[% node_name %]</a></h2>
52  [% ELSIF backlinks_in_title %]
53    <h2 class="node_name"><a href="[% cgi_url %]?action=show_backlinks;id=[% CGI.escape(node_name) %]">[% node_name %]</a></h2>
54  [% ELSE %]
55    <h2 class="node_name">[% node_name %]</h2>
56  [% END %]
57[% ELSE %]
58  <h2><em>
59  [% IF moderated %]
60    Historical
61  [% ELSE %]
62    Un-moderated
63  [% END %]
64    version [% version %] of
65    <span class="node_name">[% node_name %]</span></em>
66  </h2>
67[% END %]
68[% IF not (content || coord_field_1_value || coord_field_2_value || latitude || longitude) %]
69</div>
70<div id="nonexistent_node_message">We 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>?</div>
71[% ELSE %]
72<div id="title_edit_link">
73<a href="[% full_cgi_url %]?action=edit;id=[% node_param %]">Edit this page</a>
74</div>
75</div>
76[% INCLUDE display_metadata.tt %]
77
78<!-- NODE CONTENT STARTS -->
79<div id="content_text" class="description">
80[% content %]
81</div>
82<!-- NODE CONTENT ENDS -->
83
84[% TRY %]
85  [% INCLUDE custom_node.tt %]
86[% CATCH %]
87[% END %]
88                         
89[% IF coord_field_1_value AND coord_field_2_value %]
90  <br clear="all" />
91  <div id="find_within_distance">
92    <form action="search.cgi">
93      <label for="distance">Find all things within</label>
94      <select name="[% dist_field %]" id="distance">
95        <option value="500">500 metres</option>
96        <option value="1000">1 kilometre</option>
97        <option value="1500">1.5 kilometres</option>
98        <option value="2000">2 kilometres</option>
99      </select>
100      of here.
101      <input type="hidden" name="[% coord_field_1 %]" value="[% coord_field_1_value %]" />
102      <input type="hidden" name="[% coord_field_2 %]" value="[% coord_field_2_value %]" />
103      <input type="submit" name="Go" value="Go" class="form_button" />
104    </form>
105  </div>
106[% END %]
107[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y) %]
108<div id="coordinates" class="geo">
109[% END %]
110[% IF os_x AND os_y %]
111  <small>OS X co-ord:
112    <abbr class="osgb_x" title="[% CGI.escapeHTML(os_x) %]">[% CGI.escapeHTML(os_x) %]</abbr>
113  </small>
114  &nbsp;&nbsp;&nbsp;
115  <small>OS Y co-ord:
116    <abbr class="osgb_y" title="[% CGI.escapeHTML(os_y) %]">[% CGI.escapeHTML(os_y) %]</abbr>
117  </small>
118  &nbsp;&nbsp;&nbsp;
119[% ELSIF osie_x AND osie_y %]
120  <small>OS IE X co-ord:
121    <abbr class="osie_x" title="[% CGI.escapeHTML(osie_x) %]">[% CGI.escapeHTML(osie_x) %]</abbr>
122  </small>
123  &nbsp;&nbsp;&nbsp;
124  <small>OS IE Y co-ord:
125    <abbr class="osie_y" title="[% CGI.escapeHTML(osie_y) %]">[% CGI.escapeHTML(osie_y) %]</abbr>
126  </small>
127  &nbsp;&nbsp;&nbsp;
128[% END %]
129[% IF latitude AND longitude %]
130  <small>
131    (Latitude:
132    <!-- titles using the wgs84 versions here are for microformats -->
133    <abbr class="latitude" title="[% wgs84_lat %]">[% latitude %]</abbr>
134        Longitude:
135        <abbr class="longitude" title="[% wgs84_long %]">[% longitude %]</abbr>)
136  </small>
137[% END %]
138[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y)%]
139</div>
140[% END %]
141<div id="rdf_link">
142  <a href="[% cgi_url %]?id=[% node_param %];format=rdf">RDF/XML for this
143  node</a>
144  [% IF rss_locale_url %]
145    / <a href="[% rss_locale_url %]">RSS feed for this locale</a>
146  [% END %]
147  [% IF rss_category_url %]
148    / <a href="[% rss_category_url %]">RSS feed for this category</a>
149  [% END %]
150</div>
151<div id="version">
152[% IF current %]
153  Last edited [% last_modified %]
154  [% IF version == 1 %]
155    (version [% version %])
156  [% ELSE %]
157    (version [% version %];
158    <a href="[% cgi_url %]?id=[% node_param %];version=[% version - 1 %];diffversion=[% version %]">diff</a>).
159  [% END %]
160[% ELSE %]
161  This is version <span class="version">[% version %]</span>
162  (as of [% last_modified %]).
163  <a href="[% cgi_url %]?[% node_param %]">View current version.</a>
164[% END %]
165[% IF version AND version > 1 %]
166<a href="[% cgi_url %]?action=list_all_versions;id=[% node_param %]">List all
167versions.</a>
168[% END %]
169</div>
170[% END %]
171</div>
172
173[% IF config.content_above_navbar_in_html %]
174  [% INCLUDE navbar.tt %]
175[% END %]
176
177[% INCLUDE footer.tt %]
Note: See TracBrowser for help on using the browser.