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
Line 
1[% USE CGI %]
2[% USE JSON.Escape %]
3[% INCLUDE header.tt %]
4[% INCLUDE banner.tt %]
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
12[% IF !config.content_above_navbar_in_html %]
13  [% INCLUDE navbar.tt %]
14[% END %]
15<div id="maincontent" class="hreview">
16[% IF oldid %]
17<div id="redirect_message">(redirected from <a href="[% full_cgi_url %]?id=[% oldid %];redirect=0">[% oldid.replace('_', ' ') %]</a>)</div>
18[% END %]
19
20[% IF wgs84_lat AND wgs84_long AND display_google_maps %]
21  [% IF config.use_leaflet %]
22    <div id="node_map_canvas"></div>
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 );
31        marker.bindPopup( [% node_name.json %] );
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 %]
50[% END %]
51
52[% INCLUDE node_image.tt %]
53
54<div id="node_title">
55[% IF current %]
56  [% IF config.backlinks_in_title AND is_indexable_node %]
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>
63  [% ELSIF config.backlinks_in_title %]
64    <h2 class="node_name"><a href="[% cgi_url %]?action=show_backlinks;id=[% CGI.escape(node_name) %]">[% node_name %]</a></h2>
65  [% ELSE %]
66    <h2 class="node_name">[% node_name %]</h2>
67  [% END %]
68[% ELSE %]
69  <h2><em>
70  [% IF moderated %]
71    Historical
72  [% ELSE %]
73    Un-moderated
74  [% END %]
75    version [% version %] of
76    <span class="node_name">[% node_name %]</span></em>
77    <span class="current_version_title_link">
78      <a href="[% cgi_url %]?[% node_param %]">(view current version)</a>
79    </span>
80  </h2>
81[% END %]
82[% IF empty_node %]
83</div>
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>
89[% ELSE %]
90<div id="title_edit_link">
91[% UNLESS read_only %]
92<a href="[% full_cgi_url %]?action=edit;id=[% node_param %]">Edit this page</a>
93[% END %]
94</div>
95</div>
96[% INCLUDE display_metadata.tt %]
97
98<!-- NODE CONTENT STARTS -->
99<div id="content_text" class="description">
100[% content %]
101</div>
102<!-- NODE CONTENT ENDS -->
103
104[% TRY %]
105  [% INCLUDE custom_node.tt %]
106[% CATCH %]
107[% END %]
108                         
109[% IF coord_field_1_value AND coord_field_2_value %]
110  <br clear="all" />
111  <div id="find_within_distance">
112    <form action="search.cgi">
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>
126[% END %]
127[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y) %]
128<div id="coordinates" class="geo">
129[% END %]
130[% IF os_x AND os_y %]
131  <small>OS X co-ord:
132    <abbr class="osgb_x" title="[% CGI.escapeHTML(os_x) %]">[% CGI.escapeHTML(os_x) %]</abbr>
133  </small>
134  &nbsp;&nbsp;&nbsp;
135  <small>OS Y co-ord:
136    <abbr class="osgb_y" title="[% CGI.escapeHTML(os_y) %]">[% CGI.escapeHTML(os_y) %]</abbr>
137  </small>
138  &nbsp;&nbsp;&nbsp;
139[% ELSIF osie_x AND osie_y %]
140  <small>OS IE X co-ord:
141    <abbr class="osie_x" title="[% CGI.escapeHTML(osie_x) %]">[% CGI.escapeHTML(osie_x) %]</abbr>
142  </small>
143  &nbsp;&nbsp;&nbsp;
144  <small>OS IE Y co-ord:
145    <abbr class="osie_y" title="[% CGI.escapeHTML(osie_y) %]">[% CGI.escapeHTML(osie_y) %]</abbr>
146  </small>
147  &nbsp;&nbsp;&nbsp;
148[% END %]
149[% IF latitude AND longitude %]
150  <small>
151    (Latitude:
152    <!-- titles using the wgs84 versions here are for microformats -->
153    <abbr class="latitude" title="[% wgs84_lat %]">[% latitude %]</abbr>
154        Longitude:
155        <abbr class="longitude" title="[% wgs84_long %]">[% longitude %]</abbr>)
156  </small>
157[% END %]
158[% IF (latitude AND longitude) OR (os_x AND os_y) OR (osie_x AND osie_y)%]
159</div>
160[% END %]
161<div id="rdf_link">
162  <a href="[% cgi_url %]?id=[% node_param %];format=rdf">RDF/XML for this
163  node</a>
164  <a href="[% cgi_url %]?id=[% node_param %];format=json">JSON for this
165  node</a>
166  [% IF rss_locale_url %]
167    / <a href="[% rss_locale_url %]">RSS feed for this locale</a>
168  [% END %]
169  [% IF rss_category_url %]
170    / <a href="[% rss_category_url %]">RSS feed for this category</a>
171  [% END %]
172</div>
173<div id="version">
174[% IF current %]
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 %]
182[% ELSE %]
183  This is version <span class="version">[% version %]</span>
184  (as of [% last_modified %]).
185  <a href="[% cgi_url %]?[% node_param %]">View current version.</a>
186[% END %]
187[% IF version AND version > 1 %]
188<a href="[% cgi_url %]?action=list_all_versions;id=[% node_param %]">List all
189versions.</a>
190[% END %]
191</div>
192[% END %]
193</div>
194
195[% IF config.content_above_navbar_in_html %]
196  [% INCLUDE navbar.tt %]
197[% END %]
198
199[% INCLUDE footer.tt %]
Note: See TracBrowser for help on using the repository browser.