<div id ="mykeyModalChoice" class="mykey-modal modal fade" tabindex="-1" role="dialog" aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button"
class="modal-close close"
data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">
{% sw_icon 'x' style { 'size': 'sm' } %}
</span>
</button>
<div class="row">
<div class="col-12 col-sm-6 col-md-8 col-lg-9 modal-header-left">
<div class="fancy-headline">
<div class="fancy-headline-icon">{% sw_icon "mykey" style {'pack':'bodymed'} %}</div>
{{ "mykey.modal.headerSublime"|trans }}
<div class="h3">{{ "mykey.modal.headerTitle"|trans }}</div>
</div>
<p>
{% if not isCustomerPharmacy() %}
{{ "mykey.modal.headerText"|trans|raw }}
{% else %}
{{ "mykey.modal.bodymedCode.content"|trans|raw }}
{% endif %}
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-3 d-none d-sm-block modal-header-right"><img src="/bundles/madmykey/storefront/img/mykey-modal-choice-header.svg" /></div>
</div>
</div>
<div class="modal-body">
{% if not context.customer %}
<div class="mykey-choice has-mykey">
<a href="#hasMyKey" data-toggle="collapse" aria-expanded="false">
<div class="row">
<div class="col-1 col-sm-2 col-md-1">
{% sw_icon "mykey-key" style {'pack':'bodymed'} %}
</div>
<div class="col-8 col-md-10">
<div class="mykey-choice-sublime">{{ "mykey.modal.choice.hasMyKey.sublime"|trans }}</div>
<div class="mykey-choice-title">{{ "mykey.modal.choice.hasMyKey.title"|trans|raw }}</div>
</div>
<div class="col-2 col-md-1 text-right">
{% sw_icon "angle-circled" style {'pack':'bodymed'} %}
</div>
</div>
<div class="row">
<div id="hasMyKey" class="col-12 col-sm-10 col-md-11 offset-sm-2 offset-md-1 mykey-choice-inner-content collapse">
<div class="mykey-choice-inner-content-form">
<p>
{{ "mykey.modal.choice.hasMyKey.content.text"|trans|raw }}
</p>
{# Für den korrekten Redirect nach Login, muss die ProductId oder NavigationId als Parameter angegeben werden #}
{% if page is instanceof('\\Shopware\\Storefront\\Page\\Navigation\\NavigationPage') %}
{# Kategorieseite #}
{% set redirectParams = {
'navigationId': page.navigationId,
} %}
{% set loginUrl = url('frontend.bodymed_id.connect', {
'redirectTo': 'frontend.navigation.page',
'redirectParameters': redirectParams|json_encode
}) %}
{% elseif page is instanceof('\\Shopware\\Storefront\\Page\\Product\\ProductPage') %}
{# Produktseite #}
{% set redirectParams = {
'productId': page.product.id,
} %}
{% set loginUrl = url('frontend.bodymed_id.connect', {
'redirectTo': 'frontend.detail.page',
'redirectParameters': redirectParams|json_encode
}) %}
{% else %}
{% set loginUrl = url('frontend.bodymed_id.connect') %}
{% endif %}
<a href="{{ loginUrl }}" class="btn btn-primary">{{ "account.loginBtnText"|trans }}</a>
</div>
</div>
</div>
</a>
</div>
<div class="mykey-choice-divider">
<span class="mykey-choice-divider-text">{{ "checkout.addressDividerChoiceLabel"|trans|sw_sanitize }}</span>
</div>
{% endif %}
{% if not isCustomerPharmacy() %}
<div class="mykey-choice has-no-mykey">
<a href="#hasNoMyKey" data-toggle="collapse" {% if not context.customer %}aria-expanded="false"{% else %}aria-expanded="true"{% endif %}>
<div class="row">
<div class="col-1 col-sm-2 col-md-1">
{% sw_icon "mykey" style {'pack':'bodymed'} %}
</div>
<div class="col-8 col-md-10">
<div class="mykey-choice-sublime">{{ "mykey.modal.choice.hasNoMyKey.sublime"|trans }}</div>
<div class="mykey-choice-title">{{ "mykey.modal.choice.hasNoMyKey.title"|trans|raw }}</div>
</div>
<div class="col-2 col-md-1 text-right">
{% sw_icon "angle-circled" style {'pack':'bodymed'} %}
</div>
</div>
</a>
<div class="row">
<div id="hasNoMyKey" class="col-12 col-sm-10 col-md-11 offset-sm-2 offset-md-1 mykey-choice-inner-content collapse {% if context.customer %}show{% endif %}">
<div class="mykey-choice-inner-content-form">
{% sw_include "@Storefront/storefront/utilities/mykey-register-form.html.twig" ignore missing %}
</div>
<div class="mykey-choice-inner-content-text">
<p>
{{ "mykey.modal.choice.hasNoMyKey.content.text"|trans|raw }}
</p>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>