Bug 22764: More YUI grid cleanup
authorOwen Leonard <oleonard@myacpl.org>
Wed, 24 Apr 2019 13:19:38 +0000 (13:19 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 11:36:23 +0000 (11:36 +0000)
This patch cleans up a few places where templates still contain YUI grid
markup. Some other minor markup problems are also fixed.

 - additional-fields.tt:
   - Converts YUI grid to Bootstrap
   - Replaces obsolete <tt> tag with styled <span>
   - Adds _() function to string in embedded JavaScript

 - detail.tt:
   - Fixes some stray YUI grid classes
   - Fixes corresponding JavaScript to enable page adjustments

 - moredetail.tt:
   - Removes unnecessary YUI grid markup

To test, apply the patch and view the affected pages, confirming that
everything looks correct and that the page adjusts well to various
browser widthds.

When testing the bibliographic detail page, enable AmazonCoverImages and
view a record with and without an Amazon cover image. The layout should
work in both cases.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

index d8f3f0d..a20264c 100755 (executable)
         [% END %]
     </div>
 
-    <div id="doc3" class="yui-t2">
-    <div id="bd">
-    <div id="yui-main">
-    <div class="yui-b">
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
+
     [% IF op == 'list' %]
         <div id="toolbar" class="btn-toolbar">
             <a class="btn btn-default" id="newfields" href="?op=add_form&amp;tablename=[% tablename | uri %]"><i class="fa fa-plus"></i> Create field</a>
@@ -65,7 +66,7 @@
         <h3>Additional fields</h3>
         <p>Select a table:</p>
         [% BLOCK table_option %]
-            <li><a href="?tablename=[% value | uri %]">[% content | html %] (<tt>[% value | html %]</tt>)</a></li>
+            <li><a href="?tablename=[% value | uri %]">[% content | html %] (<span class="ex">[% value | html %]</span>)</a></li>
         [% END %]
         <ul>
             [% IF CAN_user_acquisition_order_manage %]
         </form>
     [% END %]
 
-    </div>
-    </div>
+            </main>
+        </div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+        <div class="col-sm-2 col-sm-pull-10">
+            <aside>
+                [% INCLUDE 'admin-menu.inc' %]
+            </aside>
+        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+    </div> <!-- /.row -->
 
-<div class="yui-b">
-[% INCLUDE 'admin-menu.inc' %]
-</div>
-</div>
 
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE "datatables.inc" %]
                 if ( $("#marcfield").length && $("select[name='authorised_value_category']").length ) {
                     if ( $("#marcfield").val().length > 0
                         && $("select[name='authorised_value_category']" ).val().length > 0 ) {
-                        alert("You cannot select an authorised value category and a marcfield");
+                        alert(_("You cannot select an authorised value category and a marcfield") );
                         return false;
                     }
                 }
index 0ffe432..4b4c1da 100644 (file)
@@ -57,6 +57,7 @@
     <div class="row">
         <div class="col-sm-10 col-sm-push-2">
             <main>
+                <div class="row">
 
 [% IF ( unknownbiblionumber ) %]
   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
     [% END %]
 
     [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled ) %]
-        <div class="yui-gc">
-            <div id="catalogue_detail_biblio" class="yui-u first">
+        <div id="catalogue_detail_biblio" class="col-xs-9">
     [% ELSE %]
-        <div class="yui-g">
-            <div id="catalogue_detail_biblio">
+        <div id="catalogue_detail_biblio" class="col-xs-12">
     [% END %]
 
         [% XSLTBloc | $raw %]
         [% END %]
 
         [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled ) %]
-        </div><div class="yui-u" id="bookcoverimg">
+        </div><div class="col-xs-3" id="bookcoverimg">
         [% IF ( LocalCoverImages ) %]
             <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
         [% END %]
 
 [% IF ( subscriptionsnumber ) %]
 <div id="subscriptions">
-<div class="yui-g">
 <div id="catalogue_detail_subscriptions">
     <h2>This is a serial subscription</h2>
     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
     [% END %]
 </div>
 </div>
-</div>
 [% END %]
 
 [% IF Koha.Preference('AcquisitionDetails') %]
 
 </div><!-- /bibliodetails -->
 
-<div class="yui-g" id="export" style="margin-top: 1em;">
+<div id="export" style="margin-top: 1em;">
 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
 <table>  <tr>
-      <th>Save Record</th>   </tr>
+      <th>Save record</th>   </tr>
     <tr><td> Select download format:    <select name="format">
         <option value="mods">MODS (XML)</option>
         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
         <option value="marcxml">MARCXML</option>
         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
-        <input type="submit" name="save" value="Download Record" /></td>
+        <input type="submit" name="save" value="Download record" /></td>
   </tr>
   <tr><td>
     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
                         h = this.height;
                         if ((w == 1) || (h == 1)) {
                             $("#amazon-bookcoverimg").remove();
-                            $(".yui-gb").attr("class","yui-g");
+                            $("#catalogue_detail_biblio").attr("class","col-xs-12");
                         } else if ((this.complete != null) && (!this.complete)) {
                             $("#amazon-bookcoverimg").remove();
-                            $(".yui-gb").attr("class","yui-g");
+                            $("#catalogue_detail_biblio").attr("class","col-xs-12");
                         }
                     }
                 });
index c104cf3..28066ce 100644 (file)
@@ -52,8 +52,8 @@
     [% IF ( ONLY_ONE ) %]
         <div class="dialog message">You are only viewing one item.  <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber | uri %]&amp;bi=[% biblioitemnumber | uri %]#item[% itemnumber | uri %]">View All</a></div>
     [% END %]
+
     [% FOREACH ITEM_DAT IN ITEM_DATA %]
-    <div class="yui-g">
         <h3 id="item[% ITEM_DAT.itemnumber | html %]">Barcode [% ITEM_DAT.barcode | html %]  [% IF ( ITEM_DAT.notforloantext ) %][% ITEM_DAT.notforloantext | html %] [% END %]</h3>
         <div class="listgroup"><h4>Item information [% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% UNLESS ( ITEM_DAT.nomod ) %]
          [% IF ( CAN_user_editcatalogue_edit_items ) %]
                 </li>
             </ol>
             </div>
-        </div>
 </div>
 [% END %]