From 63a1d3d412ae43802739a73754a8b05ec8d0eb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 28 Oct 2024 18:15:57 +0100 Subject: [PATCH] Minor UI stuff + migrations --- assets/app.js | 8 +++++++ migrations/Version20241027200741.php | 31 ++++++++++++++++++++++++++ migrations/Version20241027203015.php | 33 ++++++++++++++++++++++++++++ templates/data_entry.html.twig | 3 +++ 4 files changed, 75 insertions(+) create mode 100644 migrations/Version20241027200741.php create mode 100644 migrations/Version20241027203015.php diff --git a/assets/app.js b/assets/app.js index 95ba467..cbcfb63 100644 --- a/assets/app.js +++ b/assets/app.js @@ -45,6 +45,7 @@ if (location.pathname.includes('login')) { if (! location.pathname.includes('login')) { const vocabs = document.querySelector('#vocabs'); const userMenu = document.querySelector('.dropdown-trigger'); + const userCaret = document.querySelector('#user-caret'); document.querySelector('#for-vocabs').addEventListener('click', function () { vocabs.classList.toggle('is-hidden'); @@ -60,5 +61,12 @@ if (! location.pathname.includes('login')) { userMenu.addEventListener('click', function () { document.querySelector('.dropdown').classList.toggle('is-active'); + if (userCaret.classList.contains('fa-caret-down')) { + userCaret.classList.remove('fa-caret-down'); + userCaret.classList.add('fa-caret-up'); + } else { + userCaret.classList.remove('fa-caret-up'); + userCaret.classList.add('fa-caret-down'); + } }); } \ No newline at end of file diff --git a/migrations/Version20241027200741.php b/migrations/Version20241027200741.php new file mode 100644 index 0000000..19fb3b2 --- /dev/null +++ b/migrations/Version20241027200741.php @@ -0,0 +1,31 @@ +addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, roles JSON NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, firstname VARCHAR(30) DEFAULT NULL, lastname VARCHAR(40) DEFAULT NULL, UNIQUE INDEX UNIQ_IDENTIFIER_USERNAME (username), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE user'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/templates/data_entry.html.twig b/templates/data_entry.html.twig index 73af565..acc14e6 100644 --- a/templates/data_entry.html.twig +++ b/templates/data_entry.html.twig @@ -20,6 +20,9 @@ {{ app.user.firstname }} {{ app.user.lastname }} + + +