[Rt-commit] rt branch 5.0/consistent-form-row-space created. rt-5.0.3-200-gb6eb55bdf4

BPS Git Server git at git.bestpractical.com
Fri Dec 9 14:14:01 UTC 2022


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 "rt".

The branch, 5.0/consistent-form-row-space has been created
        at  b6eb55bdf4c1b88fb24d1ef270cf9a6a071c44b7 (commit)

- Log -----------------------------------------------------------------
commit b6eb55bdf4c1b88fb24d1ef270cf9a6a071c44b7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 9 06:10:12 2022 +0800

    Use consistent space among input rows for ticket forms
    
    Previously we used a few .form-group(margin-bottom: 1rem), which wasn't
    consistent with other inputs that use .form-row(margin-top: 0.5rem).
    
    .form-group worked better with previous role inputs as they had extra
    bottom space too, but as role inputs' extra space has been removed in
    010f50f730, .form-group is not needed any more in these forms.

diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index 9d5c3663bc..ab95f19330 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -52,13 +52,13 @@
 <div class="articles-select-article">
 % unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) {
   <div class="form-row">
-    <div class="form-group label col-2"><&|/l&>Include Article:</&></div>
+    <div class="label col-2"><&|/l&>Include Article:</&></div>
     <div class="value col-9"><& /Elements/SelectArticle, QueueObj => $QueueObj, AutoSubmit => 1 &></div>
   </div>
 % }
 % if ( @$topics ) {
   <div class="form-row">
-    <div class="form-group label col-2">
+    <div class="label col-2">
       <&|/l, $QueueObj->Name &>Choose from Topics for [_1]</&>:
     </div>
     <div class="value col-9">
diff --git a/share/html/Search/Bulk.html b/share/html/Search/Bulk.html
index d038d587f5..0eca4003f0 100644
--- a/share/html/Search/Bulk.html
+++ b/share/html/Search/Bulk.html
@@ -229,7 +229,7 @@
 </&>
 <&| /Widgets/TitleBox, title => loc('Add comments or replies to selected tickets') &>
   <div class="form-row">
-    <div class="form-group label col-2">
+    <div class="label col-2">
       <&|/l&>Update Type</&>:
     </div>
     <div class="value col-9">
@@ -241,7 +241,7 @@
   </div>
 
   <div class="form-row">
-    <div class="form-group label col-2">
+    <div class="label col-2">
       <&|/l&>Subject</&>:
     </div>
     <div class="value col-9">
@@ -253,7 +253,7 @@
 % $m->callback( CallbackName => 'BeforeTransactionCustomFields', CustomFields => $TxnCFs );
 % while (my $CF = $TxnCFs->Next()) {
   <div class="form-row">
-    <div class="form-group label col-2">
+    <div class="label col-2">
       <span class="name <% $CF->EntryHint ? 'prev-icon-helper' : '' %>"><% $CF->Name %>:</span>\
 % if ( $CF->EntryHint ) {
 <span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<% $CF->EntryHint %>"></span>
@@ -268,16 +268,14 @@
   </div>
 % } # end if while
 
-  <div class="form-group">
-    <div class="messagebox-container action-<% $ARGS{UpdateType} || 'private' %>">
+  <div class="messagebox-container action-<% $ARGS{UpdateType} || 'private' %>">
 % $m->callback( %ARGS, CallbackName => 'BeforeMessageBox' );
 %# Currently, bulk update always starts with Comment not Reply selected, so we check this unconditionally
 % my $IncludeSignature = RT->Config->Get('MessageBoxIncludeSignatureOnComment');
-      <& /Elements/MessageBox, Name => "UpdateContent", 
-          $ARGS{UpdateContent} ? ( Default => $ARGS{UpdateContent}, IncludeSignature => 0 ) :
-            ( IncludeSignature => $IncludeSignature ),
-      &>
-    </div>
+    <& /Elements/MessageBox, Name => "UpdateContent",
+        $ARGS{UpdateContent} ? ( Default => $ARGS{UpdateContent}, IncludeSignature => 0 ) :
+          ( IncludeSignature => $IncludeSignature ), FullWidth => 1
+    &>
   </div>
 
   <& /Ticket/Elements/AddAttachments, %ARGS &>
diff --git a/share/html/SelfService/Create.html b/share/html/SelfService/Create.html
index 63cff26179..ec5d630f97 100644
--- a/share/html/SelfService/Create.html
+++ b/share/html/SelfService/Create.html
@@ -68,7 +68,7 @@
 </div>
 <% $m->callback( CallbackName => 'AfterQueue', %ARGS, QueueObj => $queue_obj ) %>
 <div class="form-row">
-<div class="form-group label col-2">
+<div class="label col-2">
 <&|/l&>Requestors</&>:
 </div>
 <div class="value col-8">
@@ -76,7 +76,7 @@
 </div>
 </div>
 <div class="form-row">
-<div class="form-group label col-2">
+<div class="label col-2">
 <&|/l&>Cc</&>:
 </div>
 <div class="value col-8">
@@ -84,14 +84,14 @@
 </div>
 </div>
 <div class="form-row">
-<div class="form-group label col-2">
+<div class="label col-2">
 <&|/l&>Subject</&>:
 </div>
-<div class="form-group value col-8">
+<div class="value col-8">
 <input class="form-control" type="text" name="Subject" size="60" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
 </div>
 </div>
-<div class="form-group">
+<div class="">
 <& /Elements/EditCustomFields,
     %ARGS,
     Object          => RT::Ticket->new($session{CurrentUser}),
@@ -103,12 +103,8 @@
     &>
 </div>
 </div>
-<div class="form-group">
-  <& /Elements/MessageBox, Default => $ARGS{Content} || ''  &>
-</div>
-<div class="form-group">
-  <& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &>
-</div>
+<& /Elements/MessageBox, Default => $ARGS{Content} || '', FullWidth => 1  &>
+<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj, FullWidth => 1 &>
 <div class="form-row">
   <div class="col-12">
     <& /Elements/Submit, Label => loc("Create ticket"), Name => 'SubmitTicket' &>
diff --git a/share/html/SelfService/Update.html b/share/html/SelfService/Update.html
index 0bbb46b4a9..7a678a057b 100644
--- a/share/html/SelfService/Update.html
+++ b/share/html/SelfService/Update.html
@@ -72,31 +72,27 @@
         </div>
     </div>
     <div class="form-row">
-        <div class="form-group label col-2">
+        <div class="label col-2">
             <&|/l&>Subject</&>
         </div>
-        <div class="form-group value col-8">
+        <div class="value col-8">
             <input class="form-control" type="text" name="UpdateSubject" size="60" value="<% $ARGS{UpdateSubject} || $Ticket->Subject || '' %>" />
         </div>
 
     </div>
     <& /Elements/EditCustomFields, Object => $Ticket &>
 </div>
-<div class="form-group">
 % if (exists $ARGS{UpdateContent}) {
 % # preserve QuoteTransaction so we can use it to set up sane references/in/reply to
 % my $temp = $ARGS{'QuoteTransaction'};
 % delete $ARGS{'QuoteTransaction'};
-<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS &>
+<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS, FullWidth => 1 &>
 % $ARGS{'QuoteTransaction'} = $temp;
 % } else {
 % my $IncludeSignature = 1;
-<& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS &>
+<& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS, FullWidth => 1 &>
 % }
-</div>
-<div class="form-group">
-  <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &>
-</div>
+<& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket, FullWidth => 1 &>
 
 <div class="form-row">
   <div class="col-12">
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 7999f544db..8ee4ea68c4 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -187,13 +187,13 @@
 % $m->callback( CallbackName => 'ModifyCustomRoles', ARGSRef => \%ARGS, CustomRoles => $roles );
 % while (my $role = $roles->Next) {
 <div class="form-row">
-  <div class="form-group label col-2">
+  <div class="label col-2">
     <span class="<% $role->EntryHint ? 'prev-icon-helper' : '' %>"><% $role->Name %>:</span>\
 % if ($role->EntryHint) {
 <span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<% $role->EntryHint %>"></span>
 % }
   </div>
-  <div class="form-group value col-9"><& /Elements/MultiUserRoleInput, role => $role, Default => $ARGS{$role->GroupType} &></div>
+  <div class="value col-9"><& /Elements/MultiUserRoleInput, role => $role, Default => $ARGS{$role->GroupType} &></div>
 </div>
 % }
 
@@ -208,10 +208,10 @@
 &>
 
 <div class="form-row">
-<div class="form-group label col-2">
+<div class="label col-2">
 <&|/l&>Subject</&>:
 </div>
-<div class="form-group value col-9">
+<div class="value col-9">
 <input class="form-control" type="text" name="Subject" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
 % $m->callback( %ARGS, CallbackName => 'AfterSubject' );
 </div>
@@ -226,19 +226,18 @@
 % if ( RT->Config->Get('ArticleOnTicketCreate')) {
 <& /Articles/Elements/BeforeMessageBox, %ARGS, QueueObj => $QueueObj &>
 % }
-<div class="form-group">
+
 % $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'BeforeMessageBox' );
 % if (exists $ARGS{Content}) {
-<& /Elements/MessageBox, QueueObj => $QueueObj, Default => $ARGS{Content}, IncludeSignature => 0, IncludeDefaultArticle => 0 &>
+<& /Elements/MessageBox, QueueObj => $QueueObj, Default => $ARGS{Content}, IncludeSignature => 0, IncludeDefaultArticle => 0, FullWidth => 1 &>
 % } elsif ( $QuoteTransaction ) {
-<& /Elements/MessageBox, QueueObj => $QueueObj, QuoteTransaction => $QuoteTransaction, IncludeDefaultArticle => 0 &>
+<& /Elements/MessageBox, QueueObj => $QueueObj, QuoteTransaction => $QuoteTransaction, IncludeDefaultArticle => 0, FullWidth => 1 &>
 % } else {
-<& /Elements/MessageBox, QueueObj => $QueueObj, IncludeDefaultArticle => 1 &>
+<& /Elements/MessageBox, QueueObj => $QueueObj, IncludeDefaultArticle => 1, FullWidth => 1 &>
 %}
 % $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'AfterMessageBox' );
