diff --git a/migrations/Version20220407185812.php b/migrations/Version20220407185812.php new file mode 100644 index 0000000..6fcfb84 --- /dev/null +++ b/migrations/Version20220407185812.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE directory ADD gang_info VARCHAR(255) DEFAULT 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 gang_info'); + } +} diff --git a/migrations/Version20220407191942.php b/migrations/Version20220407191942.php new file mode 100644 index 0000000..dceced3 --- /dev/null +++ b/migrations/Version20220407191942.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE directory ADD has_no_papers 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 has_no_papers'); + } +} diff --git a/package.json b/package.json index 717ab45..3c5c6ef 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,3 @@ { - "version": "0.1.1" + "version": "0.1.2" } diff --git a/public/css/custom.css b/public/css/custom.css index e9b3b1f..6580115 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -69,11 +69,6 @@ ul.timeline > li:before { background-color: #000; } -.directory-picture-card { - max-width: 80px; - max-height: 80px; -} - .pulse { border-radius: 0%; diff --git a/src/Controller/DirectoryController.php b/src/Controller/DirectoryController.php index c4ebef6..7f7d6c6 100644 --- a/src/Controller/DirectoryController.php +++ b/src/Controller/DirectoryController.php @@ -34,7 +34,9 @@ class DirectoryController extends AbstractController $searchForm = $this->createForm(SearchBarType::class); $searchForm->handleRequest($request); - $req = $DirectoryRepository->list() + $req = $DirectoryRepository + ->list() + ->order(['createdAt' => 'DESC']) ->search( ( $searchForm->isSubmitted() diff --git a/src/Entity/Directory.php b/src/Entity/Directory.php index 9539be7..710a95e 100644 --- a/src/Entity/Directory.php +++ b/src/Entity/Directory.php @@ -457,6 +457,16 @@ class Directory */ private $folders; + /** + * @ORM\Column(type="string", length=255, nullable=true) + */ + private $gangInfo; + + /** + * @ORM\Column(type="boolean", options={"default":"0"}) + */ + private $hasNoPapers = false; + public function __construct() { @@ -1438,4 +1448,28 @@ class Directory return $this; } + + public function getGangInfo(): ?string + { + return $this->gangInfo; + } + + public function setGangInfo(?string $gangInfo): self + { + $this->gangInfo = $gangInfo; + + return $this; + } + + public function getHasNoPapers(): ?bool + { + return $this->hasNoPapers; + } + + public function setHasNoPapers(bool $hasNoPapers): self + { + $this->hasNoPapers = $hasNoPapers; + + return $this; + } } diff --git a/src/Form/DirectoryType.php b/src/Form/DirectoryType.php index 8e9e5d1..2cc1da1 100644 --- a/src/Form/DirectoryType.php +++ b/src/Form/DirectoryType.php @@ -57,11 +57,14 @@ class DirectoryType extends AbstractType ->add('height', HeightType::class) ->add('weight', WeightType::class) ->add('address', AddressType::class, ['required' => false]) + ->add('hasNoPapers', null, ['label' => 'form_label_hasnopapers']) ; + if ($user->getAdminMode() || in_array('general_legal_view', $userPermissions)) { $builder ->add('gang', GangListType::class) + ->add('gangInfo', null, ['label' => 'form_label_gang_info']) ->add('wanted', null, ['label' => 'form_label_wanted']) ->add('wantedReason', null, ['label' => 'form_label_wantedReason', 'help' => 'form_help_wantedReason']) ; diff --git a/src/Form/Type/GangListType.php b/src/Form/Type/GangListType.php index 194e530..3b62bb2 100644 --- a/src/Form/Type/GangListType.php +++ b/src/Form/Type/GangListType.php @@ -22,7 +22,7 @@ class GangListType extends AbstractType 'choice_label' => 'title', 'placeholder' => 'form_placeholder_gang', 'help' => 'form_help_gang', - 'label' => false, + 'label' => 'form_label_gang', 'required' => false ]); } diff --git a/src/Repository/DirectoryRepository.php b/src/Repository/DirectoryRepository.php index a8d3624..dc74587 100644 --- a/src/Repository/DirectoryRepository.php +++ b/src/Repository/DirectoryRepository.php @@ -36,7 +36,8 @@ class DirectoryRepository extends ServiceEntityRepository 'medicalBloodGroup', 'medicalDrugs', 'medicalAlcohol', - 'medicalTreatment' + 'medicalTreatment', + 'gangInfo' ]; //list fields we can search in } diff --git a/templates/_cells/directoryCard.html.twig b/templates/_cells/directoryCard.html.twig index 6907e90..65a7234 100644 --- a/templates/_cells/directoryCard.html.twig +++ b/templates/_cells/directoryCard.html.twig @@ -7,46 +7,46 @@