diff --git a/src/Controller/PodcastController.php b/src/Controller/PodcastController.php index ef9b7a0..4032406 100644 --- a/src/Controller/PodcastController.php +++ b/src/Controller/PodcastController.php @@ -15,14 +15,14 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\String\Slugger\SluggerInterface; -#[Route('/manage/podcast')] +#[Route('/manage/podcasts')] class PodcastController extends AbstractController { #[Route('/', name: 'app_podcast_index', methods: ['GET'])] public function index(PodcastRepository $podcastRepository): Response { return $this->render('podcast/index.html.twig', [ - 'podcasts' => $podcastRepository->findAllOrderedById(), + 'podcasts' => $podcastRepository->findOwnedBy($this->getUser()) ]); } diff --git a/src/Form/PodcastType.php b/src/Form/PodcastType.php index 7343d63..384a37b 100644 --- a/src/Form/PodcastType.php +++ b/src/Form/PodcastType.php @@ -47,7 +47,7 @@ class PodcastType extends AbstractType ]), ]) ->add('owner', EntityType::class, [ - 'help' => 'The podcast owner is the only user of this instance able to see and modify it.', + 'help' => 'The podcast owner is the only user of this instance able to modify it.', 'class' => User::class, 'disabled' => true, ]) diff --git a/src/Repository/PodcastRepository.php b/src/Repository/PodcastRepository.php index 4ad6110..3a5bbfc 100644 --- a/src/Repository/PodcastRepository.php +++ b/src/Repository/PodcastRepository.php @@ -3,6 +3,7 @@ namespace App\Repository; use App\Entity\Podcast; +use App\Entity\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; @@ -39,8 +40,8 @@ class PodcastRepository extends ServiceEntityRepository } } - public function findAllOrderedById(): array + public function findOwnedBy(User $user): array { - return $this->findBy([], ['id' => 'ASC']); + return $this->findBy(['owner' => $user], ['id' => 'ASC']); } } diff --git a/templates/base.html.twig b/templates/base.html.twig index 99928ec..7f9ff9b 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -4,11 +4,13 @@
The LSBC project is licensed as GPLv3.
+ {% endblock %} diff --git a/templates/login/index.html.twig b/templates/login/index.html.twig index 6418537..90e2d91 100644 --- a/templates/login/index.html.twig +++ b/templates/login/index.html.twig @@ -22,8 +22,7 @@ form { display: flex; flex-direction: column; gap: 0.5em; } - {# If you want to control the URL the user is redirected to on success - #} + diff --git a/templates/podcast/_delete_form.html.twig b/templates/podcast/_delete_form.html.twig index aae9488..462b284 100644 --- a/templates/podcast/_delete_form.html.twig +++ b/templates/podcast/_delete_form.html.twig @@ -1,4 +1,8 @@ - diff --git a/templates/podcast/_form.html.twig b/templates/podcast/_form.html.twig index bf20b98..06442b5 100644 --- a/templates/podcast/_form.html.twig +++ b/templates/podcast/_form.html.twig @@ -1,4 +1,4 @@ {{ form_start(form) }} - {{ form_widget(form) }} - + {{ form_widget(form) }} + {{ form_end(form) }} diff --git a/templates/podcast/edit.html.twig b/templates/podcast/edit.html.twig index 6d80131..c3153f5 100644 --- a/templates/podcast/edit.html.twig +++ b/templates/podcast/edit.html.twig @@ -3,11 +3,11 @@ {% block title %}Edit Podcast{% endblock %} {% block body %} -Id | -Name | -Author | -Logo | -actions | -
---|---|---|---|---|
{{ podcast.id }} | -{{ podcast.name }} ( {{ podcast.slug }} ) |
- {{ podcast.author }} | -- | - show - edit - | -
no records found | -