Skip to content

Commit

Permalink
Symfony Quest Nr.25 Challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegrand-79 committed Jan 29, 2023
1 parent 6b6cc41 commit 6b7f101
Show file tree
Hide file tree
Showing 27 changed files with 459 additions and 136 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"symfony/web-link": "6.1.*",
"symfony/webpack-encore-bundle": "^1.16",
"symfony/yaml": "6.1.*",
"symfonycasts/verify-email-bundle": "^1.13",
"twig/cssinliner-extra": "^3.5",
"twig/extensions": "^1.5",
"twig/extra-bundle": "^3.5",
Expand Down
73 changes: 60 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
];
1 change: 1 addition & 0 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ security:
# "app_login" is the name of the route created previously
login_path: app_login
check_path: app_login
default_target_path: my_profile

logout:
path: app_logout
Expand Down
31 changes: 31 additions & 0 deletions migrations/Version20230128193849.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230128193849 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user ADD is_verified TINYINT(1) NOT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP is_verified');
}
}
19 changes: 0 additions & 19 deletions src/Controller/DefaultController.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Controller/EpisodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function new(Request $request, MailerInterface $mailer, EpisodeRepository
->from($this->getParameter('mailer_from'))
->to($this->getParameter('mailer_to'))
->subject('Un nouvel épisode vient d\'être publié !')
->html($this->renderView('episode/newEpisodeEmail.html.twig', ['episode' => $episode]));
->html($this->renderView('episode/new_episode_email.html.twig', ['episode' => $episode]));
$mailer->send($email);

$episodeRepository->save($episode, true);
Expand Down
8 changes: 5 additions & 3 deletions src/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

namespace App\Controller;

use App\Repository\ProgramRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class HomeController extends AbstractController
{
#[Route('/home', name: 'app_home')]
public function index(): Response
#[Route('/', name: 'app_index')]
public function index(ProgramRepository $programRepository): Response
{
$programs = $programRepository->findAll();
return $this->render('home/index.html.twig', [
'controller_name' => 'HomeController',
'programs' => $programs,
]);
}
}
26 changes: 0 additions & 26 deletions src/Controller/LoginController.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Controller/ProgramController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function new(Request $request, MailerInterface $mailer, ProgramRepository
->from($this->getParameter('mailer_from'))
->to($this->getParameter('mailer_to'))
->subject('Une nouvelle série vient d\'être publiée !')
->html($this->renderView('program/newProgramEmail.html.twig', ['program' => $program]));
->html($this->renderView('program/new_program_email.html.twig', ['program' => $program]));

$mailer->send($email);

Expand Down
Loading

0 comments on commit 6b7f101

Please sign in to comment.