feat(main): Small adjustments

Css adjustments for certain blocks; module instructions compliance
This commit is contained in:
2026-08-19 15:10:52 +02:00
parent e804c37175
commit a4e479490b
12 changed files with 69 additions and 40 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

+3 -2
View File
@@ -2,7 +2,8 @@ services:
websmid.customhtml.form.type.customhtml_group:
public: true
class: 'Websmid\CustomHtml\Form\Type\CustomHtmlGroupType'
parent: 'form.type.translatable.aware'
arguments:
- '@translator'
tags:
- { name: form.type }
@@ -44,8 +45,8 @@ services:
websmid.customhtml.form.type.customhtml_block:
public: true
class: 'Websmid\CustomHtml\Form\Type\CustomHtmlBlockType'
parent: 'form.type.translatable.aware'
arguments:
- '@translator'
- '@websmid.customhtml.form.choice_provider.customhtml_group_choice_provider'
tags:
- { name: form.type }
@@ -20,10 +20,17 @@ final class CustomHtmlGroupChoiceProvider implements
ORDER BY `title` ASC'
);
$titleCounts = array_count_values(array_column($groups, 'title'));
$choices = [];
foreach ($groups as $group) {
$choices[$group['title']] = (int) $group['id_ws_customhtml_group'];
$label = $group['title'];
if ($titleCounts[$label] > 1) {
$label .= ' (#' . $group['id_ws_customhtml_group'] . ')';
}
$choices[$label] = (int) $group['id_ws_customhtml_group'];
}
return $choices;
-1
View File
@@ -22,7 +22,6 @@ class CustomHtmlBlockType extends AbstractType
public function __construct(
TranslatorInterface $translator,
array $locales,
ConfigurableFormChoiceProviderInterface $groupChoiceProvider
) {
$this->translator = $translator;
+1 -1
View File
@@ -12,7 +12,7 @@ class CustomHtmlGroupType extends AbstractType
{
private $translator;
public function __construct(TranslatorInterface $translator, array $locales)
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
@@ -11,13 +11,6 @@ use PrestaShop\PrestaShop\Core\Grid\Search\SearchCriteriaInterface;
final class CustomHtmlBlockQueryBuilder extends AbstractDoctrineQueryBuilder
{
private $searchCriteriaApplicator;
private $contextLanguageId;
private $contextShopId;
private $contextShopGroupId;
private $filterApplicator;
private $configuration;
public function __construct(
Connection $connection,
string $dbPrefix,
@@ -29,12 +22,6 @@ final class CustomHtmlBlockQueryBuilder extends AbstractDoctrineQueryBuilder
Configuration $configuration
) {
parent::__construct($connection, $dbPrefix);
$this->searchCriteriaApplicator = $searchCriteriaApplicator;
$this->contextLanguageId = $contextLanguageId;
$this->contextShopId = $contextShopId;
$this->contextShopGroupId = $contextShopGroupId;
$this->filterApplicator = $filterApplicator;
$this->configuration = $configuration;
}
public function getSearchQueryBuilder(SearchCriteriaInterface $searchCriteria)
@@ -11,13 +11,6 @@ use PrestaShop\PrestaShop\Core\Grid\Search\SearchCriteriaInterface;
final class CustomHtmlGroupQueryBuilder extends AbstractDoctrineQueryBuilder
{
private $searchCriteriaApplicator;
private $contextLanguageId;
private $contextShopId;
private $contextShopGroupId;
private $filterApplicator;
private $configuration;
public function __construct(
Connection $connection,
string $dbPrefix,
@@ -29,12 +22,6 @@ final class CustomHtmlGroupQueryBuilder extends AbstractDoctrineQueryBuilder
Configuration $configuration
) {
parent::__construct($connection, $dbPrefix);
$this->searchCriteriaApplicator = $searchCriteriaApplicator;
$this->contextLanguageId = $contextLanguageId;
$this->contextShopId = $contextShopId;
$this->contextShopGroupId = $contextShopGroupId;
$this->filterApplicator = $filterApplicator;
$this->configuration = $configuration;
}
public function getSearchQueryBuilder(SearchCriteriaInterface $searchCriteria)
+29 -2
View File
@@ -1,10 +1,12 @@
/* Banners */
.customhtml-block img {
max-width: 100%;
height: auto;
}
.customhtml-banner-content {
padding: 1rem 0;
padding: 2rem;
bottom: 0px;
position: absolute;
}
.customhtml-banner-title {
@@ -16,6 +18,14 @@
margin-bottom: 1rem;
}
.customhtml-banner-image--gradient {
width: 100%;
height: 100%;
position: absolute;
background: transparent linear-gradient(180deg, #27272777 0%, #272727 100%)
0% 0% no-repeat padding-box;
}
/* Alert */
.customhtml-alert {
max-height: 500px;
overflow: hidden;
@@ -37,3 +47,20 @@
.customhtml-alert-title {
margin-right: 0.5rem;
}
/* FAQ */
.accordion-icon-minus {
display: block;
}
.accordion-icon-plus {
display: none;
}
.customhtml-faq-accordion .btn.collapsed .accordion-icon-minus {
display: none;
}
.customhtml-faq-accordion .btn.collapsed .accordion-icon-plus {
display: block;
}
+1 -1
View File
@@ -9,7 +9,7 @@
<strong class="customhtml-alert-title">{$block.title|escape:'html':'UTF-8'}</strong>
{/if}
<span class="customhtml-alert-text">{$block.description|escape:'html':'UTF-8'|nl2br}</span>
<button type="button" class="close customhtml-alert-close" aria-label="{l s='Close' d='Modules.Wscustomhtml.Admin'}">
<button type="button" class="close customhtml-alert-close" aria-label="{l s='Close' d='Modules.Wscustomhtml.Shop'}">
<span aria-hidden="true">&times;</span>
</button>
</div>
+7 -4
View File
@@ -1,8 +1,11 @@
<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 class="customhtml-banner row flex-column position-relative">
<div class="customhtml-banner-image">
<div class="customhtml-banner-image--gradient"></div>
{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">
<div class="customhtml-banner-content">
{include file="module:ws_customhtml/views/templates/hook/_banner_content.tpl" block=$block}
</div>
</div>
+1 -1
View File
@@ -8,5 +8,5 @@
<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>
<a href="{$block.link|escape:'html':'UTF-8'}" class="btn btn-primary customhtml-banner-link">{l s='Learn more' d='Modules.Wscustomhtml.Shop'}</a>
{/if}
+19 -1
View File
@@ -4,14 +4,32 @@
<div class="card">
<div class="card-header" id="customhtml-faq-heading-{$block.id_ws_customhtml|intval}-{$faq.id_ws_customhtml_faq|intval}">
<button
class="btn btn-link{if !$smarty.foreach.customhtmlFaqLoop.first} collapsed{/if}"
class="btn btn-link col-12 d-flex text-left {if !$smarty.foreach.customhtmlFaqLoop.first} collapsed{/if}"
type="button"
data-toggle="collapse"
data-target="#customhtml-faq-collapse-{$block.id_ws_customhtml|intval}-{$faq.id_ws_customhtml_faq|intval}"
aria-expanded="{if $smarty.foreach.customhtmlFaqLoop.first}true{else}false{/if}"
aria-controls="customhtml-faq-collapse-{$block.id_ws_customhtml|intval}-{$faq.id_ws_customhtml_faq|intval}"
>
<div class="col">
{$faq.question|escape:'html':'UTF-8'}
</div>
<div class="col-auto d-flex align-items-center ">
<span class="accordion-icons accordion-icon-minus">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="2" viewBox="0 0 28 2">
<line id="Line_18" data-name="Line 18" x2="26" transform="translate(1 1)" fill="none" stroke="#272727" stroke-linecap="round" stroke-width="2"/>
</svg>
</span>
<span class="accordion-icons accordion-icon-plus">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">
<g id="Group_31" data-name="Group 31" transform="translate(-1615 -4031.5)">
<line id="Line_21" data-name="Line 21" x2="26" transform="translate(1616 4045.5)" fill="none" stroke="#272727" stroke-linecap="round" stroke-width="2"/>
<line id="Line_22" data-name="Line 22" x2="26" transform="translate(1629 4032.5) rotate(90)" fill="none" stroke="#272727" stroke-linecap="round" stroke-width="2"/>
</g>
</svg>
</span>
</div>
</button>
</div>
<div