Bug 19785: Move template JavaScript to the footer: Authorities, part 1
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / detail.tt
1 [% SET footerjs = 1 %]
2 [% PROCESS 'authorities.inc' %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Authorities &rsaquo;
5     [% IF ( unknownauthid ) %]
6       Unknown authority record
7     [% ELSE %]
8       Details for authority #[% authid %] ([% authtypetext %])
9     [% END %]
10 </title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="auth_detail" class="auth">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'authorities-search.inc' %]
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> &rsaquo;
18     [% IF ( unknownauthid ) %]
19       Unknown authority record
20     [% ELSE %]
21       Details for authority #[% authid %] ([% authtypetext %])
22     [% END %]
23 </div>
24
25 <div id="doc" class="yui-t7">
26
27 <div id="bd">
28         <div id="yui-main">
29         <div class="yui-g">
30
31     [% INCLUDE 'authorities-toolbar.inc' %]
32         
33 [% IF ( displayhierarchy ) %]
34 <div id="hierarchies">
35 [% PROCESS showhierarchy trees = loophierarchies %]
36 </div>
37 [% END %]
38
39
40 [% IF ( unknownauthid ) %]
41     <div class="dialog message">The authority record you requested does not exist ([% errauthid %]).</div>
42 [% ELSE %]
43 <h1>Authority #[% authid %] ([% authtypetext %])</h1>
44
45 <div id="action">
46     [% IF count %]
47         Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid %]">[% count %] record(s)</a>
48     [% ELSE %]
49         This authority is not used in any records.
50     [% END %]
51 </div>
52
53 <div id="authoritiestabs" class="toptabs numbered">
54     <ul>
55         [% FOREACH BIG_LOO IN BIG_LOOP %]
56             <li>
57                 <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
58             </li>
59         [% END %]
60     </ul>
61
62 [% FOREACH BIG_LOO IN BIG_LOOP %]
63     <div id="tab[% BIG_LOO.number %]XX">
64     [% FOREACH innerloo IN BIG_LOO.innerloop %]
65         [% IF ( innerloo.tag ) %]
66             <div class="tag">
67             <div class="tag_title">
68                 [% innerloo.tag %]
69             </div>
70         [% ELSE %]
71             <div class="tag">
72         [% END %]
73         [% FOREACH subfiel IN innerloo.subfield %]
74             <p>
75                 <label class="labelsubfield">&nbsp;
76                 [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %]
77                 <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></label>
78                 [% subfiel.marc_value %]
79                 [% IF ( subfiel.link ) %]
80                     <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&amp;marclist=[% subfiel.link %]&amp;operator==&amp;type=intranet&amp;value=[% subfiel.marc_value |url %]">
81                         <img src="[% interface %]/[% theme %]/images/filefind.png" height="15" title="Search on [% subfiel.marc_value %]">
82                     </a>
83                 [% END %]
84                 [% IF ( subfiel.authority ) %]
85                     <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a>
86                 [% END %]
87             </p>
88         [% END %]
89         </div>
90     [% END %]
91     </div>
92 [% END %]
93 </div>
94 </div>
95 </div>
96 [% END %]
97 </div>
98
99 [% MACRO jsinclude BLOCK %]
100     [% INCLUDE 'authorities_js.inc' %]
101     [% IF ( displayhierarchy ) %]
102         <script type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.jstree_[% KOHA_VERSION %].js"></script>
103     [% END %]
104     <script type="text/javascript">
105         $(document).ready(function() {
106             $('#authoritiestabs').tabs();
107             [% IF ( displayhierarchy ) %]
108                 var current_nodes = [];
109                 $('.currentauth').each(function() {
110                     current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
111                     });
112                 $('#hierarchies').jstree({
113                         "plugins": [ "themes", "html_data"],
114                         "themes": { "theme": "classic",
115                                     "icons": false },
116                         "core": { "initially_open": current_nodes }
117                     });
118             [% END %]
119          });
120     </script>
121 [% END %]
122
123 [% INCLUDE 'intranet-bottom.inc' %]