diff --git a/migrations/Version20221125100938.php b/migrations/Version20221125100938.php new file mode 100644 index 0000000..162a2da --- /dev/null +++ b/migrations/Version20221125100938.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE directory ADD wanted_public_reason TINYINT(1) DEFAULT \'0\' NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE directory DROP wanted_public_reason'); + } +} diff --git a/src/Controller/TemplateController.php b/src/Controller/TemplateController.php index 9fabf3a..8bc21a5 100644 --- a/src/Controller/TemplateController.php +++ b/src/Controller/TemplateController.php @@ -19,7 +19,7 @@ class TemplateController extends AbstractController /** * @var Array $templates */ - $templates = $TemplateRepository->listForUser($this->getUser())->getResult(); + $templates = $TemplateRepository->listForUser($this->getUser())->archive(false)->getResult(); $json = []; foreach ($templates as $template) { diff --git a/src/Entity/Directory.php b/src/Entity/Directory.php index c923730..f155aab 100644 --- a/src/Entity/Directory.php +++ b/src/Entity/Directory.php @@ -427,6 +427,12 @@ class Directory */ private $wantedPublicDisplay = false; + /** + * @ORM\Column(type="boolean", options={"default":"0"}) + * @Gedmo\Versioned + */ + private $wantedPublicReason = false; + /** * @ORM\OneToMany(targetEntity=Infringement::class, mappedBy="directory", orphanRemoval=true) * @ORM\OrderBy({"createdAt" = "DESC"}) @@ -1376,6 +1382,18 @@ class Directory return $this; } + public function getWantedPublicReason(): ?bool + { + return $this->wantedPublicReason; + } + + public function setWantedPublicReason(bool $wantedPublicReason): self + { + $this->wantedPublicReason = $wantedPublicReason; + + return $this; + } + /** * @return Collection|Infringement[] */ diff --git a/src/Form/DirectoryType.php b/src/Form/DirectoryType.php index 7e64dee..5b3dc1d 100644 --- a/src/Form/DirectoryType.php +++ b/src/Form/DirectoryType.php @@ -69,6 +69,7 @@ class DirectoryType extends AbstractType ->add('wantedReason', null, ['label' => 'form_label_wantedReason', 'help' => 'form_help_wantedReason']) ->add('wantedDisplay', null, ['label' => 'form_label_wantedDisplay']) ->add('wantedPublicDisplay', null, ['label' => 'form_label_wantedPublicDisplay']) + ->add('wantedPublicReason', null, ['label' => 'form_label_wantedPublicReason']) ; } diff --git a/templates/_cells/directoryCard.html.twig b/templates/_cells/directoryCard.html.twig index d18188b..0a0023c 100644 --- a/templates/_cells/directoryCard.html.twig +++ b/templates/_cells/directoryCard.html.twig @@ -63,7 +63,10 @@ {% if directory.hasnopapers %}