-</div>
 
-        <& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $QueueObj &>
+        <& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $QueueObj, FullWidth => 1 &>
       </div>
     </&>
     <div class="form-row">
diff --git a/share/html/Ticket/Forward.html b/share/html/Ticket/Forward.html
index 24ca5efa13..d6428712e2 100644
--- a/share/html/Ticket/Forward.html
+++ b/share/html/Ticket/Forward.html
@@ -97,14 +97,12 @@
   </div>
 % }
 
-  <div class="form-group">
-    <div class="messagebox-container">
+  <div class="messagebox-container">
 % if (exists $ARGS{Content}) {
-<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0, SuppressAttachmentWarning => 1 &>
+<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0, SuppressAttachmentWarning => 1, FullWidth => 1 &>
 % } else {
-<& /Elements/MessageBox, SuppressAttachmentWarning => 1 &>
+<& /Elements/MessageBox, SuppressAttachmentWarning => 1, FullWidth => 1 &>
 %}
-    </div>
   </div>
 </div>
 
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 680aedcf24..9a6a7c8e3c 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -165,7 +165,7 @@
 % $m->callback( %ARGS, CallbackName => 'AfterGnuPG' );
 
 <div class="form-row">
-  <div class="form-group label col-2">
+  <div class="label col-2">
     <&|/l&>Subject</&>:
   </div>
   <div class="value col-9">
