Add InPost Pay integration to admin templates
- Created a new template for the cart rule form with custom label, switch, and choice widgets. - Implemented the InPost Pay block in the order details template for displaying delivery method, APM, and VAT invoice request. - Added legacy support for the order details template to maintain compatibility with older PrestaShop versions.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
{l s='Choose a translation for your language' mod='inpostizi'}
|
||||
|
||||
{l s='News' mod='inpostizi'}
|
||||
{l s='Link to the module' mod='inpostizi'}
|
||||
|
||||
{l s='Contact and support' mod='inpostizi'}
|
||||
{l s='Technical support - use the contact form' mod='inpostizi'}
|
||||
{l s='Contact your sales representative' mod='inpostizi'}
|
||||
{l s='FAQ' mod='inpostizi'}
|
||||
{l s='Module status' mod='inpostizi'}
|
||||
{l s='Download logs and module data' mod='inpostizi'}
|
||||
|
||||
{l s='Useful links' mod='inpostizi'}
|
||||
{l s='Merchant\'s guide - how to correctly display InPost Pay in your online store' mod='inpostizi'}
|
||||
{l s='InPost Pay plugin configuration instructions' mod='inpostizi'}
|
||||
{l s='Returns manual' mod='inpostizi'}
|
||||
|
||||
{l s='Merchant panel - previewing transactions and handling returns' mod='inpostizi'}
|
||||
|
||||
{l s='Button preview' mod='inpostizi'}
|
||||
{l s='In order for the widget preview to be displayed, a valid merchant client ID must be provided in the "Configuration" tab.' mod='inpostizi'}
|
||||
{l s='Remember to click the \'Save\' button after you finish configuring the button styles' mod='inpostizi'}
|
||||
|
||||
{l s='InPost Pay plugin configuration' mod='inpostizi'}
|
||||
{l s='Take care of the correct exposure of the InPost Pay service, so that:' mod='inpostizi'}
|
||||
{l s='Buyers quickly recognize that when they make a purchase from your store, they can benefit from a fast and secure purchase and delivery service by a company whose services they know and trust, which directly contributes to customers\' purchasing decisions.' mod='inpostizi'}
|
||||
{l s='With the correct placement of the widget, you help your customers notice the InPost Pay service, which will allow them to finalize their purchases on your site without having to enter their data, which is especially important for customers who prefer anonymous shopping without logging in.' mod='inpostizi'}
|
||||
{l s='Check out Merchant\'s dedicated Guide to the correct implementation of the InPost Pay service. It gathers in one place information on the current branding of InPost Pay, guidelines for the visual implementation of the widget, and best practices worth following when building a positive user experience among online shoppers. You can find Merchant\'s guide in the "useful links" section.' mod='inpostizi'}
|
||||
|
||||
{l s='This widget is not configured correctly, correct the values in the form.' mod='inpostizi'}
|
||||
|
||||
{l s='Select all options' mod='inpostizi'}
|
||||
{l s='Select options from list' mod='inpostizi'}
|
||||
|
||||
{l s='Click here' mod='inpostizi'}
|
||||
{l s='to go to module documentation and read full instructions on how to configure message format.' mod='inpostizi'}
|
||||
|
||||
{* Hot products *}
|
||||
{l s='Status' mod='inpostizi'}
|
||||
{l s='Active' mod='inpostizi'}
|
||||
{l s='Awaiting approval' mod='inpostizi'}
|
||||
{l s='Not found in API' mod='inpostizi'}
|
||||
{l s='Importable' mod='inpostizi'}
|
||||
{l s='Product does not exist or is not available for order' mod='inpostizi'}
|
||||
{l s='No products found.' mod='inpostizi'}
|
||||
2
modules/inpostizi/views/templates/admin/banner.html.twig
Normal file
2
modules/inpostizi/views/templates/admin/banner.html.twig
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
<img src="{{ asset('img/admin/banner_admin.png', 'InPostIzi') }}" alt="InPost Pay" class="mb-3 img-fluid w-100">
|
||||
@@ -0,0 +1,46 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/config/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">description</i> {{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
<div class="card-body panel-body card-block px-sm-4 px-3 pt-4 pb-3">
|
||||
<div class="form-wrapper card-text">
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(form, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_module_manage') }}" class="btn btn-outline-secondary">{{ 'Back'|trans }}</a>
|
||||
|
||||
<button class="btn btn-primary float-right">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
<script type="text/javascript" src="{{ asset('js/admin/consents.js', 'InPostIzi') }}">
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,487 @@
|
||||
{% use 'bootstrap_4_layout.html.twig' %}
|
||||
|
||||
{% block collection_widget %}
|
||||
{% set child = prototype %}
|
||||
{% set attr = attr|merge({class: (attr.class|default('') ~ ' js-collection-form')|trim}) %}
|
||||
|
||||
<div {{ block('widget_container_attributes') }} data-prototype="{{ block('collection_entry_row')|e('html_attr') }}">
|
||||
<div class="js-collection-entries-container mb-2">
|
||||
{% for child in form %}
|
||||
<div class="js-collection-entry">
|
||||
{{ block('collection_entry_row') }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if allow_add %}
|
||||
<div class="d-flex">
|
||||
<button type="button" class="js-add-collection-entry btn btn-outline-primary">
|
||||
<i class="material-icons">add_circle</i>
|
||||
{{ add_entry_label is defined ? add_entry_label : 'Add'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
|
||||
{% if max_count_message is defined %}
|
||||
<div class="js-max-collection-count-message alert alert-warning d-none d-print-none mb-0 ml-3">
|
||||
<div class="alert-text">
|
||||
{{ max_count_message }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{%- block collection_entry_row -%}
|
||||
<div class="form-group p-3 border">
|
||||
{{ form_label(child) }}
|
||||
{{ form_widget(child, {'allow_delete': allow_delete}) }}
|
||||
</div>
|
||||
{%- endblock -%}
|
||||
|
||||
{%- block integer_widget -%}
|
||||
{%- set type = type|default('number') -%}
|
||||
<div class="input-group">
|
||||
{{- block('form_widget_simple') -}}
|
||||
|
||||
{% if form.vars.unit is defined %}
|
||||
<div class="input-group-append input-group-addon">
|
||||
<span class="input-group-text">{{ form.vars.unit }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- endblock integer_widget -%}
|
||||
|
||||
{% block form_label -%}
|
||||
{% if help is defined and help is not null %}
|
||||
<span class="d-flex align-items-baseline">
|
||||
{% endif %}
|
||||
|
||||
{% if help is defined and help is not null and form.vars.compound %}
|
||||
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' w-auto')|trim}) %}
|
||||
{% endif %}
|
||||
|
||||
{{- parent() -}}
|
||||
|
||||
{% if help is defined and help is not null %}
|
||||
<span
|
||||
class="help-box mr-0 ml-2"
|
||||
data-toggle="popover"
|
||||
data-html="true"
|
||||
data-trigger="hover"
|
||||
data-placement="top"
|
||||
data-content="{{ help }}"
|
||||
></span>
|
||||
{% endif %}
|
||||
|
||||
{% if help is defined and help is not null %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{%- endblock form_label %}
|
||||
|
||||
{% block checkbox_widget -%}
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="custom-control-input"
|
||||
{{ block('widget_attributes') }}
|
||||
{% if value is defined %} value="{{ value }}"{% endif %}
|
||||
{% if checked %} checked="checked"{% endif %}
|
||||
>
|
||||
<span class="custom-control-indicator"></span>
|
||||
<label
|
||||
class="custom-control-label"
|
||||
for="{{ id }}"
|
||||
>
|
||||
{{ label }}
|
||||
|
||||
{% if help is defined and help is not null %}
|
||||
<span
|
||||
class="help-box ml-1"
|
||||
data-toggle="popover"
|
||||
data-html="true"
|
||||
data-trigger="hover"
|
||||
data-placement="top"
|
||||
data-content="{{ help }}"
|
||||
>
|
||||
</span>
|
||||
{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
{%- endblock checkbox_widget %}
|
||||
|
||||
{% block shipping_options_row %}
|
||||
{% if label is not same as(false) %}
|
||||
<label class="h3 mb-3" for="{{ form.vars.id }}">
|
||||
{{ label }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{{ form_errors(form) }}
|
||||
{{ form_rest(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block carrier_mappings_row %}
|
||||
<div class="row mt-n2 align-items-end">
|
||||
{% for child in form %}
|
||||
<div class="col-xl-3 col-md-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(child) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block service_options_row %}
|
||||
{% if label is not same as(false) %}
|
||||
<label class="h4" for="{{ form.vars.id }}">
|
||||
{{ label }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
<div class="row mt-n2">
|
||||
<div class="col-xl-4 col-md-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(form.additionalCost) }}
|
||||
</div>
|
||||
<div class="offset-xl-0 offset-6"></div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block time_of_week_range_row %}
|
||||
{{ form_rest(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block time_of_week_row %}
|
||||
<div class="col-xl-4 col-md-6 col-12 col-xs-12 mt-2">
|
||||
<fieldset class="form-group">
|
||||
{{ form_label(form, null, {'compound': false }) }}
|
||||
|
||||
<div class="row row-flex mx-n1">
|
||||
<div class="col-xs-12 col col-sm px-1">
|
||||
{{ form_widget(form.weekDay) }}
|
||||
{{ form_errors(form.weekDay) }}
|
||||
</div>
|
||||
<div class="col-xs-12 col col-sm px-1">
|
||||
{{ form_widget(form.time) }}
|
||||
{{ form_errors(form.time) }}
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block form_help %}{% endblock %}
|
||||
|
||||
{% block inpostizi_translatable_widget -%}
|
||||
{% set formClass = form.vars.attr.class|default('') ~ ' input-group locale-input-group js-locale-input-group d-flex'|trim %}
|
||||
<div class="{{ formClass }}">
|
||||
{% for translateField in form %}
|
||||
{% set classes = translateField.vars.attr.class|default('') ~ ' js-locale-input'%}
|
||||
{% set classes = classes ~ ' js-locale-' ~ translateField.vars.label %}
|
||||
{% if default_locale.id_lang != translateField.vars.name %}
|
||||
{% set classes = classes ~ ' d-none' %}
|
||||
{% endif %}
|
||||
<div class="{{ classes }}" style="flex-grow: 1;">
|
||||
{{ form_widget(translateField, {'attr': {'class': translateField.vars.attr.class|default('') ~ ' w-100'}}) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not hide_locales %}
|
||||
<div class="dropdown ml-2">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle js-locale-btn"
|
||||
type="button"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
id="{{ form.vars.id }}_dropdown"
|
||||
>
|
||||
{{ form.vars.default_locale.iso_code }}
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right locale-dropdown-menu" aria-labelledby="{{ form.vars.id }}_dropdown">
|
||||
{% for locale in locales %}
|
||||
<span class="dropdown-item js-locale-item" data-locale="{{ locale.iso_code }}">{{ locale.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- endblock inpostizi_translatable_widget %}
|
||||
|
||||
{% block inpostizi_switch_widget %}
|
||||
<span class="ps-switch">
|
||||
{% for choice in choices %}
|
||||
{% set inputId = id ~'_' ~ choice.value %}
|
||||
<input id="{{inputId}}"
|
||||
{{ block('attributes') }}
|
||||
name="{{ full_name }}"
|
||||
value="{{ choice.value }}"
|
||||
{% if choice is selectedchoice(value) %}checked=""{% endif %}
|
||||
{% if disabled %}disabled=""{% endif %}
|
||||
type="radio"
|
||||
aria-label="{{ choice.label|trans({}, choice_translation_domain) }}"
|
||||
>
|
||||
<label for="{{inputId}}">{{ choice.label|trans({}, choice_translation_domain) }}</label>
|
||||
{% endfor %}
|
||||
<span class="slide-button"></span>
|
||||
</span>
|
||||
{% endblock inpostizi_switch_widget %}
|
||||
|
||||
{% block inpostizi_category_choice_tree_widget %}
|
||||
<div class="inpostizi-material-choice-tree-container js-choice-tree-container{% if required %} required{% endif %}" id="{{ form.vars.id }}">
|
||||
<div class="choice-tree-actions">
|
||||
<span class="form-control-label js-toggle-choice-tree-action"
|
||||
data-expanded-text="{{ 'Expand'|trans({}, 'Admin.Actions') }}"
|
||||
data-expanded-icon="expand_more"
|
||||
data-collapsed-text="{{ 'Collapse'|trans({}, 'Admin.Actions') }}"
|
||||
data-collapsed-icon="expand_less"
|
||||
data-action="expand"
|
||||
>
|
||||
<i class="material-icons">expand_more</i>
|
||||
<span class="js-toggle-text">{{ 'Expand'|trans({}, 'Admin.Actions') }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="choice-tree">
|
||||
{% for choice in choices_tree %}
|
||||
{{ block('inpostizi_category_choice_tree_item_widget') }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock inpostizi_category_choice_tree_widget %}
|
||||
|
||||
{% block inpostizi_category_choice_tree_item_widget %}
|
||||
{% set has_children = choice[choice_children] is defined %}
|
||||
|
||||
<li class="{% if choice.has_selected_children %}expanded{% elseif has_children %}collapsed{% endif %}">
|
||||
{% if multiple %}
|
||||
{{ block('inpostizi_category_choice_tree_item_checkbox_widget') }}
|
||||
{% else %}
|
||||
{{ block('inpostizi_category_choice_tree_item_radio_widget') }}
|
||||
{% endif %}
|
||||
|
||||
{% if has_children %}
|
||||
<ul>
|
||||
{% for item in choice[choice_children] %}
|
||||
{% set choice = item %}
|
||||
{{ block('inpostizi_category_choice_tree_item_widget') }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endblock inpostizi_category_choice_tree_item_widget %}
|
||||
|
||||
{% block inpostizi_category_choice_tree_item_checkbox_widget %}
|
||||
<div class="checkbox js-input-wrapper">
|
||||
<div class="md-checkbox md-checkbox-inline">
|
||||
<label>
|
||||
<input type="checkbox"
|
||||
{% if choice[choice_value] is not null %}
|
||||
name="{{ form.vars.full_name }}[]"
|
||||
value="{{ choice[choice_value] }}"
|
||||
{% if choice[choice_value] in selected_values %}checked{% endif %}
|
||||
{% endif %}
|
||||
{% if disabled or choice[choice_value] in disabled_values %}disabled{% endif %}
|
||||
>
|
||||
<i class="md-checkbox-control"></i>
|
||||
{{ choice[choice_label] }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock inpostizi_category_choice_tree_item_checkbox_widget %}
|
||||
|
||||
{% block inpostizi_category_choice_tree_item_radio_widget %}
|
||||
<div class="radio js-input-wrapper form-check form-check-radio">
|
||||
<label class="form-check-label">
|
||||
<input type="radio"
|
||||
name="{{ form.vars.full_name }}"
|
||||
value="{{ choice[choice_value] }}"
|
||||
{% if choice[choice_value] in selected_values %}checked{% endif %}
|
||||
{% if disabled or choice[choice_value] in disabled_values %}disabled{% endif %}
|
||||
{% if required %}required{% endif %}
|
||||
>
|
||||
<i class="form-check-round"></i>
|
||||
{{ choice[choice_label] }}
|
||||
</label>
|
||||
</div>
|
||||
{% endblock inpostizi_category_choice_tree_item_radio_widget %}
|
||||
|
||||
{% block widget_display_configuration_row %}
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/gui/form.html.twig' with {
|
||||
form: form,
|
||||
} %}
|
||||
</div>
|
||||
{% endblock widget_display_configuration_row %}
|
||||
|
||||
{% block product_page_display_configuration_row %}
|
||||
{{ form_rest(form) }}
|
||||
{% endblock product_page_display_configuration_row %}
|
||||
|
||||
{% block product_restrictions_row %}
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(form, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
<div class="row row-flex mt-n3">
|
||||
<div class="col-lg-5 col-md-6 col-12 col-xs-12 mt-3">
|
||||
{{ form_row((form.blockOrder)) }}
|
||||
{{ form_row(form.productTypes) }}
|
||||
{{ form_row(form.manufacturerIds) }}
|
||||
{{ form_row(form.attributeGroupIds) }}
|
||||
{{ form_row(form.featureIds) }}
|
||||
</div>
|
||||
<div class="col-lg-7 col-md-6 col-12 col-xs-12 mt-3 mr-auto">
|
||||
{{ form_row(form.categoryIds) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
{% endblock product_restrictions_row %}
|
||||
|
||||
{% block choice_widget %}
|
||||
{% if expanded and multiple %}
|
||||
<div class="dropdown" data-prevent-close-on-inside-click="true">
|
||||
<button
|
||||
class="btn btn-outline-secondary dropdown-toggle"
|
||||
type="button"
|
||||
id="{{ form.vars.id }}_dropdown"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
>
|
||||
{{ 'Select options from list'|legacy_trans }}
|
||||
</button>
|
||||
<div class="dropdown-menu inpostizi-checkboxes-options" aria-labelledby="{{ form.vars.id }}_dropdown">
|
||||
{% set allChecked = true %}
|
||||
|
||||
{% for child in form.children %}
|
||||
{% if child.vars.checked is defined and child.vars.checked is not null %}
|
||||
{% set allChecked = allChecked and child.vars.checked %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="custom-control custom-checkbox border-0">
|
||||
<input type="checkbox"
|
||||
class="custom-control-input js-inpostizi-accept-all-options-checkbox"
|
||||
id="{{ form.vars.id }}_all"
|
||||
name="{{ form.vars.id }}_all"
|
||||
data-target="{{ form.vars.full_name }}[]"
|
||||
value="1"
|
||||
{% if allChecked %}checked{% endif %}
|
||||
>
|
||||
<span class="custom-control-indicator"></span>
|
||||
<label class="custom-control-label" for="{{ form.vars.id }}_all">
|
||||
<strong>
|
||||
{{ 'Select all options'|legacy_trans }}
|
||||
</strong>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{{ parent() }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ parent() }}
|
||||
{% endif %}
|
||||
{% endblock choice_widget %}
|
||||
|
||||
{% block consent_widget %}
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="col-xs-8 col-8 mt-auto">
|
||||
<div class="d-flex">
|
||||
{{ form_label(form.descriptions, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0 mb-2 d-inline'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
|
||||
{{ form_widget(form.descriptions) }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 col-3 mt-auto">
|
||||
{{ form_label(form.requirementType, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0 mb-2'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ form_widget(form.requirementType) }}
|
||||
</div>
|
||||
|
||||
{% if allow_delete is defined and allow_delete %}
|
||||
<div class="col-xs-1 col-1 mt-auto text-right">
|
||||
<button type="button" class="js-remove-collection-entry btn btn-outline-secondary">
|
||||
<i class="material-icons">remove_circle</i>
|
||||
{{ 'Remove'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ form_label(form.additionalLinks, null, {
|
||||
'label_attr': {
|
||||
'class': 'h4'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ form_row(form.link) }}
|
||||
{{ form_widget(form.additionalLinks) }}
|
||||
|
||||
{{ form_rest(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block consent_link_widget %}
|
||||
<div class="row d-flex mb-3">
|
||||
<div class="col-xs-3 col-3 mt-auto">
|
||||
{{ form_label(form.id, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0 mb-2'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ form_widget(form.id) }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 col-3 mt-auto">
|
||||
{{ form_label(form.cmsPageId, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0 mb-2'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ form_widget(form.cmsPageId) }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-5 col-5 mt-auto">
|
||||
<div class="d-flex">
|
||||
{{ form_label(form.labels, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0 mb-2 d-inline'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
|
||||
{{ form_widget(form.labels) }}
|
||||
</div>
|
||||
|
||||
{% if allow_delete is defined and allow_delete %}
|
||||
<div class="col-xs-1 col-1 mt-auto text-right">
|
||||
<button type="button" class="js-remove-collection-entry btn btn-outline-secondary">
|
||||
<i class="material-icons">remove_circle</i>
|
||||
{{ 'Remove'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% use "@Modules/inpostizi/views/templates/admin/config/form_theme.html.twig" %}
|
||||
|
||||
{% block switch_widget %}
|
||||
<div class="inpost-izi-switch">
|
||||
<span class="ps-switch">
|
||||
{% for choice in choices %}
|
||||
{% set inputId = id ~'_' ~ choice.value %}
|
||||
<input id="{{inputId}}"
|
||||
{{ block('attributes') }}
|
||||
name="{{ full_name }}"
|
||||
value="{{ choice.value }}"
|
||||
{%- if choice is selectedchoice(value) -%}checked="" {%- endif -%}
|
||||
{%- if disabled -%}disabled="" {%- endif -%}
|
||||
type="radio"
|
||||
aria-label="{{ choice.label|trans({}, choice_translation_domain) }}">
|
||||
<label for="{{inputId}}">{{ choice.label|trans({}, choice_translation_domain) }}</label>
|
||||
{% endfor %}
|
||||
<span class="slide-button"></span>
|
||||
</span>
|
||||
</div>
|
||||
{% endblock switch_widget %}
|
||||
@@ -0,0 +1,55 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/config/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">settings</i> {{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/general/main.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/general/order_statuses.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/general/order_message.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/general/product_configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/general/products.html.twig' %}
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-xl-3 col-md-4 mt-2">
|
||||
{{ form_row(form.defaultPromoDetailsPageId) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_module_manage') }}" class="btn btn-outline-secondary">{{ 'Back'|trans }}</a>
|
||||
|
||||
<button class="btn btn-primary float-right">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,72 @@
|
||||
<div class="row mt-n3 align-items-end">
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.apiConfiguration.environmentType) }}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.enableForEveryone) }}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.apiConfiguration.clientCredentials.clientId) }}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.apiConfiguration.clientCredentials.clientSecret) }}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.ordersConfiguration.pointOfSaleId) }}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 mt-3">
|
||||
{{ form_row(form.apiConfiguration.merchantClientId) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-n3">
|
||||
<div class="col-xs-12 col-lg-auto mt-3">
|
||||
{{ form_row(form.ordersConfiguration.allPaymentOptionsEnabled, {
|
||||
attr: form.ordersConfiguration.allPaymentOptionsEnabled.vars.attr|merge({
|
||||
'aria-expanded': form.ordersConfiguration.allPaymentOptionsEnabled.vars.value ? 'true' : 'false',
|
||||
'data-toggle': 'collapse',
|
||||
'data-target': '.js-available-payment-options',
|
||||
}),
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-n3 js-available-payment-options collapse{% if not form.ordersConfiguration.allPaymentOptionsEnabled.vars.value %} show{% endif %}">
|
||||
<div class="col-xs-12 col-md-6 col-lg-8 col-xl-4 mt-3">
|
||||
{{ form_row(form.ordersConfiguration.availablePaymentOptions) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-n3 align-items-end">
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 mt-3">
|
||||
{{ form_row(form.ordersConfiguration.defaultInitialStatusId) }}
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 mt-3">
|
||||
{{ form_row(form.ordersConfiguration.cashOnDeliveryStatusId) }}
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 mt-3">
|
||||
{{ form_row(form.ordersConfiguration.paidStatusId) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
{{ form_row(form.thankYouDisplayHook) }}
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
{{ form_row(form.productCardDisplayHook) }}
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
{{ form_row(form.checkoutButtonDisplayHook) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
{{ form_row(form.fullPageCacheModuleInUse) }}
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
{{ form_row(form.sendAnalyticsData) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{% set messageOptionsForm = form.ordersConfiguration.messageOptions %}
|
||||
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(messageOptionsForm, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
<div class="row mt-3">
|
||||
{% if messageOptionsForm.appendIfApmDelivery is defined %}
|
||||
<div class="col-xl-4 col-lg-6 col-md-12">
|
||||
{{ form_row(messageOptionsForm.appendIfApmDelivery) }}
|
||||
|
||||
<p class="text-muted">
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/163643393/InPost+Pay+-+PrestaShop#Komentarz-zamówienia" target="_blank">
|
||||
{{ 'Click here'|legacy_trans }}
|
||||
</a>
|
||||
{{ 'to go to module documentation and read full instructions on how to configure message format.'|legacy_trans }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-8 col-lg-6 col-md-12">
|
||||
{{ form_row(messageOptionsForm.message) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-xl-8 col-lg-6 col-md-12">
|
||||
{{ form_row(messageOptionsForm.message) }}
|
||||
|
||||
<p class="text-muted">
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/163643393/InPost+Pay+-+PrestaShop#Komentarz-zamówienia" target="_blank">
|
||||
{{ 'Click here'|legacy_trans }}
|
||||
</a>
|
||||
{{ 'to go to module documentation and read full instructions on how to configure message format.'|legacy_trans }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,56 @@
|
||||
{% set ordersConfigurationForm = form.ordersConfiguration.statusDescriptionMap %}
|
||||
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(ordersConfigurationForm, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
{% if not ordersConfigurationForm.vars.hide_locales %}
|
||||
<div class="row mt-n1 align-items-center mx-n1 mb-1">
|
||||
<div class="col-xs-12 col-auto mt-1 px-1">
|
||||
<p class="mb-0 font-weight-bold">
|
||||
{{ 'Choose a translation for your language'|legacy_trans }}:
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-xs-12 col-auto mt-1 px-1">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle js-locale-btn"
|
||||
type="button"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
id="{{ ordersConfigurationForm.vars.id }}"
|
||||
>
|
||||
{{ ordersConfigurationForm.vars.default_locale.iso_code }}
|
||||
</button>
|
||||
|
||||
<div class="dropdown-menu locale-dropdown-menu" aria-labelledby="{{ ordersConfigurationForm.vars.id }}">
|
||||
{% for locale in ordersConfigurationForm.vars.locales %}
|
||||
<span class="dropdown-item js-locale-item cursor-pointer" data-locale="{{ locale.iso_code }}">{{ locale.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for formGroup in ordersConfigurationForm %}
|
||||
{% set classes = 'js-locale-input js-locale-' ~ formGroup.vars.label %}
|
||||
|
||||
{% if ordersConfigurationForm.vars.default_locale.id_lang != formGroup.vars.name %}
|
||||
{% set classes = classes ~ ' d-none' %}
|
||||
{% endif %}
|
||||
|
||||
<div data-lang-id="{{ formGroup.vars.name }}" class="{{ classes }}" style="flex-grow: 1;">
|
||||
<div class="row mt-n1">
|
||||
{% for statusForm in formGroup %}
|
||||
<div class="col-lg-3 col-md-4 mt-1">
|
||||
{{ form_row(statusForm) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,22 @@
|
||||
{% set productForm = form.productConfiguration %}
|
||||
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(productForm, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 mt-1">
|
||||
{{ form_row(productForm.normalImageTypeId) }}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 mt-1">
|
||||
{{ form_row(productForm.smallImageTypeId) }}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 mt-1">
|
||||
{{ form_row(productForm.largeImageTypeId) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
{{ form_row(form.maxSuggestedProducts, {
|
||||
attr: {
|
||||
class: 'inpostizi-input inpostizi-input--w-sm',
|
||||
}
|
||||
}) }}
|
||||
108
modules/inpostizi/views/templates/admin/config/gui.html.twig
Normal file
108
modules/inpostizi/views/templates/admin/config/gui.html.twig
Normal file
@@ -0,0 +1,108 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/config/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">palette</i> {{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{% set activeName = null %}
|
||||
{% set widgetForms = {} %}
|
||||
|
||||
{% for name, child in form %}
|
||||
{% if child.vars.binding_place is defined %}
|
||||
{% set widgetForms = widgetForms|merge({(name): child}) %}
|
||||
{% if not child.vars.valid and activeName is same as (null) %}
|
||||
{% set activeName = name %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if activeName is same as(null) %}
|
||||
{% set activeName = widgetForms|keys|first %}
|
||||
{% endif %}
|
||||
|
||||
<ul class="nav nav-pills border-top-0 bg-light" id="gui_tabs" role="tablist">
|
||||
{% for name, widgetForm in widgetForms %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<a
|
||||
class="nav-link
|
||||
{% if activeName is same as(name) %}active{% endif %}
|
||||
{% if widgetForm.vars.valid is same as(false) %}text-danger{% endif %}
|
||||
"
|
||||
id="{{ widgetForm.vars.id }}-tab"
|
||||
data-toggle="tab"
|
||||
data-target="#{{ widgetForm.vars.id }}"
|
||||
href="#{{ widgetForm.vars.id }}"
|
||||
role="tab"
|
||||
>
|
||||
{{ widgetForm.vars.label }}
|
||||
|
||||
{% if not widgetForm.vars.valid %}
|
||||
<span
|
||||
class="material-icons"
|
||||
data-toggle="popover"
|
||||
data-trigger="hover"
|
||||
data-placement="top"
|
||||
data-content="{{ 'This widget is not configured correctly, correct the values in the form.'|legacy_trans }}"
|
||||
>error</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content p-0" id="gui_tabs_content">
|
||||
{% for name, widgetForm in widgetForms %}
|
||||
<div
|
||||
class="
|
||||
tab-pane fade
|
||||
{% if activeName is same as(name) %}show active in{% endif %}
|
||||
"
|
||||
id="{{ widgetForm.vars.id }}"
|
||||
role="tabpanel"
|
||||
>
|
||||
{{ form_row(widgetForm) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_module_manage') }}" class="btn btn-outline-secondary">{{ 'Back'|trans }}</a>
|
||||
|
||||
<button class="btn btn-primary float-right">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
<link rel="stylesheet" href="{{ asset('css/admin/gui.css', 'InPostIzi') }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
{% if merchant_client_id %}
|
||||
<script type="application/javascript">
|
||||
window.inpostizi_merchant_client_id = '{{ merchant_client_id|e('js') }}';
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript" src="{{ widget_js_uri }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/admin/gui.js', 'InPostIzi') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="row mt-n2">
|
||||
<div class="col-xxl-auto col-12 col-xs-12 mt-2">
|
||||
{{ form_row(formDisplay) }}
|
||||
</div>
|
||||
|
||||
{% set style_forms = ['maxWidthPx'] %}
|
||||
|
||||
{% for name, child in form %}
|
||||
{% if name not in style_forms %}
|
||||
<div class="col-xxl col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(child) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(alignmentForm) }}
|
||||
</div>
|
||||
|
||||
{% for child in form %}
|
||||
{% if not child.rendered %}
|
||||
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(child) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<p class="h3 mb-3">
|
||||
{{ form_label(form, null, {
|
||||
'label_attr': {
|
||||
'class': 'p-0'
|
||||
}
|
||||
}) }}
|
||||
</p>
|
||||
|
||||
{% if form.vars.description is not empty %}
|
||||
<p class="mb-4">
|
||||
{{ form.vars.description|raw }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="row row-flex mt-n3">
|
||||
|
||||
<div class="col-lg-7 col-md-6 col-12 col-xs-12 mt-3 mr-auto">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/gui/config.html.twig' with {
|
||||
form: form.widgetConfiguration,
|
||||
formDisplay: form.displayed,
|
||||
alignmentForm: form.htmlStyles.justifyContent
|
||||
} %}
|
||||
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/gui/styles.html.twig' with {
|
||||
form: form.htmlStyles,
|
||||
} %}
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-12 col-xs-12 mt-3">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/gui/preview.html.twig' with {
|
||||
form: form.widgetConfiguration,
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<div class="inpostizi-btn-preview">
|
||||
<p class="inpostizi-btn-preview__title text-center mb-0">
|
||||
{{ 'Button preview'|legacy_trans }}
|
||||
</p>
|
||||
|
||||
<p class="small inpostizi-btn-preview__title-subtitle text-center mb-3">
|
||||
{{ 'In order for the widget preview to be displayed, a valid merchant client ID must be provided in the "Configuration" tab.'|legacy_trans }}
|
||||
{{ 'Remember to click the \'Save\' button after you finish configuring the button styles'|legacy_trans }}
|
||||
</p>
|
||||
|
||||
{% set btnConfig = form.vars.value %}
|
||||
{% set type = form.vars.name %}
|
||||
|
||||
{% set styleType = btnConfig.darkMode ? 'dark' : 'light' %}
|
||||
<div
|
||||
class="js-inpostizi-btn-preview-content inpostizi-btn-preview__content inpostizi-btn-preview__content--{{ styleType }} clearfix"
|
||||
data-type="{{ type }}"
|
||||
{% if form.vars.preview_container_styles is defined and form.vars.preview_container_styles is not same as({}) %}
|
||||
style="{% for name,value in form.vars.preview_container_styles %}{{ name|escape('html_attr') }}:{{ value|escape('html_attr') }};{% endfor %}"
|
||||
{% endif %}
|
||||
>
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/gui/preview_btn.html.twig'%}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<inpost-izi-button
|
||||
{% for attr, value in btnConfig %}
|
||||
{{ attr }}="{{ value }}"
|
||||
{% endfor %}
|
||||
>
|
||||
</inpost-izi-button>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="row">
|
||||
{% for child in form %}
|
||||
{% if not child.rendered %}
|
||||
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
|
||||
{{ form_row(child) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
12
modules/inpostizi/views/templates/admin/config/nav.html.twig
Normal file
12
modules/inpostizi/views/templates/admin/config/nav.html.twig
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
<div id="head_tabs">
|
||||
<ul class="nav nav-pills">
|
||||
{% for id, item in nav_items %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ item.url }}" id="{{ id }}" class="nav-link tab{% if item.active %} active current{% endif %}">
|
||||
{{ item.label }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/config/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">local_shipping</i> {{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{{ form_row(form.courierShippingOptions) }}
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body form-wrapper px-sm-4 px-3 pt-4 pb-3">
|
||||
{{ form_row(form.apmShippingOptions) }}
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_module_manage') }}" class="btn btn-outline-secondary">{{ 'Back'|trans }}</a>
|
||||
|
||||
<button class="btn btn-primary float-right">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/config/form_theme_support.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/support/description.html.twig' %}
|
||||
|
||||
<div class="row mx-n2">
|
||||
<div class="col-lg-4 col-sm-6 col-12 col-xs-12 mt-3 px-2">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/support/module_status.html.twig'%}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/support/updates.html.twig' %}
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-12 col-xs-12 mt-3 px-2">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/support/how_to.html.twig' %}
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-12 col-xs-12 mt-3 px-2">
|
||||
{% include '@Modules/inpostizi/views/templates/admin/config/support/troubleshooting.html.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
<link rel="stylesheet" href="{{ asset('css/admin/support.css', 'InPostIzi') }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript" src="{{ asset('js/admin/support.js', 'InPostIzi') }}">
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends "@Modules/inpostizi/views/templates/admin/config/support/partials/block.html.twig" %}
|
||||
|
||||
{% block support_block_extra_classes %}mb-0{% endblock %}
|
||||
|
||||
{% block support_block_header %}
|
||||
{% endblock %}
|
||||
|
||||
{% block support_block_body_extra_classes %}p-4{% endblock %}
|
||||
|
||||
{% block support_block_body_content %}
|
||||
<div class="row row-flex mt-n3 align-items-center">
|
||||
<div class="col-md-9 col-lg-7 mr-auto col-12 col-xs-12 mt-3">
|
||||
<p class="h2 mb-4">
|
||||
{{ 'InPost Pay plugin configuration'|legacy_trans }}
|
||||
</p>
|
||||
<p class="mb-3">
|
||||
{{ 'Take care of the correct exposure of the InPost Pay service, so that:'|legacy_trans }}
|
||||
</p>
|
||||
|
||||
<ul class="mb-3">
|
||||
<li class="mb-1">
|
||||
{{ 'Buyers quickly recognize that when they make a purchase from your store, they can benefit from a fast and secure purchase and delivery service by a company whose services they know and trust, which directly contributes to customers\' purchasing decisions.'|legacy_trans }}
|
||||
</li>
|
||||
<li>
|
||||
{{ 'With the correct placement of the widget, you help your customers notice the InPost Pay service, which will allow them to finalize their purchases on your site without having to enter their data, which is especially important for customers who prefer anonymous shopping without logging in.'|legacy_trans }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="mb-0">
|
||||
{{ 'Check out Merchant\'s dedicated Guide to the correct implementation of the InPost Pay service. It gathers in one place information on the current branding of InPost Pay, guidelines for the visual implementation of the widget, and best practices worth following when building a positive user experience among online shoppers. You can find Merchant\'s guide in the "useful links" section.'|legacy_trans }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-3 col-12 col-xs-12 mt-3">
|
||||
<iframe
|
||||
style="max-width: 100%; width: 100%; aspect-ratio: 5/3"
|
||||
src="https://www.youtube.com/embed/xw25aFIUIIo?si=m1w2tT2mbGPVgs9R"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends "@Modules/inpostizi/views/templates/admin/config/support/partials/block.html.twig" %}
|
||||
|
||||
{% block support_block_extra_classes %}h-100 mb-0{% endblock %}
|
||||
|
||||
{% block support_block_header_content %}
|
||||
<i class="material-icons mr-2">info</i>
|
||||
<span>
|
||||
{{ 'Useful links'|legacy_trans }}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block support_block_body_extra_classes %}p-3{% endblock %}
|
||||
|
||||
{% block support_block_body_content %}
|
||||
<ul class="mb-0 pl-3">
|
||||
<li class="mb-1">
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/308674566/Standardy+implementacji+InPost+Pay">
|
||||
{{ 'Merchant\'s guide - how to correctly display InPost Pay in your online store'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="mb-1">
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/163643393/InPost+Pay+-+PrestaShop">
|
||||
{{ 'InPost Pay plugin configuration instructions'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="mb-1">
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/154271751/Zwroty+i+transakcje#Panel-Merchanta">
|
||||
{{ 'Returns manual'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://malaysia.prod.0000wpo12a.vodeno.online/centaur-web/">
|
||||
{{ 'Merchant panel - previewing transactions and handling returns'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,63 @@
|
||||
{% extends "@Modules/inpostizi/views/templates/admin/config/support/partials/block.html.twig" %}
|
||||
|
||||
{% block support_block_extra_classes %}mb-3{% endblock %}
|
||||
|
||||
{% block support_block_header_content %}
|
||||
<i class="material-icons mr-2">check_circle</i>
|
||||
<span>
|
||||
{{ 'Module status'|legacy_trans }}:
|
||||
|
||||
{% if status.OK %}
|
||||
<span class="text-success text-uppercase">OK</span>
|
||||
{% else %}
|
||||
<span class="text-danger text-uppercase">{{ 'Error'|trans({}, 'validators') }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block support_block_body_extra_classes %}p-0{% endblock %}
|
||||
|
||||
{% block support_block_body_content %}
|
||||
<div class="row no-gutters">
|
||||
{% if not status.OK %}
|
||||
<div class="col-12 col-xs-12 border-bottom">
|
||||
<div class="p-3">
|
||||
<ul class="pl-3 mb-0">
|
||||
{% for error in status.errors %}
|
||||
<li>{{ error|raw }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-6 col-xs-6 border-right">
|
||||
<div class="p-3">
|
||||
<a href="{{ path('admin_inpost_izi_config_download_data') }}" class="btn btn-sm btn-block px-0 d-flex justify-content-center align-items-center btn-link">
|
||||
<span class="material-icons btn-icon">content_copy</span>
|
||||
{{ 'Download logs and module data'|legacy_trans }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-xs-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_errors(form) }}
|
||||
<div class="p-3 d-flex align-items-center justify-content-center h-100">
|
||||
{{ form_widget(form.debugEnabled, {
|
||||
'label': 'Debug mode',
|
||||
'attr': {
|
||||
'class': 'form-check-input',
|
||||
'data-toggle': 'toggle',
|
||||
'data-on': 'On',
|
||||
'data-off': 'Off',
|
||||
'data-onstyle': 'success',
|
||||
'data-offstyle': 'danger',
|
||||
'data-size': 'sm',
|
||||
},
|
||||
}) }}
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% block support_block %}
|
||||
<div class="card {% block support_block_extra_classes %}{% endblock %}">
|
||||
{% block support_block_header %}
|
||||
<div class="card-header p-3 h3 mb-0 d-flex align-items-center font-weight-bold">
|
||||
{% block support_block_header_content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block support_block_body %}
|
||||
<div class="card-body panel-body {% block support_block_body_extra_classes %}{% endblock %}">
|
||||
{% block support_block_body_content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,32 @@
|
||||
{% extends "@Modules/inpostizi/views/templates/admin/config/support/partials/block.html.twig" %}
|
||||
|
||||
{% block support_block_extra_classes %}mb-0 h-100{% endblock %}
|
||||
|
||||
{% block support_block_header_content %}
|
||||
<i class="material-icons mr-2">error</i>
|
||||
<span>
|
||||
{{ 'Contact and support'|legacy_trans }}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block support_block_body_extra_classes %}p-3{% endblock %}
|
||||
|
||||
{% block support_block_body_content %}
|
||||
<ul class="mb-0 pl-3">
|
||||
<li class="mb-1">
|
||||
<a href="https://inpostpay.pl/kontakt">
|
||||
{{ 'Technical support - use the contact form'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="mb-1">
|
||||
<a href="https://inpostpay.pl/kontakt">
|
||||
{{ 'Contact your sales representative'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/163905538/FAQ+InPost+Pay">
|
||||
{{ 'FAQ'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,22 @@
|
||||
{% extends "@Modules/inpostizi/views/templates/admin/config/support/partials/block.html.twig" %}
|
||||
|
||||
{% block support_block_extra_classes %}mb-0{% endblock %}
|
||||
|
||||
{% block support_block_header_content %}
|
||||
<i class="material-icons mr-2">new_releases</i>
|
||||
<span>
|
||||
{{ 'News'|legacy_trans }}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block support_block_body_extra_classes %}p-3{% endblock %}
|
||||
|
||||
{% block support_block_body_content %}
|
||||
<ul class="mb-0 pl-3">
|
||||
<li>
|
||||
<a href="https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/163643393/InPost+Pay+-+PrestaShop">
|
||||
{{ 'Link to the module'|legacy_trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,29 @@
|
||||
{% set badgeClass = 'badge' %}
|
||||
{% set variantClasses = {
|
||||
'success': 'badge-success',
|
||||
'info': 'badge-info',
|
||||
'warning': 'badge-warning',
|
||||
'danger': 'badge-danger'
|
||||
} %}
|
||||
|
||||
{% if is_legacy is defined and is_legacy %}
|
||||
{% set badgeClass = 'label' %}
|
||||
{% set variantClasses = {
|
||||
'success': 'bg-success',
|
||||
'info': 'bg-info',
|
||||
'warning': 'bg-warning',
|
||||
'danger': 'bg-danger'
|
||||
} %}
|
||||
{% endif %}
|
||||
|
||||
{% set cssClasses = badgeClass %}
|
||||
|
||||
{% if state is defined and variantClasses[state] is defined %}
|
||||
{% set cssClasses = cssClasses ~ ' ' ~ variantClasses[state] %}
|
||||
{% endif %}
|
||||
|
||||
{% if content is defined %}
|
||||
<span class="{{ cssClasses }}">
|
||||
{{ content }}
|
||||
</span>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,72 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/hot_products/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">add_circle</i>
|
||||
{{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
<div class="card-body panel-body card-block px-sm-4 px-3 pt-4 pb-3">
|
||||
<div class="form-wrapper card-text">
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{% if is_ps_176 %}
|
||||
{% import '@PrestaShop/Admin/macros.html.twig' as ps %}
|
||||
{{- ps.form_group_row(form.productId, { attr: form.productId.vars.attr }, {
|
||||
'label': form.productId.vars.label
|
||||
}) -}}
|
||||
{% else %}
|
||||
{{ form_row(form.productId) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="combination_choice_wrapper">
|
||||
{% if form.combinationId is defined %}
|
||||
{% if form.combinationId.vars.errors|length > 0 %}
|
||||
<div class="form-group row">
|
||||
{{ form_label(form.combinationId) }}
|
||||
<div class="col-sm">
|
||||
{{ form_errors(form.combinationId) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ form_rest(form.combinationId) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_inpost_izi_products_index') }}" class="btn btn-outline-secondary">
|
||||
{{ 'Cancel'|trans({}, 'Admin.Actions') }}
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary float-right">
|
||||
{{ 'Save'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('css/admin/hot-products.css', 'InPostIzi') }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
<script type="text/javascript" src="{{ asset('js/admin/hot-products.js', 'InPostIzi') }}">
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,41 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@Modules/inpostizi/views/templates/admin/hot_products/form_theme.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
<div class="card">
|
||||
{{ form_start(form) }}
|
||||
<h3 class="card-header">
|
||||
<i class="material-icons">edit</i>
|
||||
{{ layoutTitle }}
|
||||
</h3>
|
||||
|
||||
<div class="card-body panel-body card-block px-sm-4 px-3 pt-4 pb-3">
|
||||
<div class="form-wrapper card-text">
|
||||
{{ form_errors(form) }}
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer clearfix">
|
||||
<a href="{{ path('admin_inpost_izi_products_index') }}" class="btn btn-outline-secondary">
|
||||
{{ 'Cancel'|trans({}, 'Admin.Actions') }}
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary float-right">
|
||||
{{ 'Save'|trans({}, 'Admin.Actions') }}
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
<script type="text/javascript" src="{{ asset('js/admin/hot-products.js', 'InPostIzi') }}">
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% use '@PrestaShop/Admin/TwigTemplateForm/bootstrap_4_horizontal_layout.html.twig' %}
|
||||
|
||||
{%- block form_widget_simple -%}
|
||||
{%- set type = type|default('text') -%}
|
||||
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
|
||||
{{ include("@Twig/form_max_length.html.twig", {"attr": attr}, ignore_missing = true) }}
|
||||
{%- endblock form_widget_simple -%}
|
||||
|
||||
{%- block date_picker_widget -%}
|
||||
{% if date_format is defined %}
|
||||
{% set attr = attr|merge({'data-format': date_format}) %}
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control js-hot-products-datepicker-input" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
|
||||
<div class="input-group-append input-group-addon">
|
||||
<div class="input-group-text">
|
||||
<i class="material-icons">date_range</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock date_picker_widget %}
|
||||
@@ -0,0 +1,154 @@
|
||||
{% extends '@Modules/inpostizi/views/templates/admin/layout/basic-layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xs-12 col-12">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center">
|
||||
<h3 class="d-inline-block card-header-title mb-0">
|
||||
{{ layoutTitle }}
|
||||
</h3>
|
||||
<div class="ml-auto">
|
||||
<a href="{{ path('admin_inpost_izi_products_create') }}" class="btn btn-primary">
|
||||
<i class="material-icons text-white">add_circle_outline</i>
|
||||
{{ 'Add new'|trans({}, 'Admin.Actions') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body panel-body card-block">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr class="column-headers">
|
||||
<th scope="col">{{ 'ID'|trans({}, 'Admin.Global') }}</th>
|
||||
<th scope="col">{{ 'Product'|trans({}, 'Admin.Global') }}</th>
|
||||
<th scope="col">{{ 'Available from'|legacy_trans('updatehotproducttype') }}</th>
|
||||
<th scope="col">{{ 'Available to'|legacy_trans('updatehotproducttype') }}</th>
|
||||
|
||||
{% if is_multistore_context %}
|
||||
<th scope="col">{{ 'Shop'|trans({}, 'Admin.Global') }}</th>
|
||||
{% endif %}
|
||||
|
||||
{% if is_status_available %}
|
||||
<th scope="col">{{ 'Status'|legacy_trans }}</th>
|
||||
{% endif %}
|
||||
|
||||
<th scope="col" class="text-right">{{ 'Actions'|trans({}, 'Admin.Global') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td>{{ product.referenceId }}</td>
|
||||
<td>{{ product.name }}</td>
|
||||
<td>{{ product.availableFrom ? product.availableFrom|date('Y-m-d H:i:s') : '-' }}</td>
|
||||
<td>{{ product.availableTo ? product.availableTo|date('Y-m-d H:i:s') : '-' }}</td>
|
||||
|
||||
{% if is_multistore_context %}
|
||||
<td>{{ product.id ? product.shop|default('All shops'|trans({}, 'Admin.Global')) : '-' }}</td>
|
||||
{% endif %}
|
||||
|
||||
{% if is_status_available %}
|
||||
<td>
|
||||
{% if product.active %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/hot_products/components/badge.html.twig' with {
|
||||
'content': 'Active'|legacy_trans,
|
||||
'state': 'success',
|
||||
'is_legacy': is_legacy_admin_page
|
||||
}
|
||||
%}
|
||||
{% elseif product.active is same as(false) %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/hot_products/components/badge.html.twig' with {
|
||||
'content': 'Awaiting approval'|legacy_trans,
|
||||
'state': 'info',
|
||||
'is_legacy': is_legacy_admin_page
|
||||
} %}
|
||||
{% else %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/hot_products/components/badge.html.twig' with {
|
||||
'content': 'Not found in API'|legacy_trans,
|
||||
'state': 'warning',
|
||||
'is_legacy': is_legacy_admin_page
|
||||
} %} {# TODO: popover with info that export can be retried by item edition? #}
|
||||
{% endif %}
|
||||
|
||||
{% if product.id is same as(null) %}
|
||||
{% if product.importable %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/hot_products/components/badge.html.twig' with {
|
||||
'content': 'Importable'|legacy_trans,
|
||||
'state': 'warning',
|
||||
'is_legacy': is_legacy_admin_page
|
||||
} %} {# TODO: popover with info that unless imported, API data will not be updated after PS data changes? #}
|
||||
{% else %}
|
||||
{% include '@Modules/inpostizi/views/templates/admin/hot_products/components/badge.html.twig' with {
|
||||
'content': 'Product does not exist or is not available for order'|legacy_trans,
|
||||
'state': 'danger',
|
||||
'is_legacy': is_legacy_admin_page
|
||||
} %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
{% if product.id is not same as(null) %}
|
||||
<a href="{{ path('admin_inpost_izi_products_edit', {'id': product.id}) }}"
|
||||
class="btn btn-link"
|
||||
title="{{ 'Edit'|trans({}, 'Admin.Actions') }}"
|
||||
>
|
||||
<i class="material-icons">edit</i>
|
||||
</a>
|
||||
<form action="{{ path('admin_inpost_izi_products_delete', {'id': product.id}) }}"
|
||||
method="post"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('{{ 'Are you sure you want to delete this item?'|trans({}, 'Admin.Notifications.Warning') }}');"
|
||||
>
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('inpost-izi-delete-product') }}">
|
||||
<button type="submit" class="btn btn-link" title="{{ 'Delete'|trans({}, 'Admin.Actions') }}">
|
||||
<i class="material-icons">delete</i>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
{% if product.importable %}
|
||||
<form action="{{ path('admin_inpost_izi_products_api_import', {'referenceId': product.referenceId}) }}"
|
||||
method="post"
|
||||
class="d-inline"
|
||||
>
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('inpost-izi-import-product') }}">
|
||||
<button type="submit" class="btn btn-link" title="{{ 'Import'|trans({}, 'Admin.Actions') }}">
|
||||
<i class="material-icons">file_download</i>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<form action="{{ path('admin_inpost_izi_products_api_delete', {'referenceId': product.referenceId}) }}"
|
||||
method="post"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('{{ 'Are you sure you want to delete this item?'|trans({}, 'Admin.Notifications.Warning') }}');"
|
||||
>
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('inpost-izi-delete-remote-product') }}">
|
||||
<button type="submit" class="btn btn-link" title="{{ 'Delete'|trans({}, 'Admin.Actions') }}">
|
||||
<i class="material-icons">delete</i>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="{{ 5 + is_multistore_context + is_status_available }}" class="text-center">
|
||||
{{ 'No products found.'|legacy_trans }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,24 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content_header %}
|
||||
{{ parent() }}
|
||||
|
||||
{# DISABLED FOR NOW, WE ARE WAITING FOR BANNERS TO COME #}
|
||||
{# {% include '@Modules/inpostizi/views/templates/admin/banner.html.twig'%}#}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
<link rel="stylesheet" href="{{ asset('css/admin/admin.css', 'InPostIzi') }}" />
|
||||
|
||||
{% if is_legacy_admin_page %}
|
||||
<link rel="stylesheet" href="{{ asset('css/admin/admin-legacy.css', 'InPostIzi') }}" />
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript" src="{{ asset('js/admin/admin.js', 'InPostIzi') }}">
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user