{% extends 'layout_web.html.twig' %}
{% block title %}{{ 'register.title'|trans }}
|
{{parent()}}
{% endblock %}
{% block body %}
<div class="page">
<div class="page-single">
<div class="container">
<div class="row">
<div class="col col-md-5 mx-auto">
<div class="text-center mb-6">
<img src="{{ asset('/images/logo-pbn-200x100.png')}}" alt="{{appname}}">
</div>
{% for flashError in app.flashes('verify_email_error') %}
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
{% endfor %}
{{ form_start(registrationForm,{ 'attr': {'class': 'card'} }) }}
<div class="card-body p-6">
<div class="float-right">
<a
href="{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': ''})) }}">
<span class="flag flag-fr mr-3"></span></a>
<a
href="{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'en'})) }}">
<span class="flag flag-gb"></span></a>
</div>
<div class="card-title">{{ 'register.title'|trans }}</div>
<div class="form-group">
{{ form_label(registrationForm.email, 'register.email', { 'label_attr': {'class': 'form-label'} }) }}
{{ form_widget(registrationForm.email,{ 'attr': {'class': form_errors(registrationForm.email) == null ? 'form-control' : 'form-control is-invalid'} }) }}
<div class="form-error invalid-feedback">
{{ form_errors(registrationForm.email) }}
</div>
</div>
<div class="form-group">
{{ form_label(registrationForm.plainPassword, 'register.password', { 'label_attr': {'class': 'form-label'} }) }}
{{ form_widget(registrationForm.plainPassword,{ 'attr': {'class': form_errors(registrationForm.plainPassword) == null ? 'form-control' : 'form-control is-invalid'} }) }}
<i class="fe fe-eye-off" id="togglePassword"></i>
<div class="form-error invalid-feedback">
{{ form_errors(registrationForm.plainPassword) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ form_label(registrationForm.firstname, 'user.firstname', { 'label_attr': {'class': 'form-label'} }) }}
{{ form_widget(registrationForm.firstname,{ 'attr': {'class': form_errors(registrationForm.firstname) == null ? 'form-control' : 'form-control is-invalid'} }) }}
<div class="form-error invalid-feedback">
{{ form_errors(registrationForm.firstname) }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ form_label(registrationForm.lastname, 'user.lastname', { 'label_attr': {'class': 'form-label'} }) }}
{{ form_widget(registrationForm.lastname,{ 'attr': {'class': form_errors(registrationForm.lastname) == null ? 'form-control' : 'form-control is-invalid'} }) }}
<div class="form-error invalid-feedback">
{{ form_errors(registrationForm.lastname) }}
</div>
</div>
</div>
</div>
<div class="form-group">
{{ form_label(registrationForm.company, 'user.company', { 'label_attr': {'class': 'form-label'} }) }}
{{ form_widget(registrationForm.company,{ 'attr': {'class': form_errors(registrationForm.company) == null ? 'form-control' : 'form-control is-invalid'} }) }}
<div class="form-error invalid-feedback">
{{ form_errors(registrationForm.company) }}
</div>
</div>
<button class="btn btn-primary btn-block">{{ 'register.title'|trans }}</button>
</div>
{{ form_end(registrationForm) }}
</div>
</div>
</div>
</div>
</div>
<style>
#togglePassword {
position: absolute;
right: 1.5em;
cursor: pointer;
margin-right: 25px;
margin-top: -27px;
}
</style>
<script>
const togglePassword = document.querySelector("#togglePassword");
const password = document.querySelector("#registration_form_plainPassword");
togglePassword.addEventListener("click", function () {
// toggle the type attribute
const type = password.getAttribute("type") === "password" ? "text" : "password";
password.setAttribute("type", type);
// toggle the icon
if (type == "text") {
this.classList.remove("fe-eye-off");
this.classList.add("fe-eye");
}
if (type == "password") {
this.classList.remove("fe-eye");
this.classList.add("fe-eye-off");
}
});
</script>
{% endblock %}