Browse Source

form indiv

v1
Charly 3 years ago
parent
commit
db13f6cd07
15 changed files with 11403 additions and 11335 deletions
  1. +11
    -2
      assets/app/frontend/js/script.js
  2. +9
    -0
      assets/app/frontend/scss/base.scss
  3. +4
    -6
      assets/app/frontend/scss/contribuate.scss
  4. +0
    -11144
      public/build/app-frontend.2a8eed13.css
  5. +11151
    -0
      public/build/app-frontend.2fba4f18.css
  6. +0
    -169
      public/build/app-frontend.3bcbfd58.js
  7. +181
    -0
      public/build/app-frontend.9cc512c2.js
  8. +2
    -2
      public/build/entrypoints.json
  9. +2
    -2
      public/build/manifest.json
  10. +2
    -3
      src/Controller/Frontend/ContribuateController.php
  11. +10
    -5
      src/Form/IndividualDataForm.php
  12. +5
    -0
      templates/frontend/base.html.twig
  13. +1
    -1
      templates/frontend/contribuate.html.twig
  14. +5
    -1
      translations/admin.fr.yaml
  15. +20
    -0
      translations/frontend.fr.yaml

+ 11
- 2
assets/app/frontend/js/script.js View File

collectionHolder.appendChild(item); collectionHolder.appendChild(item);


collectionHolder.dataset.index++; collectionHolder.dataset.index++;

if (collectionHolder.dataset.index >= 6) {
e.currentTarget.style.visibility = 'hidden';
}
// add a delete link to the new form // add a delete link to the new form
addFormDeleteLink(item);
addFormDeleteLink(item, e.currentTarget);
}; };


const addFormDeleteLink = (formLi) => {
const addFormDeleteLink = (formLi, currentTarget) => {
const collectionHolder = document.querySelector('.' + currentTarget.dataset.collectionHolderClass);
const removeFormButton = document.createElement('button') const removeFormButton = document.createElement('button')
removeFormButton.classList.add('button-green', 'button-remove') removeFormButton.classList.add('button-green', 'button-remove')
removeFormButton.innerText = 'Supprimer' removeFormButton.innerText = 'Supprimer'
formLi.append(removeFormButton); formLi.append(removeFormButton);


removeFormButton.addEventListener('click', (e) => { removeFormButton.addEventListener('click', (e) => {
collectionHolder.dataset.index--;
if (collectionHolder.dataset.index <= 6) {
currentTarget.style.visibility = 'visible';
}
e.preventDefault() e.preventDefault()
formLi.remove(); formLi.remove();
}); });

+ 9
- 0
assets/app/frontend/scss/base.scss View File

font-family: dinbold; font-family: dinbold;
} }


.alert-success {
position: absolute;
top: $headerheight;
width: 100%;
text-align: center;
color: $green;
font-family: dinbold;
}

.link-slide { .link-slide {
position: relative; position: relative;
overflow: hidden; overflow: hidden;

+ 4
- 6
assets/app/frontend/scss/contribuate.scss View File

border-color: $green; border-color: $green;
height: 40px; height: 40px;
min-width: 300px; min-width: 300px;
margin-top: 15px;
margin-bottom: 15px; margin-bottom: 15px;
} }


label { label {
display: none;
margin-bottom: 0;
color: #808080;
} }


.button-remove { .button-remove {


.save { .save {
margin-top: 100px; margin-top: 100px;
paddin-top: 20px;
paddin-bottom: 20px;
padding-left: 30px;
padding-right: 30px;
border-radius: 0;
padding: 15px 40px;
font-size: 27px; font-size: 27px;
} }
} }

+ 0
- 11144
public/build/app-frontend.2a8eed13.css
File diff suppressed because it is too large
View File


+ 11151
- 0
public/build/app-frontend.2fba4f18.css
File diff suppressed because it is too large
View File


+ 0
- 169
public/build/app-frontend.3bcbfd58.js
File diff suppressed because it is too large
View File


+ 181
- 0
public/build/app-frontend.9cc512c2.js
File diff suppressed because it is too large
View File


+ 2
- 2
public/build/entrypoints.json View File

"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", "/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js",
"/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", "/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js",
"/build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js", "/build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js",
"/build/app-frontend.3bcbfd58.js"
"/build/app-frontend.9cc512c2.js"
], ],
"css": [ "css": [
"/build/app-frontend.2a8eed13.css"
"/build/app-frontend.2fba4f18.css"
] ]
} }
} }

+ 2
- 2
public/build/manifest.json View File

"build/sov-ticket.js": "/build/sov-ticket.df76c7a0.js", "build/sov-ticket.js": "/build/sov-ticket.df76c7a0.js",
"build/app-backend.css": "/build/app-backend.3d882954.css", "build/app-backend.css": "/build/app-backend.3d882954.css",
"build/app-backend.js": "/build/app-backend.e87ef456.js", "build/app-backend.js": "/build/app-backend.e87ef456.js",
"build/app-frontend.css": "/build/app-frontend.2a8eed13.css",
"build/app-frontend.js": "/build/app-frontend.3bcbfd58.js",
"build/app-frontend.css": "/build/app-frontend.2fba4f18.css",
"build/app-frontend.js": "/build/app-frontend.9cc512c2.js",
"build/runtime.js": "/build/runtime.3095b250.js", "build/runtime.js": "/build/runtime.3095b250.js",
"build/vendors-node_modules_core-js_internals_export_js.2e873f33.js": "/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", "build/vendors-node_modules_core-js_internals_export_js.2e873f33.js": "/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js",
"build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", "build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js",

+ 2
- 3
src/Controller/Frontend/ContribuateController.php View File



