source: trunk/templates/display_metadata.tt @ 849

Last change on this file since 849 was 849, checked in by Dominic Hargreaves, 15 years ago

Tidies up various template bugs (closes #132, #133)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1[% USE CGI %]
2<!-- METADATA STARTS -->
3[% IF phone OR fax OR address OR postcode OR formatted_website_text
4       OR hours_text OR map_link OR categories.size OR locales.size OR
5       node_image %]
6<div id="metadata" class="vcard">
7[% IF node_image %]
8        <div id="node_image_box">
9                <img id="node_image" src="[% node_image %]" alt="Picture of [% node_name %]" />
10        </div>
11[% ELSE %]
12        <span id="node_no_image" />
13[% END %]
14
15  <!--- For the vcard --->
16  <span class="fn" style="display:none">[% node_name %]</span>
17[% IF phone OR fax OR address OR postcode OR formatted_website_text
18      OR hours_text OR map_link %]
19  <ul id="general_metadata">
20
21    [% IF phone %]
22      <li class="telephone">
23        <span class="metadata_label">Telephone:</span> <span class="tel">[% CGI.escapeHTML(phone) %]</span>
24      </li>
25    [% END %]
26    [% IF fax %]
27      <li class="fax">
28        <span class="metadata_label">Fax:</span> [% CGI.escapeHTML(fax) %]
29      </li>
30    [% END %]
31    [% IF address %]
32      <li class="address">
33        <span class="metadata_label">Address:</span>
34        <span class="adr"><span class="street-address">[% CGI.escapeHTML(address) %]</span></span><!--, [% default_city %] --> [%# uncomment at left to show city %]
35        [% IF map_link %]
36          <a href="[% map_link %]">(map of this place)</a>
37        [% END %]
38      </li>
39    [% ELSIF map_link %]
40      <li class="map">
41        <span class="metadata_label"><a href="[% map_link %]">Map of this place</a></span>
42      </li>
43    [% END %]
44    [% IF postcode %]
45      <li class="postcode">
46        <span class="metadata_label">Postcode:</span>
47        <span class="adr"><span class="postal-code">[% CGI.escapeHTML(postcode) %]</span></span>
48      </li>
49    [% END %]
50    [% IF formatted_website_text %]
51      <li class="website_link">
52        <span class="metadata_label">Website:</span> <span class="url">[% formatted_website_text %]</span>
53      </li>
54    [% END %]
55    [% IF hours_text %]
56      <li class="opening_hours">
57        <span class="metadata_label">Opening Hours:</span>
58        [% CGI.escapeHTML(hours_text) %]
59      </li>
60    [% END %]
61  </ul>
62[% END %]
63
64[% IF (categories.size AND categories.size > 0)
65   OR (locales.size AND locales.size > 0) %]
66  <ul id="categories_and_locales">
67    [% IF categories.size AND categories.size > 0 %]
68      <li class="categories_list">
69        <span class="metadata_label">Categories:</span>
70        [% FOREACH category = categories %]
71          <a href="[% category.url %]" class="category">[% category.name %]</a>[%- "," UNLESS loop.last %]
72        [% END %]
73      </li>
74    [% END %]
75
76    [% IF locales.size AND locales.size > 0 %]
77      <li class="locales_list">
78        <span class="metadata_label">Locales:</span>
79        [% FOREACH locale = locales %]
80          <a href="[% locale.url %]" class="addr locality">[% locale.name %]</a>[%- "," UNLESS loop.last %]
81        [% END %]
82      </li>
83    [% END %]
84  </ul>
85[% END %]
86</div>
87[% END %]
88<!-- METADATA ENDS -->
Note: See TracBrowser for help on using the repository browser.