|
| 1 | +{% set mealvouchersId = constant('Sylius\\MolliePlugin\\Model\\PaymentMethod\\MealVoucher::MEAL_VOUCHERS') %} |
| 2 | +{% set ideal = constant('Mollie\\Api\\Types\\PaymentMethod::IDEAL') %} |
| 3 | +{% set bancontact = constant('Mollie\\Api\\Types\\PaymentMethod::BANCONTACT') %} |
| 4 | +{% set applePay = constant('Mollie\\Api\\Types\\PaymentMethod::APPLEPAY') %} |
| 5 | +{% set klarnaOne = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_ONE') %} |
| 6 | +{% set klarnaPayLater = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_PAY_LATER') %} |
| 7 | +{% set klarnaSliceIt = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_SLICE_IT') %} |
| 8 | +{% set billie = constant('Mollie\\Api\\Types\\PaymentMethod::BILLIE') %} |
| 9 | +{% set in3 = constant('Mollie\\Api\\Types\\PaymentMethod::IN3') %} |
| 10 | +{% set alma = constant('Mollie\\Api\\Types\\PaymentMethod::ALMA') %} |
| 11 | +{% set riverty = constant('Mollie\\Api\\Types\\PaymentMethod::RIVERTY') %} |
| 12 | +{#{% import '@SyliusUi/Macro/flags.html.twig' as flags %}#} |
| 13 | + |
| 14 | +<div class="ui segment" id="mollie-payment-form" data-status="{{resource.id}}"> |
| 15 | +{% if resource.id is null %} |
| 16 | + <h4 class="ui header"> |
| 17 | + <div class="ui two column stackable grid js-onboardingWizard-load-methods"> |
| 18 | + <div class="middle aligned column"> |
| 19 | + {{ 'sylius_mollie.ui.payment_mathod_conf_title'|trans }} |
| 20 | + </div> |
| 21 | + </div> |
| 22 | + </h4> |
| 23 | + <div class="ui mini message center float js-payment-method-not-loaded"> |
| 24 | + {{ 'sylius_mollie.ui.create_methods_before_loading'|trans|raw }} |
| 25 | + </div> |
| 26 | +{% else %} |
| 27 | + <h4 class="ui header"> |
| 28 | + <div class="ui two column stackable grid js-onboardingWizard-load-methods"> |
| 29 | + <div class="middle aligned column"> |
| 30 | + {{ 'sylius_mollie.ui.payment_mathod_conf_title'|trans }} |
| 31 | + </div> |
| 32 | + <div class="right aligned column"> |
| 33 | + <div class="ui buttons js-header-btn"> |
| 34 | + <a href="#" id="get_methods" data-url="{{ path('mollie_admin_methods', {id: resource.gatewayConfig.id}) }}" |
| 35 | + class="ui button primary">{{ 'sylius_mollie.ui.load_methods_button'|trans }}</a> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | + <div class="sub header"> |
| 40 | + <i class="info circle icon"></i> |
| 41 | + {{ 'sylius_mollie.ui.you_can_sort_methods_via_drag_and_drop'|trans }} |
| 42 | + </div> |
| 43 | + </h4> |
| 44 | + |
| 45 | + <div |
| 46 | + class="ui styled fluid accordion js-sortable" |
| 47 | + id="payment_methods" |
| 48 | + data-ajax-url="{{ path('mollie_admin_change_position') }}" |
| 49 | + > |
| 50 | + {% set nameFieldRendered = false %} |
| 51 | + {% for name, methodForm in form.gatewayConfig.mollieGatewayConfig|sort((a, b) => a.vars.value.position <=> b.vars.value.position) %} |
| 52 | + {% set methodImage = methodForm.vars.value.image.svg %} |
| 53 | + {% if methodForm.vars.value.customizeMethodImage != null and methodForm.vars.value.customizeMethodImage.path != null %} |
| 54 | + {% set methodImage = methodForm.vars.value.customizeMethodImage.path|imagine_filter('sylius_original') %} |
| 55 | + {% endif %} |
| 56 | + <div |
| 57 | + class="draggable js-draggable" |
| 58 | + draggable="true" |
| 59 | + data-payment-method="{{ methodForm.vars.value.methodId }}" |
| 60 | + data-payment-id="{{ methodForm.vars.value.id }}" |
| 61 | + > |
| 62 | + <div class="draggable-button-enable"> |
| 63 | + {{ form_row(methodForm.enabled, { id: methodForm.vars.value.name }) }} |
| 64 | + </div> |
| 65 | + <div class="title{% if loop.index0 == 0 %} active{% endif %}"> |
| 66 | + <i class="dropdown icon"></i> |
| 67 | + <img class="ui mini avatar image" src="{{ methodImage }}"/> |
| 68 | + {{ methodForm.vars.value.name }} |
| 69 | + </div> |
| 70 | + <div class="content{% if loop.index0 == 0 %} active{% endif %}" data-method-id="{{methodForm.vars.name}}"> |
| 71 | + <div class="field"> |
| 72 | + {{ form_label(methodForm.translations) }} |
| 73 | + <div class="accordion"> |
| 74 | + {% for locale, translationForm in methodForm.translations %} |
| 75 | + <div class="title{% if 0 == loop.index0 %} active{% endif %}"> |
| 76 | + <i class="dropdown icon"></i> |
| 77 | +{# {{ flags.fromLocaleCode(locale) }} {{ locale|sylius_locale_name }}#} |
| 78 | + </div> |
| 79 | + <div class="content{% if 0 == loop.index0 %} active{% endif %}"> |
| 80 | + {% if nameFieldRendered is same as (false) %} |
| 81 | + {{ form_row(translationForm.name, { 'attr': { 'class': 'js-onboardingWizard-paymentName' } }) }} |
| 82 | + {% set nameFieldRendered = true %} |
| 83 | + {% else %} |
| 84 | + {{ form_row(translationForm.name) }} |
| 85 | + {% endif %} |
| 86 | + </div> |
| 87 | + {% endfor %} |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + {% if methodForm.vars.value.methodId == mealvouchersId %} |
| 91 | + <div class="field"> |
| 92 | + {{ form_widget(methodForm.defaultCategory) }} |
| 93 | + {{ methodForm.defaultCategory.vars.help|trans }} |
| 94 | + </div> |
| 95 | + {% elseif methodForm.vars.value.methodId == applePay %} |
| 96 | + <div class="field"> |
| 97 | + {{ form_row(methodForm.applePayDirectButton) }} |
| 98 | + {{ form_help(methodForm.applePayDirectButton) }} |
| 99 | + </div> |
| 100 | + {% endif %} |
| 101 | + <div class="field"> |
| 102 | + <div class="twelve wide column"> |
| 103 | + {{ form_row(methodForm.customizeMethodImage, { 'attr': { 'class': 'js-onboardingWizard-customizeMethodImage' } }) }} |
| 104 | + </div> |
| 105 | + {% if |
| 106 | + methodForm.vars.value.customizeMethodImage != null and |
| 107 | + methodForm.vars.value.customizeMethodImage.path != null |
| 108 | + %} |
| 109 | + <div class="four wide column"> |
| 110 | + <div |
| 111 | + class="ui button red form_button--delete-img" |
| 112 | + id="{{ name }}" |
| 113 | + data-value="{{ methodForm.vars.value.name }}" |
| 114 | + data-url="{{ path('mollie_admin_delete_logo') }}" |
| 115 | + >{{ 'sylius.ui.delete'|trans }} |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + {% endif %} |
| 119 | + </div> |
| 120 | + |
| 121 | + <div class="js-onboardingWizard-countryRestrictions"> |
| 122 | + <div class="field"> |
| 123 | + {{ form_row(methodForm.country_restriction, { 'attr': { 'class': 'js-onboardingWizard-countryRestriction' } }) }} |
| 124 | + </div> |
| 125 | + <div class="field"> |
| 126 | + <div id="country-allowed_{{ loop.index0 }}"> |
| 127 | + {{ form_row(methodForm.countryLevel_allowed, { 'attr': {'class': 'fluid search'} }) }} |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + <div class="field"> |
| 132 | + <div id="country-excluded_{{ loop.index0 }}"> |
| 133 | + {{ form_row(methodForm.countryLevel_excluded, { 'attr': {'class': 'fluid search'} }) }} |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + <div class="field"> |
| 137 | + <div class="fields"> |
| 138 | + <div class="twelve wide field"> |
| 139 | + {% if |
| 140 | + methodForm.vars.value.methodId == mealvouchersId or |
| 141 | + methodForm.vars.value.methodId == klarnaOne or |
| 142 | + methodForm.vars.value.methodId == klarnaPayLater or |
| 143 | + methodForm.vars.value.methodId == klarnaSliceIt or |
| 144 | + methodForm.vars.value.methodId == billie or |
| 145 | + methodForm.vars.value.methodId == alma or |
| 146 | + methodForm.vars.value.methodId == riverty or |
| 147 | + methodForm.vars.value.methodId == in3 |
| 148 | + %} |
| 149 | + {{ form_row(methodForm.paymentType, {'attr': {'disabled': 'disabled', 'class': 'js-onboardingWizard-PaymentMethod'}}) }} |
| 150 | + {{ form_help(methodForm.paymentType) }} |
| 151 | + {% else %} |
| 152 | + {{ form_row(methodForm.paymentType, { 'attr': { 'class': 'js-onboardingWizard-PaymentMethod' } }) }} |
| 153 | + {{ form_help(methodForm.paymentType) }} |
| 154 | + {% endif %} |
| 155 | + </div> |
| 156 | + <div class="four wide field"> |
| 157 | + {{ form_row(methodForm.orderExpirationDays) }} |
| 158 | + </div> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + <div class="field"> |
| 162 | + {% if |
| 163 | + methodForm.vars.value.methodId == ideal or |
| 164 | + methodForm.vars.value.methodId == bancontact %} |
| 165 | + {{ form_row(methodForm.qrCodeEnabled) }} |
| 166 | + {% endif %} |
| 167 | + </div> |
| 168 | + <div class="field"> |
| 169 | + <div class="js-onboardingWizard-order-number"> |
| 170 | + {{ form_widget(methodForm.paymentDescription, { 'attr': { 'class': 'js-onboardingWizard-paymentDescription' } }) }} |
| 171 | + <div id="payment_description_{{ name }}"> |
| 172 | + {{ methodForm.paymentDescription.vars.help|trans|raw|nl2br }} |
| 173 | + </div> |
| 174 | + </div> |
| 175 | + </div> |
| 176 | + <h4 class="ui horizontal divider header"> |
| 177 | + {{ 'sylius_mollie.ui.payment_fee'|trans }} |
| 178 | + </h4> |
| 179 | + {{ form_row(methodForm.paymentSurchargeFee, { 'attr': { 'class': 'js-onboardingWizard-paymentFee' } }) }} |
| 180 | + <h4 class="ui horizontal divider header"> |
| 181 | + {{ 'sylius_mollie.ui.min_max'|trans }} |
| 182 | + </h4> |
| 183 | + <h5>{{ 'sylius_mollie.form.amount_limit_help'|trans }}</h5> |
| 184 | + {{ form_row(methodForm.amountLimits, { 'attr': { 'class': 'js-onboardingWizard-minMax fields' } }) }} |
| 185 | + </div> |
| 186 | + </div> |
| 187 | + {% else %} |
| 188 | + <div class="ui mini message center float js-payment-method-not-loaded"> |
| 189 | + {{ 'sylius_mollie.ui.no_methods_found_message'|trans }} |
| 190 | + </div> |
| 191 | + {% endfor %} |
| 192 | + </div> |
| 193 | +{% endif %} |
| 194 | +</div> |
| 195 | + |
| 196 | + |
0 commit comments