$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
// dump($individualData);
// dump($form);
// die;
$individualData->setStatus(0); $individualData->setStatus(0);
$entityManager->create($individualData); $entityManager->create($individualData);
$entityManager->flush(); $entityManager->flush();
$this->addFlash('success', 'Votre contribution a bien été prise en compte !');
} }

return $this->render( return $this->render(
'frontend/contribuate.html.twig', 'frontend/contribuate.html.twig',
[ [

+ 10
- 5
src/Form/IndividualDataForm.php View File

{ {
$builder $builder
->add('territory', EntityType::class, [ ->add('territory', EntityType::class, [
'label' => 'Je suis un.e citoyen.ne du',
'label' => 'form.field.territory.label',
'translation_domain' => 'frontend',
'class' => Territory::class, 'class' => Territory::class,
'expanded' => true, 'expanded' => true,
'multiple' => false, 'multiple' => false,
]) ])
->add('revolt', CollectionType::class, [ ->add('revolt', CollectionType::class, [
'label' => 'form.field.revolt.label',
'translation_domain' => 'frontend',
'entry_type' => RevoltType::class, 'entry_type' => RevoltType::class,
'entry_options' => [ 'entry_options' => [
'context' => $options['context'], 'context' => $options['context'],
'label' => false, 'label' => false,
], ],
'label' => 'Qu’est ce qui vous révolte sur votre territoire ?',
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
'by_reference' => false, 'by_reference' => false,
]) ])
->add('dream', CollectionType::class, [ ->add('dream', CollectionType::class, [
'label' => 'form.field.dream.label',
'translation_domain' => 'frontend',
'entry_type' => DreamType::class, 'entry_type' => DreamType::class,
'entry_options' => [ 'entry_options' => [
'context' => $options['context'], 'context' => $options['context'],
'label' => false, 'label' => false,
], ],
'label' => 'Quel est votre ou vos rêves pour votre territoire ?',
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
'by_reference' => false, 'by_reference' => false,
]) ])
->add('projectBoost', CollectionType::class, [ ->add('projectBoost', CollectionType::class, [
'label' => 'form.field.projectBoost.label',
'translation_domain' => 'frontend',
'entry_type' => ProjectBoostType::class, 'entry_type' => ProjectBoostType::class,
'entry_options' => [ 'entry_options' => [
'context' => $options['context'], 'context' => $options['context'],
'label' => false, 'label' => false,
], ],
'label' => 'Quelles initiatives locales meriteraient à votre avis d’être davantage soutenues ?',
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
'by_reference' => false, 'by_reference' => false,
]) ])
->add('projectInspiring', CollectionType::class, [ ->add('projectInspiring', CollectionType::class, [
'label' => 'form.field.projectinspiring.label',
'translation_domain' => 'frontend',
'entry_type' => ProjectInspiringType::class, 'entry_type' => ProjectInspiringType::class,
'entry_options' => [ 'entry_options' => [
'context' => $options['context'], 'context' => $options['context'],
'label' => false, 'label' => false,
], ],
'label' => 'Quelles initiatives que vous avez pû découvrir ailleurs auraient à votre avis toute leur place sur votre territoire ?',
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
'by_reference' => false, 'by_reference' => false,

+ 5
- 0
templates/frontend/base.html.twig View File

</head> </head>
{% set current_path = app.request.get('_route') %} {% set current_path = app.request.get('_route') %}
<body id="{{ current_path }}"> <body id="{{ current_path }}">
{% for message in app.flashes('success') %}
<div class="alert alert-success">
{{ message }}
</div>
{% endfor %}
{% block header %} {% block header %}
{% include 'frontend/header.html.twig' %} {% include 'frontend/header.html.twig' %}
{% endblock %} {% endblock %}

+ 1
- 1
templates/frontend/contribuate.html.twig View File

<div class="col-12"> <div class="col-12">
<h1 class="title-form">Formulaire de contribution individuel</h1> <h1 class="title-form">Formulaire de contribution individuel</h1>
{{ form_start(form) }} {{ form_start(form) }}
{% form_theme form '@LcSov/adminlte/crud/form_theme.html.twig' %}


<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="col-12"> <div class="col-12">
<ul class="list-territory"> <ul class="list-territory">
{% for field in form.territory.children %} {% for field in form.territory.children %}
{# {{ dump(form.territory) }} #}
<li> <li>
{{ form_widget(field) }} {{ form_widget(field) }}
{{ form_label(field) }} {{ form_label(field) }}

+ 5
- 1
translations/admin.fr.yaml View File

dream: dream:
description: Description description: Description
thematic: Thématique thematic: Thématique
subthematic: Sous-thème
projectBoost: projectBoost:
description: Description description: Description
thematic: Thématique thematic: Thématique
subthematic: Sous-thème
projectinspiring: projectinspiring:
description: Description description: Description
thematic: Thématique thematic: Thématique
subthematic: Sous-thème
revolt: revolt:
description: Description description: Description
thematic: Thématique
thematic: Thématique
subthematic: Sous-thème

+ 20
- 0
translations/frontend.fr.yaml View File

form:
field:
territory:
label: Je suis un.e citoyen.ne du
revolt:
label: Qu’est ce qui vous révolte sur votre territoire ?
description: Description
thematic: Thématique
dream:
label: Quel est votre ou vos rêves pour votre territoire ?
description: Description
thematic: Thématique
projectBoost:
label: Quelles initiatives locales meriteraient à votre avis d’être davantage soutenues ?
description: Description
thematic: Thématique
projectinspiring:
label: Quelles initiatives que vous avez pû découvrir ailleurs auraient à votre avis toute leur place sur votre territoire ?
description: Description
thematic: Thématique

Loading…
Cancel
Save