This commit is contained in:
Roman Pyrih
2024-11-26 16:48:33 +01:00
parent 1994d995d8
commit 22bf30902e
10 changed files with 494 additions and 218 deletions

View File

@@ -30,13 +30,17 @@
{else}
<div class="form-group row {if !empty($field.errors)}has-error{/if}">
<label class="col-md-3 form-control-label{if $field.required} required{/if}" for="field-{$field.name}">
{if $field.type !== 'checkbox'}
{$field.label}
{/if}
</label>
<div class="col-md-6{if ($field.type === 'radio-buttons')} form-control-valign{/if}">
<div class="form-group {if !empty($field.errors)}has-error{/if}">
{if $field.type !== 'checkbox'}
<label class="{if $field.required} required{/if}" for="field-{$field.name}">
{if $field.type !== 'checkbox'}
{$field.label}
{if $field.required}*{/if}
{/if}
</label>
{/if}
{* <div class="col-md-6{if ($field.type === 'radio-buttons')} form-control-valign{/if}"> *}
{if $field.type === 'select'}
@@ -68,33 +72,38 @@
{elseif $field.type === 'radio-buttons'}
{block name='form_field_item_radio'}
{foreach from=$field.availableValues item="label" key="value"}
<label class="radio-inline" for="field-{$field.name}-{$value}">
<span class="custom-radio">
<input
name="{$field.name}"
id="field-{$field.name}-{$value}"
type="radio"
value="{$value}"
{if $field.required}required{/if}
{if $value eq $field.value} checked {/if}
>
<span></span>
</span>
{$label}
</label>
{/foreach}
<div class="form-check">
{foreach from=$field.availableValues item="label" key="value"}
<label class="radio-inline" for="field-{$field.name}-{$value}">
<span class="custom-radio">
<input
name="{$field.name}"
id="field-{$field.name}-{$value}"
type="radio"
value="{$value}"
{if $field.required}required{/if}
{if $value eq $field.value} checked {/if}
>
<span></span>
</span>
{$label}
</label>
{/foreach}
</div>
{/block}
{elseif $field.type === 'checkbox'}
{block name='form_field_item_checkbox'}
<span class="custom-checkbox">
<label>
<input name="{$field.name}" type="checkbox" value="1" {if $field.value}checked="checked"{/if} {if $field.required}required{/if}>
<span><i class="material-icons rtl-no-flip checkbox-checked">&#xE5CA;</i></span>
{$field.label nofilter}
</label>
{* <label> *}
<input name="{$field.name}" id="custom-checkbox-{$field.name}" type="checkbox" value="1" {if $field.value}checked="checked"{/if} {if $field.required}required{/if}>
{* <span><i class="material-icons rtl-no-flip checkbox-checked">&#xE5CA;</i></span> *}
<label for="custom-checkbox-{$field.name}">
{$field.label nofilter}
{if $field.required}*{/if}
</label>
{* </label> *}
</span>
{/block}
@@ -147,15 +156,16 @@
pattern=".{literal}{{/literal}5,{literal}}{/literal}"
{if $field.required}required{/if}
>
<span class="input-group-btn">
<span class="input-group-btn btn-show-password-box">
<button
class="btn"
class="btn btn-show-password"
type="button"
data-action="show-password"
data-text-show="{l s='Show' d='Shop.Theme.Actions'}"
data-text-hide="{l s='Hide' d='Shop.Theme.Actions'}"
{* data-text-show="{l s='Show' d='Shop.Theme.Actions'}" *}
{* data-text-hide="{l s='Hide' d='Shop.Theme.Actions'}" *}
>
{l s='Show' d='Shop.Theme.Actions'}
{* {l s='Show' d='Shop.Theme.Actions'} *}
<img src='/img/cms/icons/eye.svg' />
</button>
</span>
</div>
@@ -188,15 +198,15 @@
{include file='_partials/form-errors.tpl' errors=$field.errors}
{/block}
</div>
{* </div> *}
<div class="col-md-3 form-control-comment">
{* <div class="col-md-3 form-control-comment">
{block name='form_field_comment'}
{if (!$field.required && !in_array($field.type, ['radio-buttons', 'checkbox']))}
{l s='Optional' d='Shop.Forms.Labels'}
{/if}
{/block}
</div>
</div> *}
</div>
{/if}