177 lines
8.3 KiB
Twig
177 lines
8.3 KiB
Twig
{#**
|
|
* Copyright since 2007 PrestaShop SA and Contributors
|
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License version 3.0
|
|
* that is bundled with this package in the file LICENSE.md.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* https://opensource.org/licenses/AFL-3.0
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to license@prestashop.com so we can send you a copy immediately.
|
|
*
|
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
|
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
|
|
*#}
|
|
<!DOCTYPE html>
|
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 lt-ie6"> <![endif]-->
|
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8 ie7"> <![endif]-->
|
|
<!--[if IE 8]> <html class="no-js lt-ie9 ie8"> <![endif]-->
|
|
<!--[if gt IE 8]> <html class="no-js ie9"> <![endif]-->
|
|
<html lang="{{ ps.isoUser }}">
|
|
<head>
|
|
<title>Login with PrestaShop</title>
|
|
<link rel="stylesheet" href="{{ linkCss }}">
|
|
<link rel="stylesheet" href="https://unpkg.com/@prestashopcorp/puik-theme/dist/index.css" />
|
|
{#**
|
|
Workaround for the issue with the font not being loaded correctly from puik-theme
|
|
*#}
|
|
<style>
|
|
@font-face {
|
|
font-family: Prestafont;
|
|
src: url("https://unpkg.com/@prestashopcorp/puik-theme/assets/Prestafont-Regular.woff2") format("woff2")
|
|
}
|
|
</style>
|
|
<script src="{{ linkJs }}"></script>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
</head>
|
|
<body class="lang-{{ ps.isoUser }}{% if ps.isRtlLanguage %} lang-rtl{% endif %}">
|
|
<div class="psacc-grid psacc-h-screen lg:psacc-grid-cols-2">
|
|
<div
|
|
class="psacc-hidden lg:psacc-flex psacc-flex-col psacc-items-center psacc-justify-end psacc-bg-cover psacc-bg-no-repeat psacc-bg-bicycle"
|
|
>
|
|
<section
|
|
id="psacc_slider"
|
|
class="splide psacc-mb-10 psacc-w-11/12 psacc-bg-quote psacc-flex psacc-flex-col"
|
|
>
|
|
<div
|
|
class="splide__arrows psacc-flex psacc-justify-between psacc-w-full psacc-my-5"
|
|
>
|
|
<img src="{{ shopUrl }}/modules/ps_accounts/views/img/quote-mark.svg" class="psacc-ml-10">
|
|
<div class="psacc-flex psacc-justify-center psacc-items-center psacc-mr-10">
|
|
<button
|
|
class="splide__arrow splide__arrow--prev psacc-font-materialIcons psacc-opacity-100 psacc-rounded psacc-text-font-main psacc-text-4xl psacc-mr-5"
|
|
>
|
|
chevron_left
|
|
</button>
|
|
<button
|
|
class="splide__arrow splide__arrow--next psacc-font-materialIcons psacc-opacity-100 psacc-rounded psacc-text-font-main psacc-text-4xl"
|
|
>
|
|
chevron_right
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="splide__track psacc-mb-5">
|
|
<ul class="splide__list psacc-w-full">
|
|
{% for testimonial in testimonials %}
|
|
<li class="splide__slide">
|
|
<div class="psacc-w-10/12 psacc-ml-10 psacc-font-primary">
|
|
<p class="psacc-mb-4 psacc-text-lg">
|
|
{{ testimonial[isoCode]['sentence']|default(testimonial[defaultIsoCode]['sentence']) }}
|
|
</p>
|
|
<p class="puik-body-default psacc-font-primary">
|
|
<span class="psacc-font-bold">{{ testimonial[isoCode]['name']|default(testimonial[defaultIsoCode]['name']) }}</span>, {{ testimonial[isoCode]['enterprise']|default(testimonial[defaultIsoCode]['enterprise']) }}
|
|
</p>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
<ul class="splide__pagination"></ul>
|
|
</section>
|
|
</div>
|
|
<div
|
|
class="psacc-flex psacc-flex-col psacc-items-center psacc-justify-between psacc-bg-white psacc-py-24 psacc-shadow-[0_6px_12px_rgba(0, 0, 0, 0.1)]">
|
|
{% if loginError != '' %}
|
|
<div class="psacc-flex psacc-flex-col psacc-space-y-4 psacc-mb-4 psacc-px-4">
|
|
<div class="puik-alert puik-alert--danger" aria-live="polite">
|
|
<div class="puik-alert__content">
|
|
<span class="psacc-font-materialIcons">error</span>
|
|
<div class="puik-alert__text">
|
|
<span class="puik-alert__description">
|
|
{% if loginError == 'employee_not_found' %}
|
|
{{ 'You cannot access the back office with this account. Try another account or contact your administrator.'|trans({}, 'Modules.Ps_accounts.Login')|raw }}
|
|
{% elseif loginError == 'email_not_verified' %}
|
|
{{ 'You need to activate your account first by clicking the link in the email. If you need to receive a new activation link,[1]please click here[/1]'|trans({'[1]': '<a class="puik-link" href="' ~ ssoResendVerificationEmail ~ '" target="_blank">', '[/1]': '</a>'}, 'Modules.Ps_accounts.Login')|raw }}
|
|
{% elseif loginError == 'error_from_hydra' or loginError == 'error_other' %}
|
|
{{ 'An error occured during login, please contact PrestaShop support'|trans({}, 'Modules.Ps_accounts.Login')|raw }}
|
|
{% else %}
|
|
{{ loginError }}
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if wrong_folder_name is not defined and wrong_install_name is not defined %}
|
|
<div class="psacc-flex psacc-flex-col psacc-items-start psacc-justify-start psacc-h-full">
|
|
<h1 class="psacc-m-0 psacc-font-secondary psacc-text-5xl psacc-font-black psacc-mb-10">
|
|
PRESTASHOP
|
|
</h1>
|
|
|
|
<div class="psacc-flex psacc-flex-col psacc-items-start psacc-max-w-xl psacc-font-primary">
|
|
<h2 class="puik-h2 psacc-mb-10">
|
|
{{ 'Welcome,'|trans({}, 'Modules.Ps_accounts.Login')|raw }}</br>
|
|
</h2>
|
|
<p class="psacc-mb-10 ">
|
|
{{ 'Access your back office to manage your store.'|trans({}, 'Modules.Ps_accounts.Login')|raw }}
|
|
</p>
|
|
<button id="ps-accounts-login" class="puik-button puik-button--primary puik-button--lg psacc-w-full">
|
|
{{ 'Go to the back office'|trans({}, 'Modules.Ps_accounts.Login')|raw }}
|
|
</button>
|
|
</div>
|
|
<a class="puik-link psacc-mt-auto psacc-self-center" href="{{ legacyLoginUri }}">
|
|
{{ 'Connect with another method'|trans({}, 'Modules.Ps_accounts.Login')|raw }}
|
|
</a>
|
|
</div>
|
|
{% else %}
|
|
<div class="puik-alert puik-alert--danger" aria-live="polite">
|
|
<div class="puik-alert__content">
|
|
<span class="psacc-font-materialIcons">error</span>
|
|
<div class="puik-alert__text">
|
|
<p class="puik-alert__title">
|
|
{{ 'For security reasons, you cannot connect to the back office until you have:'|trans({}, 'Admin.Login.Notification')|raw }}
|
|
</p>
|
|
<span class="puik-alert__description">
|
|
<ul class="psacc-list-disc psacc-pl-10">
|
|
{% if wrong_install_name is defined and wrong_install_name == true %}
|
|
<li>{{ 'deleted the /install folder'|trans({}, 'Admin.Login.Notification')|raw }}</li>
|
|
{% endif %}
|
|
{% if wrong_folder_name is defined and wrong_folder_name == true %}
|
|
<li>{{ 'renamed the /admin folder (e.g. {randomNb})'|trans({}, 'Admin.Login.Notification')|raw }}
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
<a class="puik-link" href="{{ adminUrl|e('url') }}">
|
|
{{ 'Please then access this page by the new URL (e.g. {adminUrl}])'|trans({}, 'Admin.Login.Notification')|raw }}
|
|
</a>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<script>
|
|
returnTo = '{{ redirect }}';
|
|
redirectUri = "{{ oauthRedirectUri }}";
|
|
{% verbatim %}
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
//const returnTo = '{{ redirect }}';
|
|
//const redirectUri = "{{ oauthRedirectUri }}";
|
|
const locale = (navigator.language || navigator.userLanguage || 'en').slice(0, 2);
|
|
const oauth2Uri = redirectUri + '?return_to=' + encodeURIComponent(returnTo) + '&locale=' + encodeURIComponent(locale);
|
|
|
|
document.querySelector('#ps-accounts-login').addEventListener('click', function() {
|
|
document.location = oauth2Uri;
|
|
});
|
|
});
|
|
{% endverbatim %}
|
|
</script>
|
|
</body>
|
|
</html>
|