From b72e26020a17c805241c06e58a80e716a0704911 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 11 Sep 2019 14:41:25 -0400 Subject: [PATCH] View file updates Updating ui elements from Chuck's work on serverstats --- views/ui/f6/callout.html | 1 + views/ui/f6/checkbox.html | 10 +++++++- views/ui/f6/form-edit-end.html | 6 +++++ views/ui/f6/form-edit-start.html | 30 +++++++++++++++++++++++ views/ui/f6/form-end.html | 5 +++- views/ui/f6/form-summary-end.html | 6 +++++ views/ui/f6/form-summary-start.html | 30 +++++++++++++++++++++++ views/ui/f6/grid-end.html | 10 ++++++-- views/ui/f6/grid-start.html | 28 ++++++++++++++++++---- views/ui/f6/multiselect.html | 4 +++- views/ui/f6/number.html | 3 ++- views/ui/f6/radioButtons.html | 37 +++++++++++++++++++++++++++++ views/ui/f6/section-start.html | 20 +++++++++++----- views/ui/f6/sub-section-end.html | 8 +++++++ views/ui/f6/sub-section-start.html | 29 ++++++++++++++++++++++ views/ui/f6/submit.html | 2 +- views/ui/f6/text.html | 17 +++++++++---- 17 files changed, 225 insertions(+), 21 deletions(-) create mode 100644 views/ui/f6/form-edit-end.html create mode 100644 views/ui/f6/form-edit-start.html create mode 100644 views/ui/f6/form-summary-end.html create mode 100644 views/ui/f6/form-summary-start.html create mode 100644 views/ui/f6/radioButtons.html create mode 100644 views/ui/f6/sub-section-end.html create mode 100644 views/ui/f6/sub-section-start.html diff --git a/views/ui/f6/callout.html b/views/ui/f6/callout.html index ed1c4465..a28b94db 100644 --- a/views/ui/f6/callout.html +++ b/views/ui/f6/callout.html @@ -15,3 +15,4 @@

{$ui.label}

