Bug 33892: Use template wrapper for tabs: OPAC authority detail
[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                         [% IF html %]
79                             [% html | $raw %]
80                         [% ELSE %]
81                             <div class="authstanza">
82                                 [% FOREACH authorize IN summary.authorized %]
83                                     <div class="heading authorized auth[% seefro.field | html %]">
84                                         <span class="label">Preferred form: </span>
85                                         <span class="authorized">[% authorize.heading | html %]</span>
86                                     </div>
87                                 [% END %]
88                                 [% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
89                             </div>
90
91                             [% IF summary.seefrom.size %]
92                                 <div class="authstanza seefrom">
93                                     <div class="authstanzaheading">Used for/see from:</div>
94                                     <ul class="seefrom">
95                                         [% FOREACH seefro IN summary.seefrom %]
96                                             <li class="heading seefrom auth[% seefro.field | html %]">
97                                                 [% IF seefro.type && seefro.type != 'seefrom' %]
98                                                     <span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>
99                                                 [% END %]
100                                                 <span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
101                                             </li>
102                                         [% END %]
103                                         [% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
104                                     </ul>
105                                 </div>
106                             [% END %]
107
108                             [% IF summary.seealso.size %]
109                                 <div class="authstanza seealso">
110                                     <div class="authstanzaheading">See also:</div>
111                                     <ul class="seelso">
112                                         [% FOREACH seeals IN summary.seealso %]
113                                             <li class="heading seealso auth[% seeals.field | html %]">
114                                                 [% IF seeals.type && seeals.type != 'seealso' %]
115                                                     <span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>
116                                                 [% END %]
117                                                 <span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
118                                             </li>
119                                         [% END %]
120                                         [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
121                                     </ul>
122                                 </div>
123                             [% END %]
124
125                             [% IF marcflavour == 'UNIMARC' && summary.otherscript %]
126                                 <div class="authstanza">
127                                     <div class="authstanzaheading">Other forms:</div>
128                                     <ul>
129                                         [% FOREACH otherscrip IN summary.otherscript %]
130                                             <li>
131                                                 [% PROCESS language lang=otherscrip.lang | trim %]:
132                                                 <span class="otherscript">[% otherscrip.term | html %]</span>
133                                             </li>
134                                         [% END %]
135                                     </ul>
136                                 </div>
137                             [% END %]
138
139                             [% IF ( MARCURLS ) %]
140                                 <div class="authstanza online_resources">
141                                     <span class="label">Online resources:</span>
142                                     <ul>
143                                         [% FOREACH MARCurl IN MARCURLS %]
144                                             <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
145                                                 [% IF ( Koha.Preference('OPACURLOpenInNewWindow') ) %]
146                                                     <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
147                                                 [% ELSE %]
148                                                     <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
149                                                 [% END %]
150                                                 [% MARCurl.linktext | html %]</a>
151                                                 [% IF ( MARCurl.notes ) %]
152                                                     <ul>
153                                                         [% FOREACH note IN MARCurl.notes %]
154                                                             <li>[% note.note | html %]</li>
155                                                         [% END %]
156                                                     </ul>
157                                                 [% END %]
158                                             </li>
159                                         [% END # /FOREACH MARCURLS %]
160                                     </ul>
161                                 </div>
162                             [% END # / IF MARCURLS %]
163                         [% END %]
164
165                         [% WRAPPER tabs id= "authdescriptions" %]
166                             [% WRAPPER tabs_nav %]
167                                 [% WRAPPER tab_item tabname= "tab_descriptions" bt_active= 1 %]
168                                     <span>Notes</span>
169                                 [% END %]
170                             [% END # /WRAPPER tabs_nav %]
171                             [% WRAPPER tab_panels %]
172                                 [% WRAPPER tab_panel tabname="tab_descriptions" bt_active= 1 %]
173                                     <div class="content_set">
174                                         [% FOREACH note IN summary.notes %]
175                                             <p class="note auth[% note.field | html %]">[% note.note | html %]</p>
176                                         [% END %]
177                                     </div>
178                                 [% END # /tab_panel# %]
179                             [% END # /WRAPPER tab_panels %]
180                         [% END # /WRAPPER tabs#authdescriptions %]
181
182                     </div> <!-- / .#userauthdetails -->
183                 </div> <!-- / .col-lg-10/12 -->
184                 [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
185                     [% IF ( OpacNav || OpacNavBottom ) %]
186                         <div class="col-lg-5 order-lg-3">
187                     [% ELSE %]
188                         <div class="col-lg-6 order-lg-3">
189                     [% END %]
190                         <div class="author_identifier">
191                             <span>Identifiers</span>
192                             <ul>
193                             [% FOR identifier IN author_identifiers %]
194                                 [% PROCESS "authority-identifiers.inc" identifier => identifier %]
195                             [% END %]
196                             </ul>
197                         </div>
198                     </div>
199                 [% END %]
200             </div> <!-- / .row -->
201         </div> <!-- / .container-fluid -->
202     </div> <!-- / .main -->
203
204 [% INCLUDE 'opac-bottom.inc' %]
205 [% BLOCK jsinclude %]
206 [% IF ( displayhierarchy ) %]
207     [% Asset.js("lib/jquery/plugins/jstree/jstree-3.3.12.min.js") | $raw %]
208 [% END %]
209 <script>
210     $(document).ready(function() {
211         [% IF ( displayhierarchy ) %]
212             $('#hierarchies').jstree({
213                 "types" : {
214                     "default" : {
215                         "icon" : "fa fa-file-o"
216                     }
217                 },
218                 "plugins" : [ "types" ]
219             }).on('ready.jstree', function(){
220                 $(this).jstree('open_all');
221                 $("#hier"+[% original_authid | html %]+"_anchor").on("click",
222                     function(e){e.preventDefault(); return false;}
223                 ).css("text-decoration", "none").css("color", "#333");
224                 $(".currentauth").css("text-decoration", "none").css("color", "#333");
225             }).bind("select_node.jstree", function (e, data) {
226                 e.preventDefault();
227                 document.location.href = data.node.a_attr.href;
228             });
229         [% END %]
230     });
231 </script>
232 [% END %]