-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request afup#1516 from Zarlokh/fix/charter-page-inscription
fix/charter-page-inscription : afup#1139 - Déplace la page d'inscription
- Loading branch information
Showing
19 changed files
with
266 additions
and
202 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
app/Resources/views/admin/association/membership/register.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends ':admin/association/membership:_base.html.twig' %} | ||
|
||
{% block page_title %}Formulaire d'inscription à l'AFUP{% endblock %} | ||
|
||
{% block submenu %} | ||
{{ render(controller( | ||
'AppBundle\\Controller\\SecondaryMenuController::displayAction', | ||
{ 'feuille_id': constant('Afup\\Site\\Corporate\\Feuille::ID_FEUILLE_ASSOCIATION') } | ||
)) }} | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
<article id="company-membership"> | ||
{{ form_start(form) }} | ||
<fieldset> | ||
<legend>Information</legend> | ||
<div> | ||
{{ form_errors(form) }} | ||
{{ form_row(form.civility) }} | ||
{{ form_row(form.userCommonInfo.lastName) }} | ||
{{ form_row(form.userCommonInfo.firstName) }} | ||
{{ form_row(form.userCommonInfo.username) }} | ||
{{ form_row(form.userCommonInfo.email) }} | ||
{{ form_row(form.userCommonInfo.address) }} | ||
{{ form_row(form.userCommonInfo.zipcode) }} | ||
{{ form_row(form.userCommonInfo.city) }} | ||
{{ form_row(form.country) }} | ||
{{ form_row(form.userCommonInfo.phone) }} | ||
{{ form_row(form.mobilephone) }} | ||
{{ form_row(form.nearestOffice) }} | ||
<div> | ||
{{ form_widget(form.userCommonInfo.password) }} | ||
</div> | ||
</div> | ||
</fieldset> | ||
<div class="right"> | ||
{{ form_widget(form.userCommonInfo.save, {attr: { "class": "button button--call-to-action"}}) }} | ||
</div> | ||
{{ form_end(form) }} | ||
</article> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% use 'form_div_layout.html.twig' %} | ||
|
||
{% block form_row %} | ||
{{ parent() }} | ||
{% if form.vars.help ?? false %} | ||
<div> | ||
<label></label> | ||
<span class="form-help">{{ form.vars.help }}</span> | ||
</div> | ||
{% endif %} | ||
{% endblock form_row %} | ||
|
||
{# TODO : A supprimer une fois monté de version suffisante pour que ce soit SF qu'ils fassent la gestion de "*" dans le cas où le champs est required #} | ||
{% block form_label %} | ||
{% if label is not same as(false) -%} | ||
{% if not compound -%} | ||
{% set label_attr = label_attr|merge({'for': id}) %} | ||
{%- endif -%} | ||
{% if required -%} | ||
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} | ||
{%- endif -%} | ||
{% if label is empty -%} | ||
{%- if label_format is not empty -%} | ||
{% set label = label_format|replace({ | ||
'%name%': name, | ||
'%id%': id, | ||
}) %} | ||
{%- else -%} | ||
{% set label = name|humanize %} | ||
{%- endif -%} | ||
{%- endif -%} | ||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}> | ||
{%- if translation_domain is same as(false) -%} | ||
{{- label -}} | ||
{%- else -%} | ||
{{- label|trans({}, translation_domain) -}} | ||
{%- endif -%} | ||
{# OVERRIDE #} | ||
{% if required -%} | ||
* | ||
{%- endif -%} | ||
{# END OVERRIDE #} | ||
</{{ element|default('label') }}> | ||
{%- endif -%} | ||
{% endblock form_label %} | ||
|
||
{%- block form_errors -%} | ||
{%- if errors|length > 0 -%} | ||
{%- for error in errors -%} | ||
<div> | ||
<label></label> | ||
<span style="color: red;">{{ error.message }}</span> | ||
</div> | ||
{%- endfor -%} | ||
<label></label> | ||
{%- endif -%} | ||
{%- endblock form_errors -%} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
app/Resources/views/site/member/company_public_profile.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace AppBundle\Association\Factory; | ||
|
||
use AppBundle\Association\Model\User; | ||
|
||
class UserFactory | ||
{ | ||
public function createForRegister(): User | ||
{ | ||
$user = new User(); | ||
|
||
return | ||
$user | ||
->setCivility(User::CIVILITE_M) | ||
->setCountry('FR') | ||
->setLevel(User::LEVEL_MEMBER) | ||
->setStatus(User::STATUS_ACTIVE) | ||
->setDirectoryLevel(User::LEVEL_MEMBER) | ||
; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
sources/AppBundle/Association/Form/NearestOfficeChoiceType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace AppBundle\Association\Form; | ||
|
||
use AppBundle\Offices\OfficesCollection; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class NearestOfficeChoiceType extends AbstractType | ||
{ | ||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
parent::configureOptions($resolver); | ||
|
||
$officesCollection = new OfficesCollection(); | ||
$offices = ['-Aucune-' => '']; | ||
foreach ($officesCollection->getOrderedLabelsByKey() as $key => $label) { | ||
$offices[$label] = $key; | ||
} | ||
|
||
$resolver->setDefaults(['choices' => $offices]); | ||
} | ||
|
||
public function getParent() | ||
{ | ||
return ChoiceType::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace AppBundle\Association\Form; | ||
|
||
use AppBundle\Association\Model\User; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\Form\Extension\Core\Type\CountryType; | ||
use Symfony\Component\Form\Extension\Core\Type\TelType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class RegisterUserType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options) | ||
{ | ||
$builder | ||
->add('userCommonInfo', UserType::class, [ | ||
'inherit_data' => true, | ||
'data_class' => User::class, | ||
]) | ||
->add('country', CountryType::class, [ | ||
'label' => 'Pays', | ||
'required' => true | ||
]) | ||
->add('mobilephone', TelType::class, [ | ||
'label' => 'Portable', | ||
'required' => false | ||
]) | ||
->add('nearestOffice', NearestOfficeChoiceType::class, [ | ||
'required' => false | ||
]) | ||
->add('civility', ChoiceType::class, [ | ||
'choices' => ['M.' => User::CIVILITE_M, 'Mme' => User::CIVILITE_MME], | ||
'required' => true | ||
]) | ||
; | ||
|
||
$builder->get('userCommonInfo')->add('phone', TextType::class, [ | ||
'required' => false | ||
]); | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults([ | ||
'data_class' => User::class, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.