{/if} + diff --git a/views/ui/f6/checkbox.html b/views/ui/f6/checkbox.html index af36c45f..28d050bd 100644 --- a/views/ui/f6/checkbox.html +++ b/views/ui/f6/checkbox.html @@ -17,7 +17,15 @@
- +
+
diff --git a/views/ui/f6/form-edit-start.html b/views/ui/f6/form-edit-start.html new file mode 100644 index 00000000..ef15fca4 --- /dev/null +++ b/views/ui/f6/form-edit-start.html @@ -0,0 +1,30 @@ +{* + Foundation 6 UI - Form Edit Start + + Starts the edit version of the form. There's also a Form Summary Start which starts a summary of the data. + These two are used together to let the user toggle between a summary of the data and a form to edit the data. + + The area between "Form Edit Start" and "Form Edit End" is intended to be a collection of + desired Foundation 6 based HTML that will display actual form. + + {$ui = [ + 'id' => string required Form ID - Use the same ID for the form summary and edit sections, + title' => string Optional title + ]} +*} +
+
+
+ + {if !empty($ui.title)}{$ui.title}{/if} +
+ diff --git a/views/ui/f6/form-end.html b/views/ui/f6/form-end.html index 323f6ebb..608a1a25 100644 --- a/views/ui/f6/form-end.html +++ b/views/ui/f6/form-end.html @@ -1,2 +1,5 @@ -{* Form End *} +{* + Foundation 6 UI - Form End + +*} diff --git a/views/ui/f6/form-summary-end.html b/views/ui/f6/form-summary-end.html new file mode 100644 index 00000000..6a92b470 --- /dev/null +++ b/views/ui/f6/form-summary-end.html @@ -0,0 +1,6 @@ +{* + Foundation 6 UI - Form Summary End + +*} +
+
diff --git a/views/ui/f6/form-summary-start.html b/views/ui/f6/form-summary-start.html new file mode 100644 index 00000000..2e4a216c --- /dev/null +++ b/views/ui/f6/form-summary-start.html @@ -0,0 +1,30 @@ +{* + Foundation 6 UI - Form Summary Start + + Starts the summary only version of the form. There's also a Form Edit Start which starts the actual edit and submit form. + These two are used together to let the user toggle between a summary of the data and a form to edit the data. + + The area between "Form Summary Start" and "Form Summary End" is intended to be a single UI element that contains any + desired Foundation 6 based HTML that will a text only summary (no form fields) summry of the current form data. + + {$ui = [ + 'id' => string required Form id + 'title' => string Optional title + ]} +*} +
+
+
+ + {if !empty($ui.title)}{$ui.title}{/if} +
+ diff --git a/views/ui/f6/grid-end.html b/views/ui/f6/grid-end.html index 7b1f70f6..1de0587d 100644 --- a/views/ui/f6/grid-end.html +++ b/views/ui/f6/grid-end.html @@ -1,5 +1,11 @@ {* - Foundation 6 - Grid End -
+ Foundation 6 UI - Grid End + + {$ui = [ + 'noFoundationInit' => boolean Do not init Foundation 6 + Only the last "grid-end" should do the init. If you have multiple "grid-end" then + be sure to set this value to true for all but the last one. + ]} + *}
diff --git a/views/ui/f6/grid-start.html b/views/ui/f6/grid-start.html index 5b2b823f..636e19e4 100644 --- a/views/ui/f6/grid-start.html +++ b/views/ui/f6/grid-start.html @@ -2,7 +2,7 @@ Foundation 6 UI - Grid Start {$ui = [ - 'nowrap' => string True if no sections should wrap to the right, + 'nowrap' => boolean True if no sections should wrap to the right, 'backgroundColor' => string Background color of overall grid area, 'sectionColor' => string background color of sections ]} @@ -34,6 +34,25 @@ .glm-f6-ui-section-start { background-color: {$glm_f6_ui_section_color} !important; } + .glm-f6-ui-section-start-nobackgroundcolor { + background-color: transparent !important; + } + .glm-f6-ui-form-summary-start { + margin-bottom: 1rem; + } + .glm-f6-ui-form-edit-start { + margin-bottom: 1rem; + } + .glm-f6-ui-form-summary-title { + margin-left: 1rem; + font-size: 1.1rem; + font-weight: bold; + } + .glm-f6-ui-form-edit-title { + margin-left: 1rem; + font-size: 1.1rem; + font-weight: bold; + } .glm-f6-ui-field { margin-bottom: 1rem !important; } @@ -78,8 +97,9 @@ .glm-f6-ui-text-line { margin-bottom: 1rem !important; } + .glm-f6-ui-nowrap { + whitespace: nowrap; + } -
+
{*
*} - - diff --git a/views/ui/f6/multiselect.html b/views/ui/f6/multiselect.html index a38d0e6e..71c5e79d 100644 --- a/views/ui/f6/multiselect.html +++ b/views/ui/f6/multiselect.html @@ -28,7 +28,9 @@ name="{$ui.field}[]" multiple="multiple" size="{$ui.l_size}" - {if $ui.required}required{/if} > + {if $ui.required}required{/if} + onChange="glmFormDataChangesPending = true;" + > {if $ui.l_blank}{/if} diff --git a/views/ui/f6/number.html b/views/ui/f6/number.html index 695d84c6..9b10d89d 100644 --- a/views/ui/f6/number.html +++ b/views/ui/f6/number.html @@ -71,6 +71,7 @@ {if isset($ui.max)}max="{$ui.max}"{/if} {if !empty($ui.step)}step="{$ui.step}"{/if} style="width: {$ui.width}rem;" + onChange="glmFormDataChangesPending = true;" >
@@ -85,4 +86,4 @@
{/if} -
\ No newline at end of file +
diff --git a/views/ui/f6/radioButtons.html b/views/ui/f6/radioButtons.html new file mode 100644 index 00000000..4a4c0dd4 --- /dev/null +++ b/views/ui/f6/radioButtons.html @@ -0,0 +1,37 @@ +{* + Foundation 6 Radio Buttons Field + + {$ui = [ + 'field' => string Name of field, + 'label' => string Label text for this field, + 'value' => string Value for this field, + 'default' => string Default value - Must match a key in "list" + 'list' => array Array of list 'key'=>'Option name' pairs + 'required' => boolean True if required, + 'helpText' => string Help text for this input, + 'errorText' => string Error text that appears when the field doesn't validate, + 'dataError' => string Error from data Abstract Class, + 'noWrap' => boolean True if options should not be on separate lines + ]} +*} +{if !empty($ui.default)}{$thisValue = $ui.default}{/if} +{if !empty($ui.value)}{$thisValue = $ui.value}{/if} +
+ + {if isset($ui.list) && $ui.list} + {foreach $ui.list as $checkbox => $checkboxLabel} + + + {if empty($ui.noWrap)}
{/if} + {/foreach} + {/if} + {if !empty($ui.dataError)}{$ui.dataError}{/if} + {if !empty($ui.helpText)}

{$ui.helpText}

{/if} + {if !empty($ui.errorText)}{$ui.errorText}{/if} +
 
+
diff --git a/views/ui/f6/section-start.html b/views/ui/f6/section-start.html index 7445ff85..948d8bfa 100644 --- a/views/ui/f6/section-start.html +++ b/views/ui/f6/section-start.html @@ -1,24 +1,32 @@ {* - Foundation 6 UI - Form Section Start + Foundation 6 UI - Section Start {$ui = [ 'title' => string Section title text, + 'wrapSize' => integer Override width of subsection in columns, 1 to 12 only., + 'callout' => boolean Use callout background - default true - set to false for no callout or background color 'helpText' => string Additional text to describe this section, - 'tip' => String to display when hover over question mark on right + 'tip' => string String to display when hover over question mark on right ]} *} -
+{$glm_f6_ui_section_wrapsize = {$glm_f6_ui_wrapsize} scope="global"} +{if isset($ui.wrapSize) && $ui.wrapSize} + {$glm_f6_ui_section_wrapsize = $ui.wrapSize scope="global"} +{/if} +
{if !isset($ui.title)} Field Error: Required field information not supplied! {else}
+

+ {$ui.title} {if isset($ui.tip)} - ? + ? {/if} -

{$ui.title}

+ {if isset($ui.helpText)}

{$ui.helpText}

{/if}
{/if} -
+
diff --git a/views/ui/f6/sub-section-end.html b/views/ui/f6/sub-section-end.html new file mode 100644 index 00000000..685ab800 --- /dev/null +++ b/views/ui/f6/sub-section-end.html @@ -0,0 +1,8 @@ +{* + Foundation 6 UI - Form Sub-Section End + No parameters are needed for Sub-Section-End +*} +
+
+
+
\ No newline at end of file diff --git a/views/ui/f6/sub-section-start.html b/views/ui/f6/sub-section-start.html new file mode 100644 index 00000000..5eb4d76b --- /dev/null +++ b/views/ui/f6/sub-section-start.html @@ -0,0 +1,29 @@ +{* + Foundation 6 UI - Form Sub-Section Start + + {$ui = [ + 'title' => string Sub-Section title text, + 'wrapSize' => integer Width of subsection in columns, 1 to 12 only. + 'helpText' => string Additional text to describe this sub-section, + 'tip' => string String to display when hover over question mark on right + ]} +*} +{$glm_f6_ui_subsection_wrapsize = 12 scope="global"} +{if isset($ui.wrapSize) && $ui.wrapSize} + {$glm_f6_ui_subsection_wrapsize = $ui.wrapSize scope="global"} +{/if} +
+
+ {if !isset($ui.title)} + Field Error: Required field information not supplied! + {else} +
+ {if isset($ui.tip)} + ? + {/if} +

{$ui.title}

+ {if isset($ui.helpText)}

{$ui.helpText}

{/if} +
+ {/if} +
+
diff --git a/views/ui/f6/submit.html b/views/ui/f6/submit.html index ce778c6a..7b9ce679 100644 --- a/views/ui/f6/submit.html +++ b/views/ui/f6/submit.html @@ -22,7 +22,7 @@ diff --git a/views/ui/f6/text.html b/views/ui/f6/text.html index 65382d7f..91791828 100644 --- a/views/ui/f6/text.html +++ b/views/ui/f6/text.html @@ -11,7 +11,8 @@ 'pattern' => string Pattern attribute ( number, etc. ) 'placeholder' => string Placeholder string, 'required' => boolean True if required, - 'maxWidth' => string Size of input field using standard style notation ('900px', '15rem', ...), + 'wrapSize' => integer Width of column, 1 to 12 only. + 'maxWidth' => string Size of input field using standard style notation ('900px', '15rem', '95%', ...), 'maxLength' => integer Maximum number of characters that may be entered, 'helpText' => string Help text for this input, 'errorText' => string Error text that appears when the field doesn't validate, @@ -19,9 +20,14 @@ 'tip' => string String to display when hover over question mark on right 'class' => string Additional Classes for the main cell div 'inputClass' => string Additional Classes for the input + 'default' => string Default text if none provided ]} *} -
+{$glm_f6_ui_text_wrapsize = 12 scope="global"} +{if isset($ui.wrapSize) && $ui.wrapSize} + {$glm_f6_ui_text_wrapsize = $ui.wrapSize scope="global"} +{/if} +
{if (!isset($ui.value) && !isset($ui.field)) || !isset($ui.label)} Field Error: Required field information not supplied! {else} @@ -30,7 +36,7 @@ {if isset($ui.tip)} ? {/if} - +
@@ -56,3 +63,5 @@
{/if}
+ + -- 2.17.1