Bug 14257: Follow-up - Add documentation, fix typo, fix test
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-MARCdetail.tt
index d731c7d..f4ca095 100644 (file)
@@ -1,9 +1,10 @@
 [% USE Koha %]
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›  MARC details for record no. [% biblionumber %]
+[% INCLUDE 'doc-head-open.inc' %]
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  MARC details for record no. [% biblionumber %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %][% END %]
 </head>
-<body id="opac-marcdetail" class="scrollto">
+[% INCLUDE 'bodytag.inc' bodyid='opac-marcdetail' bodyclass='scrollto' %]
 [% INCLUDE 'masthead.inc' %]
 <div class="main">
     <ul class="breadcrumb">
                                 <table id="items" class="table table-bordered table-condensed table-striped">
                                     <caption>Holdings</caption>
                                         <tr>
-                                            [% FOREACH item_header_loo IN item_header_loop %]
-                                                <th>
-                                                    [% item_header_loo.header_value %]
-                                                </th>
+                                            [% FOREACH header IN item_header_loop %]
+                                                <th>[% header %]</th>
                                             [% END %]
                                         </tr>
-                                        [% FOREACH item_loo IN item_loop %]
+                                        [% FOREACH item IN item_loop %]
                                             <tr>
-                                                [% item_loo.item_value %]
+                                                [% FOREACH sf_code IN item_subfield_codes %]
+                                                    <td>[% item.$sf_code %]</td>
+                                                [% END %]
                                             </tr>
                                         [% END %]
                                 </table>
                             [% ELSE %]
-                                <p>No copies available.</p>
+                                <p>No items available.</p>
                             [% END %]
                         </div> <!-- / #catalogue_detail_biblio -->
                     </div> <!-- / #usermarcdetail -->
@@ -182,23 +183,26 @@ $(document).ready(function(){
     });
 
     var loaded = 0;
-    $("#switchview").toggle(
-      function () {
-        $(this).text(_("view labeled"));
-        $("#labeledmarc").hide();
-        if(!loaded){
-            $("#plainmarc").show().html("<div style=\"margin:1em;padding:1em;border:1px solid #EEE;font-size:150%;\"><img src=\"[% interface %]/[% theme %]/images/loading.gif\" /> "+_("Loading")+"...</div>").load("/cgi-bin/koha/opac-showmarc.pl","id=[% biblionumber %]&viewas=html");
-            loaded = 1;
+    var toggle = 0;
+    $("#switchview").on("click",function(e){
+        e.preventDefault();
+        if( toggle == 0){
+            $(this).text(_("view labeled"));
+            $("#labeledmarc").hide();
+            if(!loaded){
+                $("#plainmarc").show().html("<div style=\"margin:1em;padding:1em;border:1px solid #EEE;font-size:150%;\"><img src=\"[% interface %]/[% theme %]/images/loading.gif\" /> "+_("Loading")+"...</div>").load("/cgi-bin/koha/opac-showmarc.pl","id=[% biblionumber %]&viewas=html");
+                loaded = 1;
+            } else {
+                $("#plainmarc").show();
+            }
+            toggle = 1;
         } else {
-            $("#plainmarc").show();
+            $(this).text(_("view plain"));
+            $("#labeledmarc").show();
+            $("#plainmarc").hide();
+            toggle = 0;
         }
-      },
-      function () {
-        $(this).text(_("view plain"));
-        $("#labeledmarc").show();
-        $("#plainmarc").hide();
-      }
-    );
+    });
 });
 [% END %]
 //]]>