Skip to content

Commit

Permalink
Merge pull request afup#1549 from stakovicz/issue-1548-remove-worksho…
Browse files Browse the repository at this point in the history
…p-afup-day

afup#1548 remove workshop afup day
  • Loading branch information
stakovicz authored Nov 8, 2024
2 parents ee1a259 + 02965b9 commit 56485d9
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 17 deletions.
30 changes: 30 additions & 0 deletions db/seeds/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,36 @@ public function run()
'transport_information_enabled' => 1,
'has_prices_defined_with_vat' => 1,
],
[
'id' => 2,
'titre' => 'AFUP Day Lyon',
'path' => 'afup-day-lyon',
'logo_url' => 'http://78.media.tumblr.com/tumblr_lgkqc0mz9d1qfyzelo1_1280.jpg', // oui, c'est un chat
'nb_places' => 500,
'date_debut' => date('Y-m-d', $event),
'date_fin' => date('Y-m-d', $event + $oneDayInSeconds),
'annee' => date('Y', $event),
'text' => json_encode([
'fr' => 'François le français',
'en' => 'Henri l\'anglais',
'sponsor_management_fr' => '**Sponsors**, venez, vous serez très visible !',
'sponsor_management_en' => '**Sponsors**, come, you will be very visible!',
'mail_inscription_content' => 'Contenu email',
]),
'date_fin_appel_projet' => $now + $oneMonthInSeconds,
'date_fin_appel_conferencier' => $event - $oneMonthInSeconds * 2,
'date_fin_vote' => date('Y-m-d H:i:s', ($event - $oneMonthInSeconds * 2) + $oneDayInSeconds * 7),
'date_fin_prevente' => $now + $oneMonthInSeconds,
'date_fin_vente' => $event - $oneDayInSeconds * 7,
'date_fin_vente_token_sponsor' => $event - $oneDayInSeconds * 7,
'date_fin_saisie_repas_speakers' => $event - $oneDayInSeconds * 7,
'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7,
'place_name' => 'Paris',
'place_address' => 'Marriott Rive Gauche',
'date_annonce_planning' => date('Y-m-d H:i:s', $now - $oneMonthInSeconds),
'transport_information_enabled' => 1,
'has_prices_defined_with_vat' => 1,
],
];

$table = $this->table('afup_forum');
Expand Down
24 changes: 13 additions & 11 deletions htdocs/js/vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,17 @@ var setFormSuccess = function(form) {

// Gestion de la case à cocher pour la proposition d'atelier à un CFP
var textareaContainer = document.getElementById('talk_workshopAbstract');
textareaContainer = textareaContainer.closest('div');

var checkbox = document.getElementById('talk_withWorkshop');
checkbox.addEventListener('change', (event) => {
if (event.currentTarget.checked) {
textareaContainer.style.display = 'block';
} else {
textareaContainer.style.display = 'none';
}
});
if (textareaContainer) {
textareaContainer = textareaContainer.closest('div');

var checkbox = document.getElementById('talk_withWorkshop');
checkbox.addEventListener('change', (event) => {
if (event.currentTarget.checked) {
textareaContainer.style.display = 'block';
} else {
textareaContainer.style.display = 'none';
}
});

checkbox.dispatchEvent(new Event('change'));
checkbox.dispatchEvent(new Event('change'));
}
4 changes: 3 additions & 1 deletion sources/AppBundle/Controller/Event/CFP/ProposeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public function __invoke(Request $request)

$talk = new Talk();
$talk->setForumId($event->getId());
$form = $this->formFactory->create(TalkType::class, $talk);
$form = $this->formFactory->create(TalkType::class, $talk, [
TalkType::IS_AFUP_DAY => $event->isAfupDay()
]);
if ($this->talkFormHandler->handle($request, $event, $form, $speaker)) {
$this->flashBag->add('success', $this->translator->trans('Proposition enregistrée !'));

Expand Down
16 changes: 11 additions & 5 deletions sources/AppBundle/Event/Form/TalkType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
class TalkType extends AbstractType
{
const OPT_COC_CHECKED = 'codeOfConductChecked';
const IS_AFUP_DAY = 'isAfupDay';

public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down Expand Up @@ -43,16 +44,20 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'Avancé' => Talk::SKILL_SENIOR,
'N/A' => Talk::SKILL_NA
]
])
->add('withWorkshop', CheckboxType::class, [
]);

