diff --git a/Screenshot 2026-08-11 095051.png b/Screenshot 2026-08-11 095051.png deleted file mode 100644 index a48d3fa..0000000 Binary files a/Screenshot 2026-08-11 095051.png and /dev/null differ diff --git a/config/form.yml b/config/form.yml index 5ff8327..c2864f7 100644 --- a/config/form.yml +++ b/config/form.yml @@ -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 } diff --git a/src/Form/ChoiceProvider/CustomHtmlGroupChoiceProvider.php b/src/Form/ChoiceProvider/CustomHtmlGroupChoiceProvider.php index f54854e..02627ed 100644 --- a/src/Form/ChoiceProvider/CustomHtmlGroupChoiceProvider.php +++ b/src/Form/ChoiceProvider/CustomHtmlGroupChoiceProvider.php @@ -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; diff --git a/src/Form/Type/CustomHtmlBlockType.php b/src/Form/Type/CustomHtmlBlockType.php index e7d3453..c6ef418 100644 --- a/src/Form/Type/CustomHtmlBlockType.php +++ b/src/Form/Type/CustomHtmlBlockType.php @@ -22,7 +22,6 @@ class CustomHtmlBlockType extends AbstractType public function __construct( TranslatorInterface $translator, - array $locales, ConfigurableFormChoiceProviderInterface $groupChoiceProvider ) { $this->translator = $translator; diff --git a/src/Form/Type/CustomHtmlGroupType.php b/src/Form/Type/CustomHtmlGroupType.php index 2dd5dc7..3a4858c 100644 --- a/src/Form/Type/CustomHtmlGroupType.php +++ b/src/Form/Type/CustomHtmlGroupType.php @@ -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; } diff --git a/src/Grid/Query/CustomHtmlBlockQueryBuilder.php b/src/Grid/Query/CustomHtmlBlockQueryBuilder.php index 38dca4a..371470f 100644 --- a/src/Grid/Query/CustomHtmlBlockQueryBuilder.php +++ b/src/Grid/Query/CustomHtmlBlockQueryBuilder.php @@ -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) diff --git a/src/Grid/Query/CustomHtmlGroupQueryBuilder.php b/src/Grid/Query/CustomHtmlGroupQueryBuilder.php index f205fe8..b9c1ac2 100644 --- a/src/Grid/Query/CustomHtmlGroupQueryBuilder.php +++ b/src/Grid/Query/CustomHtmlGroupQueryBuilder.php @@ -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) diff --git a/views/css/front/customhtml.css b/views/css/front/customhtml.css index 98cfeef..679aa6c 100644 --- a/views/css/front/customhtml.css +++ b/views/css/front/customhtml.css @@ -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; +} diff --git a/views/templates/hook/_alert.tpl b/views/templates/hook/_alert.tpl index 6527057..9c77082 100644 --- a/views/templates/hook/_alert.tpl +++ b/views/templates/hook/_alert.tpl @@ -9,7 +9,7 @@ {$block.title|escape:'html':'UTF-8'} {/if} {$block.description|escape:'html':'UTF-8'|nl2br} - diff --git a/views/templates/hook/_banner.tpl b/views/templates/hook/_banner.tpl index 45d1a1d..e020af9 100644 --- a/views/templates/hook/_banner.tpl +++ b/views/templates/hook/_banner.tpl @@ -1,8 +1,11 @@ -
-
- {if !empty($block.image_url)}{$block.title|escape:'html':'UTF-8'}{/if} +
+
+
+ {if !empty($block.image_url)} + {$block.title|escape:'html':'UTF-8'} + {/if}
-
+
{include file="module:ws_customhtml/views/templates/hook/_banner_content.tpl" block=$block}
diff --git a/views/templates/hook/_banner_content.tpl b/views/templates/hook/_banner_content.tpl index e7237ab..d1fe5f9 100644 --- a/views/templates/hook/_banner_content.tpl +++ b/views/templates/hook/_banner_content.tpl @@ -8,5 +8,5 @@
{$block.extra_description|escape:'html':'UTF-8'|nl2br}
{/if} {if !empty($block.link)} -{l s='Learn more' d='Modules.Wscustomhtml.Admin'} +{l s='Learn more' d='Modules.Wscustomhtml.Shop'} {/if} diff --git a/views/templates/hook/_faq_accordion.tpl b/views/templates/hook/_faq_accordion.tpl index c2ed80c..bbbccfa 100644 --- a/views/templates/hook/_faq_accordion.tpl +++ b/views/templates/hook/_faq_accordion.tpl @@ -4,14 +4,32 @@