source: trunk/templates/node.tt

Last change on this file was 1413, checked in by kake, 9 years ago

Fixed a JavaScript? escaping issue for nodes with apostrophes in names.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 KB
RevLine 
[2]1[% USE CGI %]
[1413]2[% USE JSON.Escape %]
[2]3[% INCLUDE header.tt %]
[288]4[% INCLUDE banner.tt %]
[1311]5
6[% IF categories.size OR locales.size %]
7  <div id="content" class="[% FOREACH cat = categories %]cat_[% cat.name.lower.replace( ' ', '_' ) %][%- " " UNLESS (loop.last AND !locales.size) %][% END %][% FOREACH loc=locales %]loc_[% loc.name.lower.replace( ' ', '_' ) %][%- " " UNLESS loop.last %][% END %]">
8[% ELSE %]
9  <div id="content">
10[% END %]
11
[962]12[% IF !config.content_above_navbar_in_html %]
13  [% INCLUDE navbar.tt %]
14[% END %]
[811]15<div id="maincontent" class="hreview">
[634]16[% IF oldid %]
[710]17<div id="redirect_message">(redirected from <a href="[% full_cgi_url %]?id=[% oldid %];redirect=0">[% oldid.replace('_', ' ') %]</a>)</div>
[634]18[% END %]
19
[1336]20[% IF wgs84_lat AND wgs84_long AND display_google_maps %]
21  [% IF config.use_leaflet %]
[1346]22    <div id="node_map_canvas"></div>
[1336]23    <script type="text/javascript">
24      map_div_id = 'node_map_canvas';
25      centre_lat = [% wgs84_lat %];
26      centre_long = [% wgs84_long %];
27      function add_markers() {
28        var position = new L.LatLng( [% wgs84_lat %], [% wgs84_long %] );
29        marker = new L.Marker( position, { icon: new gicon() } );
30        map.addLayer( marker );
[1413]31        marker.bindPopup( [% node_name.json %] );
[1336]32      }
33    </script>
34  [% ELSIF gmaps_api_key %]
35    <div id="map" style="float:right; width: 300px; height: 200px"></div>
36    <script defer="defer" type="text/javascript">
37    //<![CDATA[
38      var map = new GMap(document.getElementById("map"));
39      map.addControl(new GSmallMapControl());
40      map.centerAndZoom(new GPoint([% wgs84_long %], [% wgs84_lat %]), 3);
41      var point0 = new GPoint([% wgs84_long %], [% wgs84_lat %]);
42      var marker0 = new GMarker(point0,baseIcon);
43      GEvent.addListener(marker0, "click", function() {
44        marker0.openInfoWindowHtml("[% node_name %]");
45        });
46      map.addOverlay(marker0);
47    //]]>
48    </script>
49  [% END %]
[730]50[% END %]
51
[1370]52[% INCLUDE node_image.tt %]
[1237]53
[1036]54<div id="node_title">
[2]55[% IF current %]
[1338]56  [% IF config.backlinks_in_title AND is_indexable_node %]
[1339]57    [% IF index_type == 'category' %]
58      [% params = ';cat=' _ index_value.lower | html %]
59    [% ELSIF index_type == 'locale' %]
60      [% params = ';loc=' _ index_value.lower | html %]
61    [% END %]
62    <h2 class="node_name"><a href="[% cgi_url %]?action=index[% params %]">[% node_name %]</a></h2>
[1338]63  [% ELSIF config.backlinks_in_title %]
[867]64    <h2 class="node_name"><a href="[% cgi_url %]?action=show_backlinks;id=[% CGI.escape(node_name) %]">[% node_name %]</a></h2>
[2]65  [% ELSE %]
[531]66    <h2 class="node_name">[% node_name %]</h2>
[2]67  [% END %]
68[% ELSE %]
[831]69  <h2><em>
70  [% IF moderated %]
71    Historical
72  [% ELSE %]
73    Un-moderated
74  [% END %]
75    version [% version %] of
[581]76    <span class="node_name">[% node_name %]</span></em>
[1365]77    <span class="current_version_title_link">
78      <a href="[% cgi_url %]?[% node_param %]">(view current version)</a>
79    </span>
[581]80  </h2>
[2]81[% END %]
[1269]82[% IF empty_node %]
[1036]83</div>
[1279]84<div id="nonexistent_node_message">We don't have a node called "[% node_name %]".
85[% UNLESS read_only %]
86Would you like to <a href="[% full_cgi_url %]?action=edit;id=[% node_param %]">create it</a>?
87[% END %]
88</div>
[699]89[% ELSE %]
[1036]90<div id="title_edit_link">
[1279]91[% UNLESS read_only %]
[1036]92<a href="[% full_cgi_url %]?action=edit;id=[% node_param %]">Edit this page</a>
[1279]93[% END %]
[1036]94</div>
95</div>
[15]96[% INCLUDE display_metadata.tt %]
[289]97
98<!-- NODE CONTENT STARTS -->
[811]99<div id="content_text" class="description">
[2]100[% content %]
[811]101</div>
[289]102<!-- NODE CONTENT ENDS -->
103
[712]104[% TRY %]
105  [% INCLUDE custom_node.tt %]
106[% CATCH %]
[715]107[% END %]
[712]108                         
[559]109[% IF coord_field_1_value AND coord_field_2_value %]
110  <br clear="all" />
111  <div id="find_within_distance">
[716]112    <form action="search.cgi">
[559]113      <label for="distance">Find all things within</label>
114      <select name="[% dist_field %]" id="distance">
115        <option value="500">500 metres</option>
116        <option value="1000">1 kilometre</option>
117        <option value="1500">1.5 kilometres</option>
118        <option value="2000">2 kilometres</option>
119      </select>
120      of here.
121      <input type="hidden" name="[% coord_field_1 %]" value="[% coord_field_1_value %]" />
122      <input type="hidden" name="[% coord_field_2 %]" value="[% coord_field_2_value %]" />
123      <input type="submit" name="Go" value="Go" class="form_button" />
124    </form>
125  </div>
[2]126[% END %]
[1106]127[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y) %]
[811]128<div id="coordinates" class="geo">
[288]129[% END %]
130[% IF os_x AND os_y %]
[811]131  <small>OS X co-ord:
132    <abbr class="osgb_x" title="[% CGI.escapeHTML(os_x) %]">[% CGI.escapeHTML(os_x) %]</abbr>
133  </small>
[288]134  &nbsp;&nbsp;&nbsp;
[811]135  <small>OS Y co-ord:
136    <abbr class="osgb_y" title="[% CGI.escapeHTML(os_y) %]">[% CGI.escapeHTML(os_y) %]</abbr>
137  </small>
[288]138  &nbsp;&nbsp;&nbsp;
[691]139[% ELSIF osie_x AND osie_y %]
[811]140  <small>OS IE X co-ord:
141    <abbr class="osie_x" title="[% CGI.escapeHTML(osie_x) %]">[% CGI.escapeHTML(osie_x) %]</abbr>
142  </small>
[691]143  &nbsp;&nbsp;&nbsp;
[811]144  <small>OS IE Y co-ord:
145    <abbr class="osie_y" title="[% CGI.escapeHTML(osie_y) %]">[% CGI.escapeHTML(osie_y) %]</abbr>
146  </small>
[691]147  &nbsp;&nbsp;&nbsp;
[288]148[% END %]
[1106]149[% IF latitude AND longitude %]
[811]150  <small>
151    (Latitude:
[1106]152    <!-- titles using the wgs84 versions here are for microformats -->
153    <abbr class="latitude" title="[% wgs84_lat %]">[% latitude %]</abbr>
[811]154        Longitude:
[1106]155        <abbr class="longitude" title="[% wgs84_long %]">[% longitude %]</abbr>)
[811]156  </small>
[288]157[% END %]
[1106]158[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y)%]
[288]159</div>
160[% END %]
[490]161<div id="rdf_link">
162  <a href="[% cgi_url %]?id=[% node_param %];format=rdf">RDF/XML for this
163  node</a>
[1228]164  <a href="[% cgi_url %]?id=[% node_param %];format=json">JSON for this
165  node</a>
[522]166  [% IF rss_locale_url %]
167    / <a href="[% rss_locale_url %]">RSS feed for this locale</a>
[490]168  [% END %]
[522]169  [% IF rss_category_url %]
170    / <a href="[% rss_category_url %]">RSS feed for this category</a>
171  [% END %]
[490]172</div>
[288]173<div id="version">
[2]174[% IF current %]
[602]175  Last edited [% last_modified %]
176  [% IF version == 1 %]
177    (version [% version %])
178  [% ELSE %]
179    (version [% version %];
180    <a href="[% cgi_url %]?id=[% node_param %];version=[% version - 1 %];diffversion=[% version %]">diff</a>).
181  [% END %]
[2]182[% ELSE %]
[811]183  This is version <span class="version">[% version %]</span>
184  (as of [% last_modified %]).
[602]185  <a href="[% cgi_url %]?[% node_param %]">View current version.</a>
[2]186[% END %]
[311]187[% IF version AND version > 1 %]
[288]188<a href="[% cgi_url %]?action=list_all_versions;id=[% node_param %]">List all
189versions.</a>
[2]190[% END %]
[279]191</div>
[699]192[% END %]
[617]193</div>
[844]194
[962]195[% IF config.content_above_navbar_in_html %]
196  [% INCLUDE navbar.tt %]
197[% END %]
198
[508]199[% INCLUDE footer.tt %]
Note: See TracBrowser for help on using the repository browser.