[Rt-commit] rt branch 5.0/center-values-on-custom-field-edit-page created. rt-5.0.2-65-g58d082f836

BPS Git Server git at git.bestpractical.com
Sat Feb 12 00:49:55 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/center-values-on-custom-field-edit-page has been created
        at  58d082f8362948f9e6ddac1130545f672ac2d010 (commit)

- Log -----------------------------------------------------------------
commit 58d082f8362948f9e6ddac1130545f672ac2d010
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Tue Dec 22 14:17:44 2020 -0600

    Center values on custom field edit page
    
    This commit corrects the col definitions to center the add and edit
    values form rows on the custom field edit page.
    
    Additionally, if categories are enabled and the custom field is not
    a combobox, the description size will be col-4 instead of 6 to
    allow for the additional 2 cols.

diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index 324630a7ab..9f82dd8532 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -281,9 +281,10 @@ jQuery( function() {
 <&| /Widgets/TitleBox, title => 'Values', class => 'custom-field-info-values', content_class => 'mx-auto width-lg' &>
 <div class="form-row">
   <div class="col-1"></div>
-  <div class="edit_custom_field_values col-11">
+  <div class="edit_custom_field_values col-10">
     <& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &>
   </div>
+  <div class="col-1"></div>
 </div>
 </&>
 % }
diff --git a/share/html/Admin/Elements/AddCustomFieldValue b/share/html/Admin/Elements/AddCustomFieldValue
index d102f78d91..64d062d5cc 100644
--- a/share/html/Admin/Elements/AddCustomFieldValue
+++ b/share/html/Admin/Elements/AddCustomFieldValue
@@ -47,18 +47,22 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="form-row">
   <div class="col-1"></div>
-  <div class="col-11">
+  <div class="col-10">
 <form name="AddCustomFieldValue" action="Modify.html" method="post">
 <input type="hidden" class="hidden" name="id" value="<% $CustomField->id %>" />
 
+% # we need to allow for an extra col-2 if not combobox and categories are enabled
+% # if so, make the description cols -2 smaller to allow for categories
+% my $description_col_size = ( $CustomField->Type ne 'Combobox' && $Categories ? 4 : 6 );
+
   <div class="form-row">
     <div class="label col-1 text-left">
       <&|/l&>Sort</&>
     </div>
-    <div class="label col-3 text-left">
+    <div class="label col-4 text-left">
       <&|/l&>Name</&>
     </div>
-    <div class="label col-3 text-left">
+    <div class="label col-<% $description_col_size %> text-left">
       <&|/l&>Description</&>
     </div>
 % if ( $CustomField->Type ne 'Combobox' && $Categories ) {
@@ -73,10 +77,10 @@
     <div class="value col-1">
       <input class="form-control" type="text" size="3"  name="<% $paramtag %>-SortOrder" />
     </div>
-    <div class="value col-3">
+    <div class="value col-4">
       <input class="form-control" type="text" size="25" name="<% $paramtag %>-Name" />
     </div>
-    <div class="value col-3">
+    <div class="value col-<% $description_col_size %>">
       <input class="form-control" type="text" size="45" name="<% $paramtag %>-Description" />
     </div>
 % if ( $CustomField->Type ne 'Combobox' && $Categories ) {
@@ -89,13 +93,14 @@
       </select>
     </div>
 % }
-    <div class="col-2">
+    <div class="col-1">
       <input type="submit" class="btn btn-primary btn-sm form-control" name="AddValue" value="<&|/l&>Add</&>" />
     </div>
   </div>
 % $m->callback(CallbackName => 'AfterCustomFieldValueInput', CustomFieldObj => $CustomField, ARGSRef => \%ARGS );
 </form>
 </div>
+  <div class="col-1"></div>
 </div>
 
 <script type="text/javascript">
diff --git a/share/html/Admin/Elements/EditCustomFieldValues b/share/html/Admin/Elements/EditCustomFieldValues
index 48d904acad..6b3d44bcc1 100644
--- a/share/html/Admin/Elements/EditCustomFieldValues
+++ b/share/html/Admin/Elements/EditCustomFieldValues
@@ -50,6 +50,10 @@
 %    return;
 % }
 
+% # we need to allow for an extra col-2 if not combobox and categories are enabled
+% # if so, make the description cols -2 smaller to allow for categories
+% my $description_col_size = ( $CustomField->Type ne 'Combobox' && $Categories ? 4 : 6 );
+
 <div class="form-row">
   <div class="label col-auto">
     <div class="custom-control custom-checkbox">
@@ -63,7 +67,7 @@
   <div class="label col-3 text-left">
     <&|/l&>Name</&>
   </div>
-  <div class="label col-3 text-left">
+  <div class="label col-<% $description_col_size %> text-left">
     <&|/l&>Description</&>
   </div>
 % if ( $CustomField->Type ne 'Combobox' && $Categories ) {
@@ -88,7 +92,7 @@
   <div class="value col-3">
     <input class="form-control" type="text" size="25" name="<% $paramtag %>-Name" value="<% $value->Name %>" />
   </div>
-  <div class="value col-3">
+  <div class="value col-<% $description_col_size %>">
     <input class="form-control" type="text" size="45" name="<% $paramtag %>-Description" value="<% $value->Description || '' %>" />
   </div>
 % if ( $CustomField->Type ne 'Combobox' && $Categories ) {
@@ -103,7 +107,7 @@
     </select>
   </div>
 % }
-  <div class="col-2">
+  <div class="col-1">
     <input type="button" class="delete_custom_field_value button btn btn-primary" data-cfv-id="<% $value->id %>" value="<&|/l&>Delete</&>" onclick="delete_custom_field_value(<% $value->id %>)" />
   </div>
 % $m->callback(CallbackName => 'AfterCustomFieldValueInput', CustomFieldObj => $CustomField, CustomFieldValueObj => $value, ARGSRef => \%ARGS );

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list