diff --git a/README.md b/README.md index 86d5cadc7..c2bb3e9c8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ NFQ Akademija ============ +# Medžiaga + +Bus remiamasi: https://github.com/aurelijusb/kickstart/pull/140 +Namų darbai: https://github.com/aurelijusb/kickstart/pull/162 + # Intro Sveiki! Tai yra Jūsų startinis projekto "template". diff --git a/config/packages/easy_admin.yaml b/config/packages/easy_admin.yaml index a34b62ecb..2634d9e5e 100644 --- a/config/packages/easy_admin.yaml +++ b/config/packages/easy_admin.yaml @@ -10,12 +10,14 @@ easy_admin: - 'username' - { property: 'roles', template: 'admin/user/roles-type-read.html.twig' } - { property: 'homepage', type: 'url' } + - { property: 'linkedin', type: 'url' } - { property: 'password', template: 'admin/user/password-read.html.twig' } form: fields: - { property: 'email', type: 'email' } - { property: 'roles', type: 'collection' } - { property: 'plainPassword', type: 'password' } + - { property: 'linkedin', type: 'url' } - { property: 'homepage', type: 'url' } user: diff --git a/src/Entity/User.php b/src/Entity/User.php index cac6aafc7..3e635716f 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -35,6 +35,28 @@ class User implements UserInterface */ private $password; + /** + * @var null|string Link to Personal linkedin + * @ORM\Column(type="string", length=255, nullable=true) + */ + private $linkedin = ""; + + /** + * @return string|null + */ + public function getLinkedin(): ?string + { + return $this->linkedin; + } + + /** + * @param string|null $linkedin + */ + public function setLinkedin(?string $linkedin): void + { + $this->linkedin = $linkedin; + } + /** * @var null|\DateTime When password was changed * @ORM\Column(type="datetime", nullable=true) diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 31024cd40..abd32eb31 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -36,6 +36,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ], ]) ->add('homepage', UrlType::class, ['required' => false]) + ->add('linkedin', UrlType::class, ['required' => false]) ->add('agreeTerms', CheckboxType::class, [ 'mapped' => false, 'constraints' => [ diff --git a/src/Migrations/Version20191125191917.php b/src/Migrations/Version20191125191917.php new file mode 100644 index 000000000..f11af798b --- /dev/null +++ b/src/Migrations/Version20191125191917.php @@ -0,0 +1,35 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE user ADD linkedin VARCHAR(255) DEFAULT NULL, CHANGE roles roles JSON NOT NULL, CHANGE homepage homepage VARCHAR(255) DEFAULT NULL, CHANGE password_changed password_changed DATETIME DEFAULT NULL'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE user DROP linkedin, CHANGE roles roles LONGTEXT NOT NULL COLLATE utf8mb4_bin, CHANGE password_changed password_changed DATETIME DEFAULT \'NULL\', CHANGE homepage homepage VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); + } +} diff --git a/templates/base.html.twig b/templates/base.html.twig index eb61ed532..9f8fc70e2 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -32,10 +32,11 @@