if (!$options[self::IS_AFUP_DAY]) {
$builder->add('withWorkshop', CheckboxType::class, [
'label' => "Je propose de faire un atelier",
'required' => false,
'help' => 'Lors de l’événement, nous souhaitons proposer des ateliers d’une durée de 2 heures avec une vingtaine de participant(e)s qui se seront inscrit(e)s préalablement. Seulement les speakers sélectionné(e)s effectueraient un atelier. Cochez cette case et renseignez la zone de texte ci-dessous si vous souhaitez proposer un atelier.',
])
->add('workshopAbstract', TextareaType::class, ['label' => 'Résumé de l\'atelier',
'required' => false,
])
->add('needsMentoring', CheckboxType::class, [
]);
}

$builder->add('needsMentoring', CheckboxType::class, [
'label' => "Je souhaite profiter du programme d'accompagnement des jeunes speakers",
'required' => false
])
Expand Down Expand Up @@ -83,7 +88,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
self::OPT_COC_CHECKED => false
self::OPT_COC_CHECKED => false,
self::IS_AFUP_DAY => false,
]);
}
}
35 changes: 35 additions & 0 deletions tests/behat/features/EventPages/Cfp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Feature: Event pages - CFP
And I fill in "talk[abstract]" with "L'histoire des poissons rouges à travers les ages"
And I fill in "talk[hasAllowedToSharingWithLocalOffices]" with "1"
And I check "talk[codeOfConduct]"
# Proposition d'atelier présent
And I should see "Je propose de faire un atelier"
And I should see "nous souhaitons proposer des ateliers"
And I press "Sauvegarder"
Then I should not see "Cette valeur ne doit pas être vide."
And I should see "Proposition enregistrée !"
Expand All @@ -55,3 +58,35 @@ Feature: Event pages - CFP
When I follow "Voter pour les conférences"
Then I should see "Les nouvelles conférences à noter"
And I should see "Généalogie des poissons rouges"

Scenario: On crée une nouvelle proposition pour un AFUP day en tant que userGithub1
Given I am on "/event/afup-day-lyon/cfp"
Then I should see "Oauth login test"
When I follow "Connect as userGithub1"
Then I should see "Mon espace conférencier"
When I follow "Mon profil conférencier"
# Création du profile
Then The "speaker[civility]" field should only contain the follow values '["M", "Mme"]'
When I fill in "speaker[firstname]" with "Mon prénom"
And I fill in "speaker[lastname]" with "Mon prénom"
And I fill in "speaker[email]" with "[email protected]"
And I fill in "speaker[biography]" with "Ma biographie"
And I attach the file "avatar1.png" to "speaker[photoFile]"
And I press "Sauvegarder"
# Nouvelle proposition
When I follow "Nouvelle proposition"
Then I should see "J'accepte le code de conduite et les conditions générales de participation"
When I fill in "talk[title]" with "Généalogie des poissons rouges"
And I fill in "talk[abstract]" with "L'histoire des poissons rouges à travers les ages"
And I fill in "talk[hasAllowedToSharingWithLocalOffices]" with "1"
And I check "talk[codeOfConduct]"
# Proposition d'atelier non présent
And I should not see "Je propose de faire un atelier"
And I should not see "nous souhaitons proposer des ateliers"
And I press "Sauvegarder"
Then I should not see "Cette valeur ne doit pas être vide."
And I should see "Proposition enregistrée !"
When I am on "/event/forum/cfp"
Then I should see "Généalogie des poissons rouges"
When I am on "/event/forum/vote"
Then I should not see "Généalogie des poissons rouges"

0 comments on commit 56485d9

Please sign in to comment.