Bug 31678: Convert authority editor tabs to Bootstrap
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% PROCESS 'authorities.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>
7     [% IF ( unknownauthid ) %]
8         Unknown authority record
9     [% ELSE %]
10         Details for authority #[% authid | html %] ([% authtypetext | html %])
11     [% END %] &rsaquo; Authorities &rsaquo; Koha
12 </title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("css/addbiblio.css") | $raw %]
15 [% IF ( displayhierarchy ) %]
16     [% Asset.css("lib/jquery/plugins/jstree/themes/default/style.min.css") | $raw %]
17 [% END %]
18 </head>
19
20 <body id="auth_detail" class="auth">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'authorities-search.inc' %]
23
24 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
25     <ol>
26         <li>
27             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
28         </li>
29         <li>
30             <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
31         </li>
32
33         <li>
34             <a href="#" aria-current="page">
35                 [% IF ( unknownauthid ) %]
36                     Unknown authority record
37                 [% ELSE %]
38                     Details for authority #[% authid | html %] ([% authtypetext | html %])
39                 [% END %]
40             </a>
41         </li>
42     </ol>
43 </nav>
44
45 <div class="main container-fluid">
46     <div class="row">
47         <div class="col-md-8 col-md-offset-2">
48
49             [% INCLUDE 'authorities-toolbar.inc' %]
50
51             [% IF ( displayhierarchy ) %]
52                 <div id="hierarchies">
53                     [% PROCESS showhierarchy trees = loophierarchies %]
54                 </div>
55             [% END %]
56
57
58             [% IF ( unknownauthid ) %]
59                 <h1>Authority does not exist</h1>
60                 <div class="dialog message">The authority record you requested does not exist ([% errauthid | html %]).</div>
61             [% ELSE %]
62
63                 <h1>Authority #[% authid | html %] ([% authtypetext | html %])</h1>
64
65                 <div id="action">
66                     [% IF count %]
67                         Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an:[% authid | uri %]">[% count | html %] record(s)</a>
68                     [% ELSE %]
69                         This authority is not used in any records.
70                     [% END %]
71                 </div>
72
73                 <div id="authoritiestabs" class="toptabs numbered">
74                     <ul class="nav nav-tabs" role="tablist">
75                         [% FOREACH BIG_LOO IN BIG_LOOP %]
76                             <li role="presentation">
77                                 <a href="#tab[% BIG_LOO.number | uri %]XX" aria-controls="tab[% BIG_LOO.number | uri %]XX" role="tab" data-toggle="tab">[% BIG_LOO.number | html %]</a>
78                             </li>
79                         [% END %]
80                     </ul>
81                     <div class="tab-content">
82                         [% FOREACH BIG_LOO IN BIG_LOOP %]
83                             <div id="tab[% BIG_LOO.number | html %]XX" role="tabpanel" class="tab-pane">
84                                 [% FOREACH innerloo IN BIG_LOO.innerloop %]
85                                     [% IF ( innerloo.tag_number ) %]
86                                         <div class="tag">
87                                             <div class="tag_title">
88                                                 <span class="tag_num marc_field">[% innerloo.tag_number | html %]</span>
89                                                 [% IF (innerloo.defined("ind1") ) %]
90                                                     <span class="tag_ind1">[% innerloo.ind1 | html %]</span><span class="tag_ind2">[% innerloo.ind2 | html %]</span>
91                                                 [% END %]
92                                                 [% IF (innerloo.tag_desc) %]
93                                                     <span class="dashwrapper"> -</span> <span class="tag_desc marc_field">[% innerloo.tag_desc | html %]</span>
94                                                 [% END %]
95                                             </div> <!-- /.tag_title -->
96                                     [% ELSE %]
97                                         <div class="tag">
98                                     [% END # /IF ( innerloo.tag_number ) %]
99
100                                         [% FOREACH subfiel IN innerloo.subfield %]
101                                             <div class="auth_subfield">
102                                                 <div class="subfield_info marc_field">
103                                                     [% UNLESS ( subfiel.hide_marc ) %]
104                                                         <span class="marc_subfield">[% subfiel.marc_subfield | html %]</span>
105                                                     [% END %]
106                                                     <span class="marc_subfield_desc">[% subfiel.long_desc | html %]</span>
107                                                 </div> <!-- /.subfield_info.marc_field -->
108                                                 <div class="subfield_content marc_field">
109                                                     <span class="subfield_value">
110                                                         [% IF ( subfiel.is_url ) %]
111                                                             <a href="[% subfiel.marc_value | url %]">[% subfiel.marc_value | html %]</a>
112                                                         [% ELSE %]
113                                                             [% subfiel.marc_value | html %]
114                                                         [% END %]
115                                                     </span>
116                                                 </div> <!-- /.subfield_content.marc_field -->
117                                             </div> <!-- /.auth_subfield -->
118                                         [% END #/FOREACH subfiel %]
119                                     </div> <!-- /.tag -->
120                                 [% END # /FOREACH innerloo %]
121                             </div> <!-- /.tab-pane -->
122                         [% END # /FOREACH BIG_LOO %]
123                     </div> <!-- /.tab-content -->
124                 </div> <!-- /#authoritiestabs -->
125             [% END # /IF ( unknownauthid ) %]
126         </div> <!-- /.col-md-8 col-md-offset-2 -->
127     </div> <!-- /.row -->
128
129 [% MACRO jsinclude BLOCK %]
130     [% INCLUDE 'authorities_js.inc' %]
131     [% IF ( displayhierarchy ) %]
132         [% Asset.js("lib/jquery/plugins/jstree/jstree-3.3.12.min.js") | $raw %]
133     [% END %]
134     <script>
135         $(document).ready(function() {
136             if( $(".tab-pane.active").length < 1 ){
137                 $("#authoritiestabs a:first").tab("show");
138             }
139
140             var editAuth = $("#editAuth");
141             var editAuthLink = editAuth.attr("href");
142
143             $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
144                 var newTabId = $(this).attr("href");
145                 editAuth.attr("href", editAuthLink + newTabId );
146             });
147
148             [% IF ( displayhierarchy ) %]
149                 $('#hierarchies').jstree({
150                     "types" : {
151                         "default" : {
152                             "icon" : "fa fa-file-o"
153                         }
154                     },
155                     "plugins" : [ "types" ]
156                 }).on('ready.jstree', function(){
157                     $(this).jstree('open_all');
158                     $("#hier"+[% authid | html %]+"_anchor").on("click",
159                         function(e){e.preventDefault(); return false;}
160                     ).css("text-decoration", "none").css("color", "#333");
161                     $(".currentauth").css("text-decoration", "none").css("color", "#333");
162                 }).bind("select_node.jstree", function (e, data) {
163                     e.preventDefault();
164                     document.location.href = data.node.a_attr.href;
165                 });
166             [% END # /IF ( displayhierarchy ) %]
167          });
168     </script>
169 [% END %]
170
171 [% INCLUDE 'intranet-bottom.inc' %]