feat(main): Add banner option
This commit is contained in:
@@ -9,3 +9,30 @@ td.action-type .btn-group-action {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (min-width: 544px) {
|
||||
.form-horizontal
|
||||
.form-group.row
|
||||
> .form-control-label:first-of-type:not(.label-on-top) {
|
||||
flex: 0 0 auto !important;
|
||||
max-width: unset !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
form[name="custom_html_block"] .card-body {
|
||||
padding: 25px 50px !important;
|
||||
}
|
||||
form[name="custom_html_block"] .card-header,
|
||||
form[name="custom_html_block"] .card-footer {
|
||||
padding: 20px 50px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1500px) {
|
||||
form[name="custom_html_block"] .card-body {
|
||||
padding: 25px 300px !important;
|
||||
}
|
||||
form[name="custom_html_block"] .card-header,
|
||||
form[name="custom_html_block"] .card-footer {
|
||||
padding: 20px 300px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,3 +2,16 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.customhtml-banner-content {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.customhtml-banner-title {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.customhtml-banner-description,
|
||||
.customhtml-banner-extra-description {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,23 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_row(customHtmlBlockForm.id_ws_customhtml_group) }}
|
||||
{{ form_row(customHtmlBlockForm.title) }}
|
||||
{{ form_row(customHtmlBlockForm.type) }}
|
||||
{{ form_row(customHtmlBlockForm.show_title) }}
|
||||
{{ form_row(customHtmlBlockForm.custom_class) }}
|
||||
|
||||
<div class="row">
|
||||
{{ form_row(customHtmlBlockForm.title) }}
|
||||
{{ form_row(customHtmlBlockForm.show_title) }}
|
||||
</div>
|
||||
|
||||
{{ form_row(customHtmlBlockForm.content) }}
|
||||
|
||||
{% if currentImageUrl is defined and currentImageUrl %}
|
||||
<div class="customhtmlblock-type-field customhtmlblock-type-banner customhtmlblock-current-image">
|
||||
<label class="form-control-label">{{ 'Current image'|trans({}, 'Modules.Wscustomhtml.Admin') }}</label>
|
||||
<div><img src="{{ currentImageUrl }}" alt="" style="max-width: 200px; max-height: 200px;"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_row(customHtmlBlockForm.image) }}
|
||||
|
||||
<div class="customhtmlblock-type-field customhtmlblock-type-faq">
|
||||
<label class="form-control-label">
|
||||
{{ 'FAQ items'|trans({}, 'Modules.Wscustomhtml.Admin') }}
|
||||
@@ -48,6 +59,11 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_row(customHtmlBlockForm.description) }}
|
||||
{{ form_row(customHtmlBlockForm.extra_description) }}
|
||||
{{ form_row(customHtmlBlockForm.link) }}
|
||||
|
||||
{{ form_row(customHtmlBlockForm.custom_class) }}
|
||||
{{ form_row(customHtmlBlockForm.active) }}
|
||||
{{ form_rest(customHtmlBlockForm) }}
|
||||
</div>
|
||||
|
||||
@@ -17,13 +17,10 @@
|
||||
function toggleBlockTypeFields() {
|
||||
var type = $('#custom_html_block_type').val();
|
||||
|
||||
if (type === 'html') {
|
||||
$('.customhtmlblock-type-html').show();
|
||||
$('.customhtmlblock-type-faq').hide();
|
||||
} else {
|
||||
$('.customhtmlblock-type-html').hide();
|
||||
$('.customhtmlblock-type-faq').show();
|
||||
}
|
||||
$('.customhtmlblock-type-html').hide();
|
||||
$('.customhtmlblock-type-faq').hide();
|
||||
$('.customhtmlblock-type-banner').hide();
|
||||
$('.customhtmlblock-type-' + type).show();
|
||||
}
|
||||
|
||||
$('#custom_html_block_type').on('change', toggleBlockTypeFields);
|
||||
|
||||
@@ -17,13 +17,10 @@
|
||||
function toggleBlockTypeFields() {
|
||||
var type = $('#custom_html_block_type').val();
|
||||
|
||||
if (type === 'html') {
|
||||
$('.customhtmlblock-type-html').show();
|
||||
$('.customhtmlblock-type-faq').hide();
|
||||
} else {
|
||||
$('.customhtmlblock-type-html').hide();
|
||||
$('.customhtmlblock-type-faq').show();
|
||||
}
|
||||
$('.customhtmlblock-type-html').hide();
|
||||
$('.customhtmlblock-type-faq').hide();
|
||||
$('.customhtmlblock-type-banner').hide();
|
||||
$('.customhtmlblock-type-' + type).show();
|
||||
}
|
||||
|
||||
$('#custom_html_block_type').on('change', toggleBlockTypeFields);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="customhtml-banner row align-items-center">
|
||||
<div class="col-md-6 customhtml-banner-image">
|
||||
{if !empty($block.image_url)}<img src="{$block.image_url|escape:'html':'UTF-8'}" alt="{$block.title|escape:'html':'UTF-8'}">{/if}
|
||||
</div>
|
||||
<div class="col-md-6 customhtml-banner-content">
|
||||
{include file="module:ws_customhtml/views/templates/hook/_banner_content.tpl" block=$block}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{if $block.show_title && !empty($block.title)}
|
||||
<h3 class="customhtml-banner-title">{$block.title|escape:'html':'UTF-8'}</h3>
|
||||
{/if}
|
||||
{if !empty($block.description)}
|
||||
<div class="customhtml-banner-description">{$block.description|escape:'html':'UTF-8'|nl2br}</div>
|
||||
{/if}
|
||||
{if !empty($block.extra_description)}
|
||||
<div class="customhtml-banner-extra-description">{$block.extra_description|escape:'html':'UTF-8'|nl2br}</div>
|
||||
{/if}
|
||||
{if !empty($block.link)}
|
||||
<a href="{$block.link|escape:'html':'UTF-8'}" class="btn btn-primary customhtml-banner-link">{l s='Learn more' d='Modules.Wscustomhtml.Admin'}</a>
|
||||
{/if}
|
||||
@@ -4,12 +4,17 @@
|
||||
<div class="customhtml-group customhtml-group-{$group.id_ws_customhtml_group|intval} row">
|
||||
{foreach from=$group.blocks item="block"}
|
||||
<div class="customhtml-block col{if !empty($block.custom_class)} {$block.custom_class|escape:'html':'UTF-8'}{/if}">
|
||||
{if $block.show_title && !empty($block.title)}
|
||||
<div class="customhtml-title">{$block.title|escape:'html':'UTF-8'}</div>
|
||||
{/if}
|
||||
{if $block.type == 'faq'}
|
||||
{if $block.show_title && !empty($block.title)}
|
||||
<div class="customhtml-title">{$block.title|escape:'html':'UTF-8'}</div>
|
||||
{/if}
|
||||
{include file="module:ws_customhtml/views/templates/hook/_faq_accordion.tpl" block=$block}
|
||||
{elseif $block.type == 'banner'}
|
||||
{include file="module:ws_customhtml/views/templates/hook/_banner.tpl" block=$block}
|
||||
{else}
|
||||
{if $block.show_title && !empty($block.title)}
|
||||
<div class="customhtml-title">{$block.title|escape:'html':'UTF-8'}</div>
|
||||
{/if}
|
||||
<div class="customhtml-content">{$block.content nofilter}</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user