Hello, {{ app.user.displayName }}
- --
+
- + {{ 'heading.roles'|trans }} + +
-
+
- + Write an article + +
- + Create a journal + +
- + {{ 'heading.logout'|trans }} + +
diff --git a/assets/styles/app.css b/assets/styles/app.css index 3672d01..9c4ddcf 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -65,7 +65,7 @@ strong, .strong { } a { - color: var(--color-primary); + color: var(--color-secondary); text-decoration: none; } @@ -170,6 +170,10 @@ svg.icon { list-style: none; } +.header__logo h1 { + font-weight: bold; +} + .header__logo img { height: 40px; /* Adjust the height as needed */ } diff --git a/assets/styles/theme.css b/assets/styles/theme.css index 245c2ca..bdcdac0 100644 --- a/assets/styles/theme.css +++ b/assets/styles/theme.css @@ -3,12 +3,13 @@ @import url('https://fonts.googleapis.com/css2?family=Josefin+Slab:ital,wght@0,100..700;1,100..700&display=swap'); :root { - --color-bg: #121212; /* Black background */ - --color-bg-light: #333; /* Lighter black background */ + --color-bg: #222; /* Black background */ + --color-bg-light: #444; /* Lighter black background */ + --color-bg-primary: #2b1a2b; --color-text: #ffffff; /* White text */ --color-text-mid: #eee; /* Light gray text */ --color-text-contrast: #000; /* Black text for contrast */ - --color-primary: #8e4585; /* Plum primary color */ + --color-primary: #a2559c; /* Plum primary color */ --color-secondary: #9CAF88; /* secondary color */ --color-border: #333; /* White border for contrast */ --font-family: 'Montserrat'; /* Set the Montserrat font as default */ diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 39e42b7..bcf5396 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -28,7 +28,7 @@ security: # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: - # - { path: ^/admin, roles: ROLE_ADMIN } + - { path: ^/admin, roles: ROLE_USER } # - { path: ^/profile, roles: ROLE_USER } when@test: diff --git a/migrations/Version20241210175624.php b/migrations/Version20241210175624.php new file mode 100644 index 0000000..ce7cab7 --- /dev/null +++ b/migrations/Version20241210175624.php @@ -0,0 +1,35 @@ +addSql('CREATE TABLE journal (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE app_user ALTER name DROP NOT NULL'); + $this->addSql('ALTER TABLE app_user ALTER display_name DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE journal'); + $this->addSql('ALTER TABLE app_user ALTER name SET NOT NULL'); + $this->addSql('ALTER TABLE app_user ALTER display_name SET NOT NULL'); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 37f61d2..ed589c8 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -22,10 +22,10 @@ class User implements UserInterface #[ORM\Column(unique: true)] private ?string $npub = null; - #[ORM\Column] + #[ORM\Column(nullable: true)] private ?string $name = null; - #[ORM\Column] + #[ORM\Column(nullable: true)] private ?string $displayName = null; #[ORM\Column(type: Types::TEXT, nullable: true)] diff --git a/src/Repository/UserEntityRepository.php b/src/Repository/UserEntityRepository.php index 2df090f..cd682c4 100644 --- a/src/Repository/UserEntityRepository.php +++ b/src/Repository/UserEntityRepository.php @@ -17,7 +17,7 @@ class UserEntityRepository extends ServiceEntityRepository { $entity = $this->findOneBy(['npub' => $user->getNpub()]); - if ($entity) { + if (!!$entity) { $user->setId($entity->getId()); } $this->entityManager->persist($user); diff --git a/templates/base.html.twig b/templates/base.html.twig index c027b68..49d8a7e 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -4,6 +4,7 @@
Hello, {{ app.user.displayName }}
- -