[Bps-public-commit] rt-extension-formtools branch sort-items-in-showchoices updated. 1.04-2-g8a01141
BPS Git Server
git at git.bestpractical.com
Wed Feb 21 20:18:23 UTC 2024
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-formtools".
The branch, sort-items-in-showchoices has been updated
via 8a0114111c066f357ff537e2828afa3ce4d66de0 (commit)
from dbfebe2146e0b9ec83b5f8f34af106eced6d2f8e (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 8a0114111c066f357ff537e2828afa3ce4d66de0
Author: Jason Crome <jcrome at bestpractical.com>
Date: Wed Feb 21 15:17:14 2024 -0500
Organize ShowChoices by page
This will make it easier on the user to identify where a field was
located on the form. Don't show pages that have no fields on them.
diff --git a/html/FormTools/ShowChoices b/html/FormTools/ShowChoices
index f5e13c8..f54a206 100644
--- a/html/FormTools/ShowChoices
+++ b/html/FormTools/ShowChoices
@@ -1,10 +1,8 @@
-<%init>
-my $queue = $m->notes('queue');
-
-my @fields;
-
-my $pages = $DECODED_ARGS->{'form_config'}{'formtools-pages'};
-for my $page ( sort { $pages->{$a}{'sort_order'} <=> $pages->{$b}{'sort_order'} } keys %$pages ) {
+% my $queue = $m->notes('queue');
+% my $pages = $DECODED_ARGS->{'form_config'}{'formtools-pages'};
+% for my $page ( sort { $pages->{$a}{'sort_order'} <=> $pages->{$b}{'sort_order'} } keys %$pages ) {
+<%perl>
+ my @fields;
my @elements = @{ $pages->{$page}{'content'} };
for my $element (@elements) {
my $input_name;
@@ -35,9 +33,15 @@ for my $page ( sort { $pages->{$a}{'sort_order'} <=> $pages->{$b}{'sort_order'}
push @fields, { name => $name, value => $DECODED_ARGS->{$input_name} };
}
}
-}
+</%perl>
-</%init>
+% if( @fields ) {
+<h4><% $pages->{ $page }{'name'} %></h4>
+<div>
% foreach my $field (@fields) {
<& /Elements/LabeledValue, Label => loc($field->{name}), ValueSpanClass => 'current-value', Value => ref $field->{value} ? join(', ', @{$field->{value}}) : $field->{value} &>
% }
+</div><br />
+% }
+% }
+
-----------------------------------------------------------------------
Summary of changes:
html/FormTools/ShowChoices | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
hooks/post-receive
--
rt-extension-formtools
More information about the Bps-public-commit
mailing list