Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / authorities-search-results.inc
1 [% BLOCK showreference %]
2 [%# Parameters: %]
3 [%# heading: the heading itself %]
4 [%# linkType: currently 'seefrom' or 'seealso', controls the label for the entry %]
5 [%# type: %]
6 [%# authid: if it is a linked authority, its authid %]
7
8     [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %]
9     [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=' %]
10     [% IF marcflavour == 'UNIMARC' %]
11         [% SWITCH type %]
12             [% CASE 'broader' %]
13               <span class="BT"><abbr title="Broader Term">BT</abbr>: [% heading | html %]</span>
14             [% CASE 'narrower' %]
15               <span class="NT"><abbr title="Narrower Term">NT</abbr>: [% heading | html %]</span>
16             [% CASE 'seefrom' %]
17               <span class="UF"><abbr title="Used For">UF</abbr>: [% heading | html %]</span>
18             [% CASE 'seealso' %]
19               <span class="RT"><abbr title="Related Term">RT</abbr>: [% heading | html %]</span>
20         [% END %]
21     [% ELSE %]
22         <span class="heading">
23         [% IF ( linkType=='seealso' ) %]
24             [% IF ( authid ) %]
25             <a href="[% authidurl | url %][% authid | uri %]">[% heading | html %]</a>
26             [% ELSE %]
27             <a href="[% searchurl | url %][% heading | uri %]">[% heading | html %]</a>
28             [% END %]
29         [% ELSE %]
30             [% heading | html %]
31         [% END %]
32         </span>
33         [% UNLESS ( type=='seefrom' || type=='seealso' ) %]
34             <span class="type">
35                 [% SWITCH type %]
36                     [% CASE 'earlier' %](Earlier heading)
37                     [% CASE 'later' %](Later heading)
38                     [% CASE 'acronym' %](Acronym)
39                     [% CASE 'musical' %](Musical composition)
40                     [% CASE 'broader' %](Broader heading)
41                     [% CASE 'narrower' %](Narrower heading)
42                     [% CASE 'parent' %](Immediate parent body)
43                     [% CASE %]
44                         [% IF type %]([% type | html %])[% END %]
45                     [% END %]
46                 </span>
47         [% END # / UNLESS seefrom %]
48     [% END # / IF marcflavour = 'UNIMARC' %]
49 [% END # / BLOCK showreference %]
50
51 [% BLOCK authresult %]
52     [% IF ( summary.label ) %][% summary.label | html %]:[% END %]
53     [% IF summary.summary %]
54         <div class="authority-summary">
55             [% summary.summary | html %]
56         </div>
57     [% END %]
58     [% UNLESS ( summary.summaryonly ) %]
59         <div class="authorizedheading">
60             [% FOREACH authorize IN summary.authorized %]
61                 <span class="authorizedheading">[% authorize.heading | html %]</span>
62                 [% UNLESS loop.last %] | [% END %]
63             [% END %]
64         </div>
65         [% IF ( marcflavour == 'UNIMARC' ) %]
66             [% IF summary.notes %]
67                 <div class="authres_notes">
68                     [% FOREACH note IN summary.notes %]
69                         <span>[% note.note | html %]</span>
70                     [% END %]
71                 </div>
72             [% END %]
73             [% IF summary.seealso %]
74                 <div class="authres_seealso">
75                     [% FOREACH see IN summary.seealso %]
76                         [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
77                         [% IF ! loop.last %] ; [% END %]
78                     [% END %]
79                 </div>
80             [% END %]
81             [% IF summary.otherscript %]
82                 <div class="authres_otherscript">
83                     [% FOREACH other IN summary.otherscript %]
84                         [% PROCESS language lang=other.lang | trim %]:
85                         [% other.term | html %]
86                         [% IF ! loop.last %] ; [% END %]
87                     [% END %]
88                 </div>
89             [% END %]
90         [% ELSE %]
91             [% IF ( summary.seefrom.size >= 1 ) %]
92                     <span class="seefrom">used for/see from:</span>
93                 [% FOREACH seefro IN summary.seefrom %]
94                     <div class="seefrom authref">
95                     [%# Following on one line for translatability %]
96                     [% PROCESS showreference heading=seefro.heading linkType='seefrom' type=seefro.type %]
97                     </div>
98                 [% END %]
99             [% END %]
100             [% IF ( summary.seealso.size >= 1 ) %]
101                     <span class="seealso">see also:</span>
102                 [% FOREACH seeals IN summary.seealso %]
103                     <div class="seealso authref">
104                     [%# Following on one line for translatability %]
105                     [% PROCESS showreference heading=seeals.heading linkType='seealso' type=seeals.type authid=seeals.authid %]
106                     </div>
107                 [% END %]
108             [% END %]
109         [% END # / IF marcflavour = 'UNIMARC' %]
110     [% END # / UNLESS summary.summaryonly %]
111 [% END # / BLOCK authresult %]