Bug 29939: Use the REST API for ratings
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-auth-detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AdditionalContents %]
5 [% PROCESS 'opac-authorities.inc' %]
6 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %] &rsaquo; Authority search &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %]
12     [% IF ( displayhierarchy ) %]
13         [% Asset.css("lib/jquery/plugins/jstree/themes/default/style.min.css") | $raw %]
14     [% END %]
15 [% END %]
16 [%# FIXME authid is modified when passed authheadingdisplay %]
17 [%# It's then wrong in the JS %]
18 [% SET original_authid = authid %]
19 </head>
20 [% INCLUDE 'bodytag.inc' bodyid='opac-authoritiesdetail' bodyclass='scrollto' %]
21 [% INCLUDE 'masthead.inc' %]
22
23     <div class="main">
24         <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
25             <ol class="breadcrumb">
26                 <li class="breadcrumb-item">
27                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
28                 </li>
29                 <li class="breadcrumb-item">
30                     <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
31                 </li>
32                 <li class="breadcrumb-item active">
33                     <a href="#" aria-current="page">[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %]</a>
34                 </li>
35             </ol>
36         </nav> <!-- /#breadcrumbs -->
37
38         <div class="container-fluid">
39             <div class="row">
40                 [% IF ( OpacNav || OpacNavBottom ) %]
41                     <div class="col col-lg-2 order-2 order-lg-1">
42                         <div id="navigation">
43                             [% INCLUDE 'navigation.inc' %]
44                         </div>
45                     </div>
46                     [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
47                         <div class="col-lg-5 order-first order-md-first order-lg-2">
48                     [% ELSE %]
49                         <div class="col-lg-10 order-first order-md-first order-lg-2">
50                     [% END %]
51                 [% ELSIF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
52                     <div class="col-lg-6 order-first order-md-first order-lg-2">
53                 [% ELSE %]
54                     <div class="col order-first order-md-first order-lg-2">
55                 [% END %]
56                     <div id="userauthdetails" class="maincontent">
57                         <div id="views">
58                             <span class="view">
59                                 <span id="Normalview">Normal view</span>
60                             </span>
61                             <span class="view">
62                                 <a id="MARCview" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid | html %]&amp;marc=1">MARC view</a>
63                             </span>
64                         </div>
65
66                         [% IF ( displayhierarchy ) %]
67                             <div id="hierarchies">
68                                 [% PROCESS showhierarchy trees = loophierarchies %]
69                             </div>
70                         [% END %]
71
72                         <h1>[% summary.mainentry | html %][% IF authtypetext %] ([% authtypetext | html %])[% END %]</h1>
73
74                         <div class="usedin">
75                             [% IF count %]<a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;q=[% authid | uri %]&amp;idx=an,phr">Number of records used in: [% count | html %]</a>[% ELSE %]This authority is not used in any records.[% END %]
76                         </div>
77
78                         <div class="authstanza">
79                             [% FOREACH authorize IN summary.authorized %]
80                                 <div class="heading authorized auth[% seefro.field | html %]">
81                                     <span class="label">Preferred form: </span>
82                                     <span class="authorized">[% authorize.heading | html %]</span>
83                                 </div>
84                             [% END %]
85                             [% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
86                         </div>
87
88                         [% IF summary.seefrom.size %]
89                             <div class="authstanza seefrom">
90                                 <div class="authstanzaheading">Used for/see from:</div>
91                                 <ul class="seefrom">
92                                     [% FOREACH seefro IN summary.seefrom %]
93                                         <li class="heading seefrom auth[% seefro.field | html %]">
94                                             [% IF seefro.type && seefro.type != 'seefrom' %]
95                                                 <span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>
96                                             [% END %]
97                                             <span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
98                                         </li>
99                                     [% END %]
100                                     [% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
101                                 </ul>
102                             </div>
103                         [% END %]
104
105                         [% IF summary.seealso.size %]
106                             <div class="authstanza seealso">
107                                 <div class="authstanzaheading">See also:</div>
108                                 <ul class="seelso">
109                                     [% FOREACH seeals IN summary.seealso %]
110                                         <li class="heading seealso auth[% seeals.field | html %]">
111                                             [% IF seeals.type && seeals.type != 'seealso' %]
112                                                 <span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>
113                                             [% END %]
114                                             <span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
115                                         </li>
116                                     [% END %]
117                                     [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
118                                 </ul>
119                             </div>
120                         [% END %]
121
122                         [% IF marcflavour == 'UNIMARC' && summary.otherscript %]
123                             <div class="authstanza">
124                                 <div class="authstanzaheading">Other forms:</div>
125                                 <ul>
126                                     [% FOREACH otherscrip IN summary.otherscript %]
127                                         <li>
128                                             [% PROCESS language lang=otherscrip.lang | trim %]:
129                                             <span class="otherscript">[% otherscrip.term | html %]</span>
130                                         </li>
131                                     [% END %]
132                                 </ul>
133                             </div>
134                         [% END %]
135
136                         [% IF ( MARCURLS ) %]
137                             <div class="authstanza online_resources">
138                                 <span class="label">Online resources:</span>
139                                 <ul>
140                                     [% FOREACH MARCurl IN MARCURLS %]
141                                         <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
142                                             [% IF ( Koha.Preference('OPACURLOpenInNewWindow') ) %]
143                                                 <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
144                                             [% ELSE %]
145                                                 <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
146                                             [% END %]
147                                             [% MARCurl.linktext | html %]</a>
148                                             [% IF ( MARCurl.notes ) %]
149                                                 <ul>
150                                                     [% FOREACH note IN MARCurl.notes %]
151                                                         <li>[% note.note | html %]</li>
152                                                     [% END %]
153                                                 </ul>
154                                             [% END %]
155                                         </li>
156                                     [% END # /FOREACH MARCURLS %]
157                                 </ul>
158                             </div>
159                         [% END # / IF MARCURLS %]
160
161                         <div id="authdescriptions" class="toptabs">
162                             <ul class="nav nav-tabs" role="tablist">
163                                 <li id="tab_descriptions" class="nav-item" role="presentation">
164                                     <a class="nav-link active" id="descriptions-tab" data-toggle="tab" href="#descriptions" role="tab" aria-controls="descriptions" aria-selected="true" href="#descriptions">Notes</a>
165                                 </li>
166                             </ul>
167                             <div class="tab-content">
168                                 <div class="tab-pane active" role="tabpanel" aria-labelledby="descriptions-tab" id="descriptions">
169                                     <div class="content_set">
170                                         [% FOREACH note IN summary.notes %]
171                                             <p class="note auth[% note.field | html %]">[% note.note | html %]</p>
172                                         [% END %]
173                                     </div>
174                                 </div>
175                             </div> <!-- /.tab-content -->
176                         </div>
177                     </div> <!-- / .#userauthdetails -->
178                 </div> <!-- / .col-lg-10/12 -->
179                 [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
180                     [% IF ( OpacNav || OpacNavBottom ) %]
181                         <div class="col-lg-5 order-lg-3">
182                     [% ELSE %]
183                         <div class="col-lg-6 order-lg-3">
184                     [% END %]
185                         <div class="author_identifier">
186                             <span>Identifiers</span>
187                             <ul>
188                             [% FOR identifier IN author_identifiers %]
189                                 [% PROCESS "authority-identifiers.inc" identifier => identifier %]
190                             [% END %]
191                             </ul>
192                         </div>
193                     </div>
194                 [% END %]
195             </div> <!-- / .row -->
196         </div> <!-- / .container-fluid -->
197     </div> <!-- / .main -->
198
199 [% INCLUDE 'opac-bottom.inc' %]
200 [% BLOCK jsinclude %]
201 [% IF ( displayhierarchy ) %]
202     [% Asset.js("lib/jquery/plugins/jstree/jstree-3.3.12.min.js") | $raw %]
203 [% END %]
204 <script>
205     $(document).ready(function() {
206         [% IF ( displayhierarchy ) %]
207             $('#hierarchies').jstree({
208                 "types" : {
209                     "default" : {
210                         "icon" : "fa fa-file-o"
211                     }
212                 },
213                 "plugins" : [ "types" ]
214             }).on('ready.jstree', function(){
215                 $(this).jstree('open_all');
216                 $("#hier"+[% original_authid | html %]+"_anchor").on("click",
217                     function(e){e.preventDefault(); return false;}
218                 ).css("text-decoration", "none").css("color", "#333");
219                 $(".currentauth").css("text-decoration", "none").css("color", "#333");
220             }).bind("select_node.jstree", function (e, data) {
221                 e.preventDefault();
222                 document.location.href = data.node.a_attr.href;
223             });
224         [% END %]
225     });
226 </script>
227 [% END %]