@@ -174,25 +174,24 @@
   </div>
 </div>
 <& /Articles/Elements/BeforeMessageBox, %ARGS &>
-<div class="form-group">
+
   <div class="messagebox-container action-<% $type %>">
 % $m->callback( %ARGS, CallbackName => 'BeforeMessageBox' );
 % if (exists $ARGS{UpdateContent}) {
 % # preserve QuoteTransaction so we can use it to set up sane references/in/reply to
 % my $temp = $ARGS{'QuoteTransaction'};
 % delete $ARGS{'QuoteTransaction'};
-    <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&>
+    <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS, FullWidth => 1 &>
 % $ARGS{'QuoteTransaction'} = $temp;
 % } else {
 % my $IncludeSignature = 1;
 % $IncludeSignature = 0 if $Action ne 'Respond' && !RT->Config->Get('MessageBoxIncludeSignatureOnComment');
-    <& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS &>
+    <& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS, FullWidth => 1 &>
 % }
 % $m->callback( %ARGS, CallbackName => 'AfterMessageBox' );
   </div>
-</div>
 
-  <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $TicketObj &>
+  <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $TicketObj, FullWidth => 1 &>
 </&>
 
 % $m->callback( %ARGS, CallbackName => 'BeforeSubmit', Ticket => $TicketObj );

