[Bps-public-commit] rt-extension-createbyproblemtype branch master updated. 1.03-4-gda5ccdb

BPS Git Server git at git.bestpractical.com
Fri Apr 29 22:18:38 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-extension-createbyproblemtype".

The branch, master has been updated
       via  da5ccdb8ba7c9d4e02d488de24089d68851cf1d1 (commit)
       via  ac640062ceb524c0945f6dd6d73a725b095e35f9 (commit)
       via  70296f4f2e5a0e74dc8eef6273d04ef4a2fcce99 (commit)
       via  d916916ee47009406d0e78993515e4a13a293061 (commit)
      from  9fcc203ca500f7c2a881b2924d342dc77134023c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit da5ccdb8ba7c9d4e02d488de24089d68851cf1d1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 30 06:07:55 2022 +0800

    Add odd/even css classes to problem options
    
    This is to make striped option customization easier.

diff --git a/html/Elements/SelectProblem b/html/Elements/SelectProblem
index e8fd182..2f96302 100644
--- a/html/Elements/SelectProblem
+++ b/html/Elements/SelectProblem
@@ -1,10 +1,11 @@
 <select name="<% $Name %>" <% $OnChange ? qq{onchange="$OnChange"} : '' |n %> class="select-problem form-control selectpicker">
 % my $in_group;
+% my $i = 0;
 % for my $option ( @options ) {
 % if ( ref $option eq 'HASH' ) {
 %   if ( $in_group ) {
 %   # the bold style on optgroup applies to its children, so we need to set back to normal here.
-    <option style="font-weight: normal !important;"
+    <option style="font-weight: normal !important;" class="<% ++$i % 2 ? 'odd' : 'even' %>"
 %   } else {
     <option class="font-weight-bold" data-divider="true"></option>
     <option class="font-weight-bold"
@@ -14,6 +15,7 @@
 % } elsif ( $option ) {
     <optgroup class="font-weight-bold" label="<% $option %>">
 %   $in_group = 1;
+%   $i = 0;
 % } else {
 %   $in_group = 0;
     </optgroup>

commit ac640062ceb524c0945f6dd6d73a725b095e35f9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 30 05:54:45 2022 +0800

    Split queue and problem options to ease future changes
    
    We are going to add css classes to problem options, separating the
    beginning of <option> makes code cleaner.

diff --git a/html/Elements/SelectProblem b/html/Elements/SelectProblem
index f7d6a6b..e8fd182 100644
--- a/html/Elements/SelectProblem
+++ b/html/Elements/SelectProblem
@@ -2,11 +2,14 @@
 % my $in_group;
 % for my $option ( @options ) {
 % if ( ref $option eq 'HASH' ) {
-%   if ( !$in_group ) {
+%   if ( $in_group ) {
+%   # the bold style on optgroup applies to its children, so we need to set back to normal here.
+    <option style="font-weight: normal !important;"
+%   } else {
     <option class="font-weight-bold" data-divider="true"></option>
-%   }
-% # the bold style on optgroup applies to its children, so we need to set back to normal here.
-    <option <% $in_group ? 'style="font-weight: normal !important;"' : 'class="font-weight-bold"' |n %> <% $Default eq $option->{value} ? 'selected="selected"' : '' |n %> value="<% $option->{value} %>"><% $option->{label} %></option>
+    <option class="font-weight-bold"
+% }
+    <% $Default eq $option->{value} ? 'selected="selected"' : '' |n %> value="<% $option->{value} %>"><% $option->{label} %></option>
 }
 % } elsif ( $option ) {
     <optgroup class="font-weight-bold" label="<% $option %>">

commit 70296f4f2e5a0e74dc8eef6273d04ef4a2fcce99
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 30 05:48:29 2022 +0800

    Mark queues bold to make them more distinguishale

diff --git a/html/Elements/SelectProblem b/html/Elements/SelectProblem
index cfe78e6..f7d6a6b 100644
--- a/html/Elements/SelectProblem
+++ b/html/Elements/SelectProblem
@@ -3,12 +3,13 @@
 % for my $option ( @options ) {
 % if ( ref $option eq 'HASH' ) {
 %   if ( !$in_group ) {
-    <option data-divider="true"></option>
+    <option class="font-weight-bold" data-divider="true"></option>
 %   }
-    <option <% $Default eq $option->{value} ? 'selected="selected"' : '' |n %> value="<% $option->{value} %>"><% $option->{label} %></option>
+% # the bold style on optgroup applies to its children, so we need to set back to normal here.
+    <option <% $in_group ? 'style="font-weight: normal !important;"' : 'class="font-weight-bold"' |n %> <% $Default eq $option->{value} ? 'selected="selected"' : '' |n %> value="<% $option->{value} %>"><% $option->{label} %></option>
 }
 % } elsif ( $option ) {
-    <optgroup label="<% $option %>">
+    <optgroup class="font-weight-bold" label="<% $option %>">
 %   $in_group = 1;
 % } else {
 %   $in_group = 0;

commit d916916ee47009406d0e78993515e4a13a293061
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 30 05:42:05 2022 +0800

    Add dividers for queues not having "Problem Type"

diff --git a/html/Elements/SelectProblem b/html/Elements/SelectProblem
index 02330d1..cfe78e6 100644
--- a/html/Elements/SelectProblem
+++ b/html/Elements/SelectProblem
@@ -1,10 +1,17 @@
 <select name="<% $Name %>" <% $OnChange ? qq{onchange="$OnChange"} : '' |n %> class="select-problem form-control selectpicker">
+% my $in_group;
 % for my $option ( @options ) {
 % if ( ref $option eq 'HASH' ) {
+%   if ( !$in_group ) {
+    <option data-divider="true"></option>
+%   }
     <option <% $Default eq $option->{value} ? 'selected="selected"' : '' |n %> value="<% $option->{value} %>"><% $option->{label} %></option>
+}
 % } elsif ( $option ) {
     <optgroup label="<% $option %>">
+%   $in_group = 1;
 % } else {
+%   $in_group = 0;
     </optgroup>
 % }
 % }

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

Summary of changes:
 html/Elements/SelectProblem | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
rt-extension-createbyproblemtype


More information about the Bps-public-commit mailing list