feat(main): Initial Module
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{% import '@PrestaShop/Admin/macros.html.twig' as ps %}
|
||||
{% form_theme customHtmlForm '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block customhtml_form_block %}
|
||||
<div class="card">
|
||||
{{ form_start(customHtmlForm) }}
|
||||
<div class="card-header">
|
||||
<h3 class="card-header-title">
|
||||
{{ 'Custom HTML Block'|trans({}, 'Modules.Wscustomhtml.Admin') }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_rest(customHtmlForm) }}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{{ path('customhtml_index') }}" class="btn btn-outline-secondary">
|
||||
{{ 'Cancel'|trans({}, 'Admin.Actions') }}
|
||||
</a>
|
||||
<button class="btn btn-primary float-right">
|
||||
{{ 'Save'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(customHtmlForm) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% block customhtml_create_form %}
|
||||
{% include '@Modules/ws_customhtml/views/templates/admin/form/blocks/form.html.twig' %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(['TranslatableField', 'TranslatableInput']);
|
||||
|
||||
if (typeof window.tinymce !== 'undefined') {
|
||||
window.tinymce.init({
|
||||
selector: 'textarea.autoload_rte',
|
||||
plugins: 'code link lists image',
|
||||
toolbar: 'bold italic underline | bullist numlist | link | code',
|
||||
menubar: false,
|
||||
height: 400,
|
||||
relative_urls: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% block customhtml_edit_form %}
|
||||
{% include '@Modules/ws_customhtml/views/templates/admin/form/blocks/form.html.twig' %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(['TranslatableField', 'TranslatableInput']);
|
||||
|
||||
if (typeof window.tinymce !== 'undefined') {
|
||||
window.tinymce.init({
|
||||
selector: 'textarea.autoload_rte',
|
||||
plugins: 'code link lists image',
|
||||
toolbar: 'bold italic underline | bullist numlist | link | code',
|
||||
menubar: false,
|
||||
height: 400,
|
||||
relative_urls: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% block customhtml_list %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': customHtmlGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
new window.prestashop.component.Grid('customhtml');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{if !empty($blockList)}
|
||||
<div class="customhtml-container {$hookName|escape:'html':'UTF-8'}--container">
|
||||
{foreach from=$blockList item="block"}
|
||||
<div class="customhtml-block">
|
||||
{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>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user