From cdcb4258398def09d156a2f1c1f7d131b66568a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 28 Oct 2024 16:44:08 +0100 Subject: [PATCH] More layout fiddling... --- assets/app.js | 6 + config/packages/framework.yaml | 5 +- config/packages/security.yaml | 3 + templates/base.html.twig | 4 +- templates/data_entry.html.twig | 213 +++++++++++++++++++++++++++++++++ templates/home/index.html.twig | 73 ++++------- 6 files changed, 249 insertions(+), 55 deletions(-) create mode 100644 templates/data_entry.html.twig diff --git a/assets/app.js b/assets/app.js index 71efa05..95ba467 100644 --- a/assets/app.js +++ b/assets/app.js @@ -44,6 +44,8 @@ if (location.pathname.includes('login')) { if (! location.pathname.includes('login')) { const vocabs = document.querySelector('#vocabs'); + const userMenu = document.querySelector('.dropdown-trigger'); + document.querySelector('#for-vocabs').addEventListener('click', function () { vocabs.classList.toggle('is-hidden'); @@ -55,4 +57,8 @@ if (! location.pathname.includes('login')) { this.firstElementChild.classList.add('fa-angle-right'); } }); + + userMenu.addEventListener('click', function () { + document.querySelector('.dropdown').classList.toggle('is-active'); + }); } \ No newline at end of file diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 877eb25..4b88a05 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,7 +1,7 @@ # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: '%env(APP_SECRET)%' - #csrf_protection: true + csrf_protection: true # Note that the session will be started ONLY if you read or write from it. session: true @@ -12,5 +12,8 @@ framework: when@test: framework: test: true + form: + csrf_protection: + enabled: true session: storage_factory_id: session.storage.factory.mock_file diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 43632b6..c0b46ab 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -19,6 +19,9 @@ security: login_path: app_login check_path: app_login enable_csrf: true + logout: + path: /logout + target: app_login lazy: true provider: app_user_provider diff --git a/templates/base.html.twig b/templates/base.html.twig index ee542bf..c397cb3 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -14,7 +14,7 @@ {% block body %}{% endblock %} - diff --git a/templates/data_entry.html.twig b/templates/data_entry.html.twig new file mode 100644 index 0000000..73af565 --- /dev/null +++ b/templates/data_entry.html.twig @@ -0,0 +1,213 @@ +{% extends 'base.html.twig' %} + +{% block body %} + + +
+ +
+ {% block rightpanel %}{% endblock %} +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index aacddf5..60bca47 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -1,63 +1,32 @@ -{% extends 'base.html.twig' %} +{% extends 'data_entry.html.twig' %} {% block title %}Home | ArCOA{% endblock %} -{% block body %} - -
-
- +{% block rightpanel %} +
+
-
-
- -
-

ArCOA Digital Archive

-

Archivi e Collezioni dell'Oriente Antico

-

Archives and Collections of the Ancient Near East

+

ArCOA Digital Archive

+

Archivi e Collezioni dell'Oriente Antico

+

Archives and Collections of the Ancient Near East

-
-
-
-

Resources

-
- -
-
+
+
+
+

Resources

+
+ +
-
-
-

Guide

-
- -
-
+
+
+
+

Guide

+
+ +
-
{% endblock %}