Bug 10987: (follow-up) fix display of authorities containing only one see from or...
[srvgit] / 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.summary ) %][% summary.summary | html %]:[% END %]
54     [% UNLESS ( summary.summaryonly ) %]
55         <div class="authorizedheading">
56             [% FOREACH authorize IN summary.authorized %]
57                 <span class="authorizedheading">[% authorize.heading | html %]</span>
58             [% END %]
59         </div>
60         [% IF ( marcflavour == 'UNIMARC' ) %]
61             [% IF summary.notes %]
62                 <div class="authres_notes">
63                     [% FOREACH note IN summary.notes %]
64                         [% note.note | html %]</span>
65                     [% END %]
66                 </div>
67             [% END %]
68             [% IF summary.seealso %]
69                 <div class="authres_seealso">
70                     [% FOREACH see IN summary.seealso %]
71                         [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
72                         [% IF ! loop.last %] ; [% END %]
73                     [% END %]
74                 </div>
75             [% END %]
76             [% IF summary.otherscript %]
77                 <div class="authres_otherscript">
78                     [% FOREACH other IN summary.otherscript %]
79                         [% PROCESS language lang=other.lang | trim %]:
80                         [% other.term %]
81                         [% IF ! loop.last %] ; [% END %]
82                     [% END %]
83                 </div>
84             [% END %]
85         [% ELSE %]
86             [% IF ( summary.seefrom.size >= 1 ) %]
87                     <span class="seefrom">used for/see from:</span>
88                 [% FOREACH seefro IN summary.seefrom %]
89                     <div class="seefrom authref">
90                     [% PROCESS showreference
91                         heading=seefro.heading
92                         linkType='seefrom'
93                         type=seefro.type
94                     %]
95                     </div>
96                 [% END %]
97             [% END %]
98             [% IF ( summary.seealso.size >= 1 ) %]
99                     <span class="seealso">see also:</span>
100                 [% FOREACH seeals IN summary.seealso %]
101                     <div class="seealso authref">
102                     [% PROCESS showreference
103                         heading=seeals.heading
104                         linkType='seealso'
105                         type=seeals.type
106                         authid=seeals.authid
107                     %]
108                     </div>
109                 [% END %]
110             [% END %]
111         [% END # / IF marcflavour = 'UNIMARC' %]
112     [% END # / UNLESS summary.summaryonly %]
113 [% END # / BLOCK authresult %]