LP1901710: Properly nest HTML tags and TT2 directives
authorJason Boyer <JBoyer@equinoxinitiative.org>
Fri, 30 Oct 2020 20:06:17 +0000 (16:06 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 26 May 2021 19:20:04 +0000 (15:20 -0400)
This is a first pass at cleaning these up and the W3C's
HTML validator is a lot happier about some of the pages,
but the advanced search page at least needs some TLC.

I'm having trouble getting the shelving location selector
to appear at all and the aria complaints will require more
fixing.

Signed-off-by: Jason Boyer <JBoyer@equinoxinitiative.org>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2
Open-ILS/src/templates-bootstrap/opac/parts/advanced/global_row.tt2
Open-ILS/src/templates-bootstrap/opac/parts/advanced/search.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/extras.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2
Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2
Open-ILS/src/templates-bootstrap/opac/results.tt2

index bc9cad1..3bf6f2b 100755 (executable)
@@ -781,7 +781,7 @@ for now until a better color is picked - if needed.
     padding: 5px;
 }
 
-#adv_special_block {
+.adv_special_block {
     
     padding: 5px;
     margin-top: 5px;
@@ -1836,6 +1836,8 @@ div.result_table_utils_cont {
 }
 
 #search-wrapper #search-submit-go,
+#search-wrapper #search-submit-go-1,
+#search-wrapper #search-submit-go-2,
 #search-wrapper #search-submit-go-depth {
     display: inline-block;
     margin-top: 1.3rem;
index dcc7d59..5329770 100755 (executable)
@@ -57,7 +57,7 @@
         </div>
     </td>
     <td class="px-2">
-        <a href="javascript:;" class="btn btn-remove btn-sm" aria-label="Remove This Row"
+        <a href="javascript:;" class="btn btn-remove btn-sm"
             title="[% l('Remove row') %]"
             aria-label="[% l('Remove row') %]"
             onclick='return killRowIfAtLeast(2, this);'>
index 9e97ddd..7308164 100755 (executable)
             </table>
         </div>
     </div>
-<div id='adv_search_submit' class="my-3">
+<div class="my-3">
         <input type="hidden" name="_adv" value="1" />
-        <input id="detail" type="hidden" name="detail_record_view"
+        <input type="hidden" name="detail_record_view"
                value="[% show_detail_view %]"/>
         <span>
-            <button id='search-submit-go' type="submit" class="btn btn-confirm"
-                onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'><i class="fas fa-search"></i> [% l("Submit") %]</button>
-            <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
+            <button id='search-submit-go-1' type="submit" class="btn btn-confirm"
+                onclick='setTimeout(function(){$("search-submit-spinner-1").className=""; $("search-submit-go-1").className="hidden"}, 2000)'><i class="fas fa-search"></i> [% l("Submit") %]</button>
+            <img id='search-submit-spinner-1' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
                 class='hidden' alt="[% l('Search in progress icon') %]"/>
         </span>
 
@@ -88,7 +88,7 @@
                     [% IF adv_chunk.adv_special == "lib_selector"; PROCESS "opac/parts/org_selector.tt2"; INCLUDE build_org_selector show_loc_groups=0 show_lassos=0 id=adv_chunk.id %]
                     [% ELSIF adv_chunk.adv_special == "scope_selector"; PROCESS "opac/parts/org_selector.tt2"; INCLUDE build_scope_selector show_loc_groups=1 show_lassos=1 id=adv_chunk.id %]
                     [% ELSIF adv_chunk.adv_special == "pub_year"; %]
-                    <div id='adv_special_block' class="text-center form-inline">
+                    <div class="adv_special_block text-center form-inline">
                             <select name='pubdate' class='form-control' id="[% adv_chunk.id %]" onchange='if(this.selectedIndex == 3) $("#adv_global_pub_date_2_span").removeClass("hide_me"); else $("#adv_global_pub_date_2_span").addClass("hide_me");'>
                             [%  FOR opt IN [
                                     {"code" => "is", "label" => l("Is")},
                             </select>
 
                             <br/>
-                            <div id='adv_special_block' class="text-center">
+                            <div class="adv_special_block text-center">
                                 <input title="[% l('Search date') %]" class='form-control' placeholder='Year'
                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
         [% END %]
     [% END %]
     </div>
-    <div id='adv_search_submit' class="my-3">
+    <div class="my-3">
         <input type="hidden" name="_adv" value="1" />
-        <input id="detail" type="hidden" name="detail_record_view"
+        <input type="hidden" name="detail_record_view"
                value="[% show_detail_view %]"/>
         <span>
-            <button id='search-submit-go' type="submit" class="btn btn-confirm"
-                onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'><i class="fas fa-search"></i> [% l("Submit") %]</button>
-            <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
+            <button id='search-submit-go-2' type="submit" class="btn btn-confirm"
+                onclick='setTimeout(function(){$("search-submit-spinner-2").className=""; $("search-submit-go-2").className="hidden"}, 2000)'><i class="fas fa-search"></i> [% l("Submit") %]</button>
+            <img id='search-submit-spinner-2' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
                 class='hidden' alt="[% l('Search in progress icon') %]"/>
         </span>
 
index 48f246a..b681ab4 100755 (executable)
                         arrow = arrow_right;
                     END;
                 %]
-            <a id='[% name %]' href='[% href %]' class="text-white" rel="nofollow" vocab="" style="text-decoration:none;">
-           <div class="card-header extra_header">
-
+            <div class="card-header extra_header">
+              <a id='[% name %]' href='[% href %]' class="text-white" rel="nofollow" vocab="" style="text-decoration:none;">
                 <span>[% arrow %] [% extra.label | html %]</span>
-                </a>
+              </a>
             </div>
             [%  IF tab_is_active(name); %]
             <div class='card-body'>
@@ -97,9 +96,9 @@
                         INCLUDE "opac/parts/record/${name}.tt2";
                     END;
                     -%]
-                </div>
-                [% END %]
             </div>
+            [% END %]
+        </div>
         [% END %]
     </div>
 </div>
index 2396e6f..23f521d 100755 (executable)
@@ -375,7 +375,7 @@ ctx.metalinks.push('
                     <div id="[%- ctx.bre_id -%]_ebook_place_hold" class="rdetail_aux_utils ebook_action hidden">
                         <a class="btn btn-action no-dec" role="button" href="[% mkurl(ctx.opac_root _ '/myopac/ebook_place_hold',
                     {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'place_hold'}, stop_parms) %]"
