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