Bug 13406: (follow-up) Add styling classes to authority MARC detail display
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / detail.tt
index 7a712c8..00da448 100644 (file)
@@ -1,63 +1,18 @@
+[% USE raw %]
+[% USE Asset %]
+[% SET footerjs = 1 %]
 [% PROCESS 'authorities.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Authorities &rsaquo;
     [% IF ( unknownauthid ) %]
       Unknown authority record
     [% ELSE %]
-      Details for authority #[% authid %] ([% authtypetext %])
+      Details for authority #[% authid | html %] ([% authtypetext | html %])
     [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% IF ( displayhierarchy ) %]
-<script language="javascript" type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
-[% END %]
-<script type="text/javascript">
-
-//<![CDATA[
-
-        $(document).ready(function() {
-    $('#authoritiestabs').tabs();
-    [% IF ( displayhierarchy ) %]
-        var current_nodes = [];
-        $('.currentauth').each(function() {
-            current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
-            });
-        $('#hierarchies').jstree({
-                "plugins": [ "themes", "html_data"],
-                "themes": { "theme": "classic",
-                            "icons": false },
-                "core": { "initially_open": current_nodes }
-            });
-    [% END %]
-        });
-
-function confirm_deletion() {
-       var is_confirmed = confirm('Are you sure you want to delete this authority?');
-       if (is_confirmed) {
-               window.location="authorities-home.pl?op=delete&authid=[% authid %]";
-       }
-}
-function Dopop(link) {
-       newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
-}
-//]]>
-</script>
-<script type="text/javascript">
-function Help() {
-    newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
-}
-
-function addauthority() {
-    X = document.forms[0].authtype.value;
-    window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
-}
-function searchauthority() {
-    X = document.forms[0].authtype2.value;
-    Y = document.forms[0].value.value;
-    window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
-}
-</script>
 </head>
+
 <body id="auth_detail" class="auth">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'authorities-search.inc' %]
@@ -65,15 +20,13 @@ function searchauthority() {
     [% IF ( unknownauthid ) %]
       Unknown authority record
     [% ELSE %]
-      Details for authority #[% authid %] ([% authtypetext %])
+      Details for authority #[% authid | html %] ([% authtypetext | html %])
     [% END %]
 </div>
 
-<div id="doc" class="yui-t7">
-
-<div id="bd">
-        <div id="yui-main">
-        <div class="yui-g">
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-md-8 col-md-offset-2">
 
     [% INCLUDE 'authorities-toolbar.inc' %]
        
@@ -85,32 +38,38 @@ function searchauthority() {
 
 
 [% IF ( unknownauthid ) %]
-    <div class="dialog message">The authority record you requested does not exist ([% errauthid %]).</div>
+    <div class="dialog message">The authority record you requested does not exist ([% errauthid | html %]).</div>
 [% ELSE %]
-<h1>Authority #[% authid %] ([% authtypetext %])</h1>
+<h1>Authority #[% authid | html %] ([% authtypetext | html %])</h1>
 
 <div id="action">
-    
-    
-    Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid %]">[% count %] record(s)</a>
+    [% IF count %]
+        Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid | html %]">[% count | html %] record(s)</a>
+    [% ELSE %]
+        This authority is not used in any records.
+    [% END %]
 </div>
 
 <div id="authoritiestabs" class="toptabs numbered">
     <ul>
         [% FOREACH BIG_LOO IN BIG_LOOP %]
             <li>
-                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
+                <a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a>
             </li>
         [% END %]
     </ul>
 
 [% FOREACH BIG_LOO IN BIG_LOOP %]
-    <div id="tab[% BIG_LOO.number %]XX">
+    <div id="tab[% BIG_LOO.number | html %]XX">
     [% FOREACH innerloo IN BIG_LOO.innerloop %]
-        [% IF ( innerloo.tag ) %]
+        [% IF ( innerloo.tag_number ) %]
             <div class="tag">
             <div class="tag_title">
-                [% innerloo.tag %]
+                <span class="tag_num">[% innerloo.tag_number | html %]</span>
+                [% IF (innerloo.defined("ind1") ) %]
+                    <span class="tag_ind1">[% innerloo.ind1 %]</span><span class="tag_ind2">[% innerloo.ind2 | html %]</span>
+                [% END %]
+                [% IF (innerloo.tag_desc) %]<span class="dashwrapper"> -</span> <span class="tag_desc">[% innerloo.tag_desc | html %]</span>[% END %]
             </div>
         [% ELSE %]
             <div class="tag">
@@ -118,16 +77,16 @@ function searchauthority() {
         [% FOREACH subfiel IN innerloo.subfield %]
             <p>
                 <label class="labelsubfield">&nbsp;
-                [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield %]</b>[% END %]
-                <span title="[% subfiel.long_desc %]">[% subfiel.short_desc %]</span></label>
-                [% subfiel.marc_value %]
+                [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield | html %]</b>[% END %]
+                <span title="[% subfiel.long_desc | html %]" class="desc">[% subfiel.short_desc | html %]</span></label>
+                [% subfiel.marc_value | html %]
                 [% IF ( subfiel.link ) %]
-                    <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 %]">
-                        <img border="0" src="[% interface %]/[% theme %]/images/filefind.png" height="15" title="Search on [% subfiel.marc_value %]">
+                    <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&amp;marclist=[% subfiel.link | html %]&amp;operator==&amp;type=intranet&amp;value=[% subfiel.marc_value |url %]">
+                        <img src="[% interface | html %]/[% theme | html %]/images/filefind.png" height="15" title="Search on [% subfiel.marc_value | html %]">
                     </a>
                 [% END %]
                 [% IF ( subfiel.authority ) %]
-                    <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority %]" class="button">Auth</a>
+                    <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% subfiel.authority | html %]" class="button">Auth</a>
                 [% END %]
             </p>
         [% END %]
@@ -139,6 +98,29 @@ function searchauthority() {
 </div>
 </div>
 [% END %]
-</div>
+
+[% MACRO jsinclude BLOCK %]
+    [% INCLUDE 'authorities_js.inc' %]
+    [% IF ( displayhierarchy ) %]
+        [% Asset.js("lib/jquery/plugins/jquery.jstree.js") | $raw %]
+    [% END %]
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $('#authoritiestabs').tabs();
+            [% IF ( displayhierarchy ) %]
+                var current_nodes = [];
+                $('.currentauth').each(function() {
+                    current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+                    });
+                $('#hierarchies').jstree({
+                        "plugins": [ "themes", "html_data"],
+                        "themes": { "theme": "classic",
+                                    "icons": false },
+                        "core": { "initially_open": current_nodes }
+                    });
+            [% END %]
+         });
+    </script>
+[% END %]
 
 [% INCLUDE 'intranet-bottom.inc' %]