[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-75-gd608188
BPS Git Server
git at git.bestpractical.com
Mon Oct 30 22:09:49 UTC 2023
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, dynamic-forms-from-config has been updated
via d60818847d08468f88eaca18b43866d1eb14dcbd (commit)
via 63493e9e3425f767d64c5b50a56b50ffa96abc61 (commit)
via c9b9eaa724d826b1309f86b595da561eb811a344 (commit)
via 0768cfff93602b5282da04419426f4b3e5ba2b30 (commit)
via 6b0500aa48aafcfeb1520c3ee5eb9484ad4610fd (commit)
from 1f65090fde5b01ca682b7842248ba67d2e38b2dd (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 d60818847d08468f88eaca18b43866d1eb14dcbd
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 30 18:09:06 2023 -0400
Fix HTML ids for cf elements where it might contain special chars like spaces
diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
index d660fb0..392efdb 100644
--- a/html/Admin/FormTools/Modify.html
+++ b/html/Admin/FormTools/Modify.html
@@ -100,7 +100,7 @@
% }
<hr />
% foreach my $item ( @custom_fields ) {
- <div id="formtools-element-<% $item %>" class="formtools-element" draggable="true" ondragstart="formTools.dragstart(event);" ondragend="formTools.dragend(event);" data-value="<% JSON({ type => 'component', comp_name => 'Field', arguments => { name => $item } }) %>">
+ <div id="formtools-element-<% CSSClass($item) %>" class="formtools-element" draggable="true" ondragstart="formTools.dragstart(event);" ondragend="formTools.dragend(event);" data-value="<% JSON({ type => 'component', comp_name => 'Field', arguments => { name => $item } }) %>">
<p class="formtools-element-placeholder m-1 p-2 border rounded"><% loc('Place here') %></p>
<p class="m-1 p-2 border rounded">
<span class="badge badge-primary"><% loc('Custom Field') %></span>
@@ -113,7 +113,7 @@
</a>
</p>
</div>
- <div class="modal fade formtools-element-modal" id="formtools-element-<% $item %>-modal" tabindex="-1" role="dialog">
+ <div class="modal fade formtools-element-modal" id="formtools-element-<% CSSClass($item) %>-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form class="formtools-element-form">
commit 63493e9e3425f767d64c5b50a56b50ffa96abc61
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 30 18:03:42 2023 -0400
Show informative custom labels on element list on Modify page
diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
index c83bff4..d660fb0 100644
--- a/html/Admin/FormTools/Modify.html
+++ b/html/Admin/FormTools/Modify.html
@@ -60,7 +60,7 @@
<p class="formtools-element-placeholder m-1 p-2 border rounded"><% loc('Place here') %></p>
<p class="m-1 p-2 border rounded">
<span class="badge badge-primary"><% loc('Custom Field') %></span>
- <% $item %>
+ <% $item %> <span class="label"></span>
<a href="#" class="edit" data-toggle="modal" data-target="#formtools-element-modal">
<span class="fas fa-pencil-alt" alt="<% loc('Edit') %>" data-toggle="tooltip" data-placement="top" data-original-title="<% loc('Edit') %>"></span>
</a>
@@ -104,7 +104,7 @@
<p class="formtools-element-placeholder m-1 p-2 border rounded"><% loc('Place here') %></p>
<p class="m-1 p-2 border rounded">
<span class="badge badge-primary"><% loc('Custom Field') %></span>
- <% $item %>
+ <% $item %> <span class="label"></span>
<a href="#" class="edit" data-toggle="modal" data-target="#formtools-element-modal">
<span class="fas fa-pencil-alt" alt="<% loc('Edit') %>" data-toggle="tooltip" data-placement="top" data-original-title="<% loc('Edit') %>"></span>
</a>
@@ -292,8 +292,11 @@
% }
% } elsif ( $item->{type} eq 'hidden' ) {
<% $item->{'input-name'} %>: <% $item->{'input-value'} %>
-% } else {
+% } elsif ( $item->{type} eq 'component' && $item->{comp_name} eq 'Field' ) {
<% $item->{arguments}{name} || $item->{comp_name} %>
+ <span class="label"><% $item->{arguments}{label} ? "($item->{arguments}{label})" : '' %></span>
+% } else {
+ <% $item->{comp_name} %>
% }
</span>
% if ( $item->{type} eq 'raw_html' || ( $item->{type} eq 'component' && $item->{comp_name} eq 'Field' ) || $item->{type} eq 'hidden' ) {
diff --git a/static/js/rt-extension-formtools.js b/static/js/rt-extension-formtools.js
index 9a227f0..a10d523 100644
--- a/static/js/rt-extension-formtools.js
+++ b/static/js/rt-extension-formtools.js
@@ -102,8 +102,10 @@ formTools = {
const label = form.find(':input[name=label]').val();
if ( label.length ) {
value.arguments.label = label;
+ element.find('span.label').text('(' + label + ')');
}
else {
+ element.find('span.label').text('');
delete value.arguments.label;
}
commit c9b9eaa724d826b1309f86b595da561eb811a344
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 30 17:29:14 2023 -0400
Change submit buttons in modals from "Save" to "Update"
It doesn't actually save from the modal, but the "Save" button implies
that it does.
diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
index 2b98c37..c83bff4 100644
--- a/html/Admin/FormTools/Modify.html
+++ b/html/Admin/FormTools/Modify.html
@@ -46,7 +46,7 @@
</&>
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control"><% loc('Update') %></button>
</div>
</form>
</div>
@@ -91,7 +91,7 @@
</&>
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control"><% loc('Update') %></button>
</div>
</form>
</div>
@@ -143,7 +143,7 @@
</&>
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control"><% loc('Update') %></button>
</div>
</form>
</div>
@@ -188,7 +188,7 @@
</&>
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control"><% loc('Update') %></button>
</div>
</form>
</div>
@@ -257,7 +257,7 @@
</form>
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control" data-dismiss="modal"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control" data-dismiss="modal"><% loc('Update') %></button>
</div>
</form>
</div>
@@ -365,7 +365,7 @@
% }
</div>
<div class="modal-footer">
- <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
+ <button type="submit" class="btn btn-primary button form-control"><% loc('Update') %></button>
</div>
</form>
</div>
commit 0768cfff93602b5282da04419426f4b3e5ba2b30
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 30 17:24:26 2023 -0400
Fix edit links for items just added
The links are not in modals.
diff --git a/static/js/rt-extension-formtools.js b/static/js/rt-extension-formtools.js
index a177839..9a227f0 100644
--- a/static/js/rt-extension-formtools.js
+++ b/static/js/rt-extension-formtools.js
@@ -54,6 +54,7 @@ formTools = {
const old_id = source_copy.id;
source_copy.id = 'formtools-element-' + area.dataset.pageId + '-' + Date.now();
jQuery(source_copy).attr('ondragenter', 'formTools.dragenter(event);');
+ jQuery(source_copy).find('a.edit').attr('data-target', '#' + source_copy.id + '-modal' );
if ( sibling ) {
area.insertBefore(source_copy, sibling);
}
@@ -64,7 +65,6 @@ formTools = {
const modal_copy = jQuery('#' + old_id + '-modal').clone(true);
jQuery('div.modal-wrapper:visible').append(modal_copy);
modal_copy.attr('id', source_copy.id + '-modal' );
- modal_copy.find('a.edit').attr('data-target', '#' + source_copy.id + '-modal' );
modal_copy.find('form.formtools-element-form').on('submit', formTools.elementSubmit);
modal_copy.modal('show');
modal_copy.attr('ondragenter', 'formTools.dragenter(event);');
commit 6b0500aa48aafcfeb1520c3ee5eb9484ad4610fd
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 30 16:53:23 2023 -0400
Center p tags on form pages
It looks strange for left justified p tags with a short bit of text.
diff --git a/static/css/rt-extension-formtools.css b/static/css/rt-extension-formtools.css
index 57e41b1..4e6f8ff 100644
--- a/static/css/rt-extension-formtools.css
+++ b/static/css/rt-extension-formtools.css
@@ -72,3 +72,7 @@ div .formtools-admin-description {
#formtools-edit .card-body {
padding: 15px 15px 15px 15px;
}
+
+#formtools-form-body p {
+ text-align: center;
+}
-----------------------------------------------------------------------
Summary of changes:
html/Admin/FormTools/Modify.html | 25 ++++++++++++++-----------
static/css/rt-extension-formtools.css | 4 ++++
static/js/rt-extension-formtools.js | 4 +++-
3 files changed, 21 insertions(+), 12 deletions(-)
hooks/post-receive
--
rt-extension-formtools
More information about the Bps-public-commit
mailing list