source: trunk/templates/node.tt @ 1370

Last change on this file since 1370 was 1370, checked in by kake, 10 years ago

Make sure node image shows up on edit preview.

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