-                             rel="nofollow" vocab="">
+                            rel="nofollow" vocab="">
                             <span class="place_hold"><i class="fas fa-check" aria-hidden="true"></i> [% l('Place Hold on E-Item') %]</span></a>
                     </div>
                
@@ -555,7 +555,6 @@ ctx.metalinks.push('
                             ELSE;
                             filtered_link;
                             END;
-                            END;
                             -%]
                         </a>
                         [%-# ' - <span property="description">' _ filtered_note _ '</span>' IF filtered_note %]
@@ -563,7 +562,7 @@ ctx.metalinks.push('
                         [%- IF attrs.gtin13; '
                         <meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
                         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
-                [%- END %]
+                [%- END; END; %]
                 [%- IF num_uris > 1 %]</ul>[% END %]
         </div>
         [%
@@ -572,7 +571,10 @@ ctx.metalinks.push('
         END;
         %]
     </div>
+</div>
 <hr>
-<div class="col-12">
-    [%- INCLUDE "opac/parts/record/extras.tt2" %]
+<div class="row">
+    <div class="col-12">
+        [%- INCLUDE "opac/parts/record/extras.tt2" %]
+    </div>
 </div>
index 70cfa35..67ac027 100755 (executable)
@@ -118,8 +118,8 @@ END;
         <button id='search-submit-go' type="submit" class="btn btn-sm btn-opac"
             onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden";[% IF ctx.depth_sel_button AND NOT took_care_of_form %] $("search-submit-go-depth").className="hidden";[% END %]}, 2000)'><i class="fas fa-search" aria-hidden="true"></i> [% l('Search') %]</button>
         </div>
-        [%- IF ctx.depth_sel_button AND NOT took_care_of_form %]
         <div class="col-auto mr-auto mr-md-1">
+        [%- IF ctx.depth_sel_button AND NOT took_care_of_form %]
         <button id='search-submit-go-depth' type="submit" value="[% ctx.depth_sel_depth %]" name="depth" class="btn btn-sm btn-opac"
             onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"; $("search-submit-go-depth").className="hidden";}, 2000)' title="[% ctx.depth_sel_tooltip | html %]"><i class="fas fa-globe" aria-hidden="true"></i> [% ctx.depth_sel_button_label | html %]</button>
         [%- END %]
index 540c32a..d8c4e74 100755 (executable)
             </div>
             </div>
         </div>
-    </div>
     </form>
     <div class="mx-5">
         <div class="row">