[Rt-commit] rtir branch 5.0/custom-checkbox created. 5.0.1-60-g5fe31874

BPS Git Server git at git.bestpractical.com
Wed Dec 29 15:19:24 UTC 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir".

The branch, 5.0/custom-checkbox has been created
        at  5fe3187479e4017226da95294cc853a1f2a44563 (commit)

- Log -----------------------------------------------------------------
commit 5fe3187479e4017226da95294cc853a1f2a44563
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 29 22:14:40 2021 +0800

    Migrate plain checkboxes to bootstrap's custom-checkbox for consistency
    
    The only plain checkbox left is in html/RTIR/Elements/PickRestriction,
    which is a really old element that shall be removed long ago(It's not
    migrated to 5.0 theme either).

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 5a226538..383d6df1 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -161,7 +161,7 @@ my %actions;
 	    my $uri_escaped_email = $escaped_email;
 	    RT::Interface::Web::EscapeURI(\$uri_escaped_email);
             if ( $r->uri =~ /Lookup.html$/ ) {
-                $result .= qq{<input type="checkbox" name="Requestorbox-$escaped_email" unchecked />};
+                $result .= qq{<div class="custom-control custom-checkbox d-inline-block"><input type="checkbox" class="custom-control-input" id="Requestorbox-$escaped_email" name="Requestorbox-$escaped_email" /> <label class="custom-control-label" for="Requestorbox-$escaped_email"></label></div>};
             }
             $result .= qq{ <a class="button btn btn-sm btn-primary" href="}.
                 RT::IR->HREFTo( "Create.html"
diff --git a/html/RTIR/Elements/ShowChildren b/html/RTIR/Elements/ShowChildren
index f70296ea..cd28c9e7 100644
--- a/html/RTIR/Elements/ShowChildren
+++ b/html/RTIR/Elements/ShowChildren
@@ -46,10 +46,18 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % if( $ShowStatusesSelector ) {
-%   foreach my $s ( $LifecycleObj->Valid ) {
-%       my $checked = (grep { $_ eq $s } @Statuses)? 'checked': '';
-<input type="checkbox" name="Statuses" value="<% $s %>" <% $checked %> /> <% $s %>
-%   }
+<div class="form-row">
+% foreach my $s ( $LifecycleObj->Valid ) {
+  <div class="col-auto">
+%   my $checked = (grep { $_ eq $s } @Statuses)? 'checked': '';
+%   my $id = CSSClass("Status-$s");
+    <div class="custom-control custom-checkbox">
+      <input type="checkbox" class="custom-control-input" id="<% $id %>" name="Statuses" value="<% $s %>" <% $checked %> />
+      <label class="custom-control-label" for="<% $id %>"><% $s %></label>
+    </div>
+  </div>
+% }
+</div>
 <& /Elements/Submit, Name => 'RefineStatus', Label => loc('Filter status') &>
 % }
 
diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index c2247aae..dd6644a8 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -79,8 +79,11 @@ BaseURL       => RT::IR->HREFTo('Incident/BulkAbandon.html'),
 <&| /Widgets/TitleBox, title => loc("Select recipients") &>
 % foreach my $box( @CheckBox ) {
 % my $checked = (scalar grep $_ && $box->{'Value'}, @ReplyToAll )? ' checked' : '';
-<input type="checkbox" name="ReplyToAll" value="<% $box->{'Value'} %>" <% $checked %>" />
-<% $box->{'Title'} %><br />
+% my $id = CSSClass("ReplyToAll-$box->{'Value'}");
+<div class="custom-control custom-checkbox">
+  <input type="checkbox" class="custom-control-input" id="<% $id %>" name="ReplyToAll" value="<% $box->{'Value'} %>" <% $checked %>" />
+  <label class="custom-control-label" for="<% $id %>"><% $box->{'Title'} %></label>
+</div>
 % }
 </&>
 <br />
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index ab33e37b..cca784c3 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -127,8 +127,10 @@
 <div class="form-row">
   <div class="col-12">
     <h4><&|/l&>Incident</&></h4>
-    <input type="checkbox" id="SelectedIncident" name="SelectedIncident" <% $ARGS{SelectedIncident} ? 'checked="checked"' : '' |n %> value="<% $IncidentObj->Id %>">
-    <label for="SelectedIncident"><b><% loc('Add the correspondence/comment to current incident ticket also') %></b></label>
+    <div class="custom-control custom-checkbox">
+      <input type="checkbox" class="custom-control-input" id="SelectedIncident" name="SelectedIncident" value="<% $IncidentObj->Id %>" <% $ARGS{SelectedIncident} ? 'checked="checked"' : '' |n %> />
+      <label class="custom-control-label" for="SelectedIncident"><b><% loc('Add the correspondence/comment to current incident ticket also') %></b></label>
+    </div>
   </div>
 </div>
 
diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
index 07e8ce45..2273e459 100644
--- a/t/009-attachments-processing.t
+++ b/t/009-attachments-processing.t
@@ -203,7 +203,7 @@ $agent->goto_create_rtir_ticket('Countermeasures');
 
     $agent->display_ticket( $inc_id);
     $agent->follow_link_ok({text => 'Reply to Reporters'}, "go to 'Reply to Reporters'");
-    $agent->content_contains( "<input type=\"checkbox\" name=\"SelectedReportsAll\" value=\"1\" checked=\"checked\"",
+    $agent->content_like( qr/<input[^>]+?type="checkbox"[^>]+?name="SelectedReportsAll"[^>]+?value="1"[^>]+?checked="checked"/,
                               'Checkboxes checked for reply all');
 
     my $content = "this is test";

-----------------------------------------------------------------------


hooks/post-receive
-- 
rtir


More information about the rt-commit mailing list