commit 010f50f73035ef17220d28e1f8797b412d32440a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 9 06:09:12 2022 +0800

    Remove extra vertical space of selectized inputs to be consistent with other inputs

diff --git a/share/static/css/elevator-light/selectize.customized.css b/share/static/css/elevator-light/selectize.customized.css
index f54b428b5e..bcd12d0896 100644
--- a/share/static/css/elevator-light/selectize.customized.css
+++ b/share/static/css/elevator-light/selectize.customized.css
@@ -50,3 +50,8 @@
 .selectize-dropdown .active {
   background-color: #cfdeff;
 }
+
+/* Do not add extra space around input */
+.selectize-control {
+    line-height: 0;
+}

commit 0557a609370b3adc4162d2b3b8c843930204f028
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 9 06:07:05 2022 +0800

    Support to wrap textarea/attachment inputs into a form-row for space settings
    
    This is for consistency, as most inputs are in div.form-row.
    
    Like how we added the same feature to /Elements/Submit in master, here
    we use the same $FullWidth param.

diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index f9f1b4b025..2fb0279de1 100644
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -45,6 +45,10 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
+% if ($FullWidth) {
+<div class="form-row">
+  <div class="col-12">
+% }
 <textarea autocomplete="off" class="form-control messagebox <% $Type eq 'text/html' ? 'richtext' : '' %>" <% $SuppressAttachmentWarning ? 'suppress-attachment-warning' : '' %> <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>" placeholder="<% $Placeholder %>">
 % $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $article_id, QueueObj => $QueueObj) if $IncludeArticle;
 % $m->callback( %ARGS, SignatureRef => \$signature, DefaultRef => \$Default, MessageRef => \$message );
@@ -64,6 +68,11 @@
 % if ($Type eq 'text/html') {
 <input type="text" style="display:none" name="<% $Name %>Type" id="<% $Name %>Type" value="<% $m->request_args->{$Name."Type"}||$Type %>" />
 % }
+
+% if ($FullWidth) {
+  </div>
+</div>
+% }
 <%INIT>
 
 my $message = '';
@@ -147,4 +156,5 @@ $SuppressAttachmentWarning => 0
 $Placeholder               => loc('Type your message here')
 $IncludeDefaultArticle     => 0  # Preload a default article based on queue settings
 $QueueObj                  => undef
+$FullWidth                 => undef
 </%ARGS>
diff --git a/share/html/Ticket/Elements/AddAttachments b/share/html/Ticket/Elements/AddAttachments
index 112b1bfb12..138d0d6126 100644
--- a/share/html/Ticket/Elements/AddAttachments
+++ b/share/html/Ticket/Elements/AddAttachments
@@ -59,9 +59,13 @@
 </div>
 % } # end of if
 
-<div class="form-group">
+% if ($FullWidth) {
+<div class="form-row">
+  <div class="col-12">
+% }
         <div class="dropzone" id="attach-dropzone">
         </div>
+
 <script type="text/javascript">
 var MaxAttachmentSizeMiB = RT.Config.MaxAttachmentSize/(1024*1024);
 
@@ -162,13 +166,9 @@ jQuery( function() {
 });
 </script>
         <div class="hidden old-attach">
-          <div class="form-row">
-            <div class="col-12">
-              <div class="custom-file">
-                <input type="file" id="Attach" name="Attach" class="custom-file-input" />
-                <label class="custom-file-label" for="Attach"><&|/l&>Choose file</&></label>
-              </div>
-            </div>
+          <div class="custom-file">
+            <input type="file" id="Attach" name="Attach" class="custom-file-input" />
+            <label class="custom-file-label" for="Attach"><&|/l&>Choose file</&></label>
           </div>
           <div class="form-row">
             <div class="col-12">
@@ -176,7 +176,12 @@ jQuery( function() {
             </div>
           </div>
         </div>
+
+% if ($FullWidth) {
+  </div>
 </div>
+% }
+
 % if ($HasExisting) {
 <div class="form-row">
   <div class="label col-3"><&|/l&>Include attachments</&>:</div>
@@ -197,6 +202,7 @@ $Token => ''
 @AttachExisting => ()
 $QuoteTransaction => ''
 $TicketObj => undef
+$FullWidth => undef
 </%ARGS>
 <%INIT>
 my $attachments;

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list