From ce985ef784771bff8b08d70a6fe5b4f951b5b31a Mon Sep 17 00:00:00 2001 From: Antoine Pelletier Date: Sat, 24 Oct 2026 12:55:18 +0200 Subject: [PATCH] wip --- .dockerignore | 12 + .forgejo/workflows/build.yml | 54 ++ ...9315f3ee9067bfc00499f192c4c217efb2d29.json | 52 ++ ...94d87ffa4ea83df1841912a441ae50f396d9c.json | 15 + ...401479f985c87ad4f28a2e502a05f49833889.json | 76 +++ ...1121a97e8eacd9848499c8104579505203a79.json | 77 +++ ...62197be2c57f256c331b087cac6029d285884.json | 15 + ...fa054b43e30b6f81586a98f12029d8b99c1b8.json | 19 + ...5e269a6a7ff2457f50ebe83032029d7a53105.json | 20 + ...2ce3cb5c49943895fd459c3fbef4f8255dc00.json | 65 +++ ...4a0ac22e1cf64de7e993a0cbc3539d979893e.json | 15 + ...f66d94319e023a2034870cb24cf901486274a.json | 25 + ...0119c500dfadc9a274cfd87218e2b92829383.json | 19 + ...22749b60d4401f525029edf15312f786877ce.json | 71 +++ ...d6fdeb8dd5e96ff7a77786632e33d4015b36c.json | 16 + ...5cd1f3f5269649882f922495d355b976e532e.json | 16 + ...6b1c5ebf442b7d2f1751a32240c6d3bd993e0.json | 71 +++ ...4f165f723e159aa829b3df2dfadb169b95c11.json | 15 + ...d45bb2382d2549db1ad475400594248abbeed.json | 58 +++ ...38b5fe951c58cc7be848b96cfb6a8f721585f.json | 59 +++ ...38d6e039dc6c4f76e878bf3b996b716c54640.json | 64 +++ ...6c806cc2ce2fe6050dc9f52908d619285ed2e.json | 77 +++ ...30a6297b7142cbc72ef69c073ad4072ad9ea0.json | 15 + ...d1ba4bc02fa0b93450e551584d3335475d79a.json | 47 ++ ...c347e7e4973a4d67ef8d5f8147ffa3f5a55bc.json | 19 + ...5f811842830075e7fbf0a7127a2a3f8e7d8c8.json | 15 + ...fac23fbba3d057d006d2ab06c7f1c7f5a103b.json | 24 + ...382ae5709b1700f36f9d4dc3e2df5a68e882c.json | 23 + ...cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7.json | 29 ++ ...231de7f96c73aa91152d11d9f6fce4f56904f.json | 34 ++ ...9f3e5405fdc6073252447a706de637f628319.json | 17 + ...acb4d3cff3b249e6238032a336552e94423e4.json | 22 + ...785cee496fb822c03e6a8daada1a35b1f55b8.json | 78 +++ ...6b88515a9160d0149db85df08a4f9233f5256.json | 35 ++ ...114484a24e2bcc10ff0a291b35606c1e277f6.json | 66 +++ ...88b75edaa08abbfe2ca09c7f3d21b03bcfcee.json | 15 + ...9d61aba9f6378f0006a8b22bda64e9384a369.json | 18 + ...494b15960b1fe041214b154d424f85e5b8381.json | 52 ++ ...6c06fb0dfde9b95082d42e5418b416d4786c8.json | 72 +++ ...271fffddde727a7e449dfaae658051025558a.json | 46 ++ ...4a757319754e5882af2d6d2ef465a98590092.json | 71 +++ ...b07d918a0f6bbbf7037c15773a0cda44f1f18.json | 15 + ...17b5d499cfe84d5a0dd7a58ad1411b6500182.json | 14 + ...072936235d40044ff86a6234046c35948823e.json | 64 +++ Dockerfile | 89 ++++ README.md | 28 +- build.rs | 6 +- config.auth | 0 config.example.yml | 39 +- .../20261022100000_personal_calendars.sql | 33 ++ db/migrations/20261024120000_users.sql | 25 + db/schema.sql | 139 +++++- docker-compose.yml | 76 +++ frontend/index.html | 5 +- frontend/public/apple-touch-icon.png | Bin 0 -> 6036 bytes frontend/public/favicon.ico | Bin 4286 -> 15086 bytes frontend/public/favicon.svg | 22 + frontend/src/components/AppSidebar.vue | 32 +- .../calendar/CalendarFormDialog.vue | 159 ++++++ .../components/calendar/EventFormDialog.vue | 370 ++++++++++++++ .../src/components/calendar/MonthCalendar.vue | 469 ++++++++++++++++++ .../src/components/calendar/TasksCalendar.vue | 277 ----------- frontend/src/lib/api.d.ts | 443 +++++++++++++++++ frontend/src/locales/en.yml | 50 +- frontend/src/locales/fr.yml | 50 +- frontend/src/services/api/calendars.ts | 100 ++++ frontend/src/services/api/misc.ts | 15 + frontend/src/utils/calendar.ts | 31 ++ frontend/src/utils/types.ts | 4 + frontend/src/views/CalendarView.vue | 220 ++++++-- frontend/src/views/PomodoroView.vue | 190 ++++++- src/api/calendars.rs | 177 +++++++ src/api/helpers.rs | 1 + src/api/mod.rs | 157 +++++- src/api/models.rs | 57 +++ src/api/users.rs | 43 ++ src/core/controller/calendars.rs | 190 +++++++ src/core/controller/course_files.rs | 24 +- src/core/controller/courses.rs | 34 +- src/core/controller/focus.rs | 11 +- src/core/controller/grades.rs | 16 +- src/core/controller/mod.rs | 91 +++- src/core/controller/tasks.rs | 28 +- src/core/models/calendar.rs | 50 ++ src/core/models/mod.rs | 2 + src/core/models/user.rs | 39 ++ src/core/repositories/calendars_repository.rs | 51 ++ .../repositories/course_files_repository.rs | 16 +- src/core/repositories/courses_repository.rs | 12 +- src/core/repositories/grades_repository.rs | 20 +- src/core/repositories/mod.rs | 8 +- src/core/repositories/storage_repository.rs | 47 ++ src/core/repositories/tasks_repository.rs | 29 +- src/main.rs | 68 ++- src/services/database/calendars.rs | 203 ++++++++ src/services/database/course_files.rs | 45 +- src/services/database/courses.rs | 56 ++- src/services/database/grades.rs | 63 ++- src/services/database/mod.rs | 1 + src/services/database/tasks.rs | 60 ++- src/utils/config.rs | 44 +- 101 files changed, 5669 insertions(+), 548 deletions(-) create mode 100644 .dockerignore create mode 100644 .forgejo/workflows/build.yml create mode 100644 .sqlx/query-022450cd184d5ccd6f09d4b80d59315f3ee9067bfc00499f192c4c217efb2d29.json create mode 100644 .sqlx/query-0270806a2f7521c299bb3f33aad94d87ffa4ea83df1841912a441ae50f396d9c.json create mode 100644 .sqlx/query-0ee076ba8e885a59e5f2b31f946401479f985c87ad4f28a2e502a05f49833889.json create mode 100644 .sqlx/query-16a674344d0d30f8ad3b11a25481121a97e8eacd9848499c8104579505203a79.json create mode 100644 .sqlx/query-16d59423114e405f69eac28cbdb62197be2c57f256c331b087cac6029d285884.json create mode 100644 .sqlx/query-253febb057681ba7cb7b644c5ecfa054b43e30b6f81586a98f12029d8b99c1b8.json create mode 100644 .sqlx/query-2925a80406e08b4d5f56bb4768e5e269a6a7ff2457f50ebe83032029d7a53105.json create mode 100644 .sqlx/query-2dbec0bbca07f88ce2ef1b67f962ce3cb5c49943895fd459c3fbef4f8255dc00.json create mode 100644 .sqlx/query-349db07fde24a5c20267da22f454a0ac22e1cf64de7e993a0cbc3539d979893e.json create mode 100644 .sqlx/query-36c8da4b087ac7ae55b6a691867f66d94319e023a2034870cb24cf901486274a.json create mode 100644 .sqlx/query-384d94fe1033d6610a80da44e200119c500dfadc9a274cfd87218e2b92829383.json create mode 100644 .sqlx/query-38c3a1dc809231f075a5945a79c22749b60d4401f525029edf15312f786877ce.json create mode 100644 .sqlx/query-3bed2d1e90bcb627f9d9d3de84cd6fdeb8dd5e96ff7a77786632e33d4015b36c.json create mode 100644 .sqlx/query-3dd5b4612a55c12f6518603e11c5cd1f3f5269649882f922495d355b976e532e.json create mode 100644 .sqlx/query-408662559ba3c8ac507033502066b1c5ebf442b7d2f1751a32240c6d3bd993e0.json create mode 100644 .sqlx/query-45e575bf790edc0158fe5211da34f165f723e159aa829b3df2dfadb169b95c11.json create mode 100644 .sqlx/query-4b1692df89b23fb197aa0ab6b19d45bb2382d2549db1ad475400594248abbeed.json create mode 100644 .sqlx/query-5c8607c6e765e5b87f24744438438b5fe951c58cc7be848b96cfb6a8f721585f.json create mode 100644 .sqlx/query-67912ef2ee6af9f27e021328b2938d6e039dc6c4f76e878bf3b996b716c54640.json create mode 100644 .sqlx/query-688981658bd5bc4c5d061d0528f6c806cc2ce2fe6050dc9f52908d619285ed2e.json create mode 100644 .sqlx/query-6a2d2f4b7c24bd671f0fe5c550e30a6297b7142cbc72ef69c073ad4072ad9ea0.json create mode 100644 .sqlx/query-6f6c33a9ed3792a2dbfce200e3dd1ba4bc02fa0b93450e551584d3335475d79a.json create mode 100644 .sqlx/query-70f85820ef9062be82f0acc0c3cc347e7e4973a4d67ef8d5f8147ffa3f5a55bc.json create mode 100644 .sqlx/query-74030bb10ad36911b9fd55d19d95f811842830075e7fbf0a7127a2a3f8e7d8c8.json create mode 100644 .sqlx/query-78c9ebfe2e95ec579e3b2dd96e7fac23fbba3d057d006d2ab06c7f1c7f5a103b.json create mode 100644 .sqlx/query-795f6a1eccdabe3c344949f9c7b382ae5709b1700f36f9d4dc3e2df5a68e882c.json create mode 100644 .sqlx/query-7c52bfa69d62471bd84baccaf19cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7.json create mode 100644 .sqlx/query-920a585069249b2d0f2f0be096f231de7f96c73aa91152d11d9f6fce4f56904f.json create mode 100644 .sqlx/query-952be5e6de4c5e1db46c523e6679f3e5405fdc6073252447a706de637f628319.json create mode 100644 .sqlx/query-9b165200b303773be1afd4e94cfacb4d3cff3b249e6238032a336552e94423e4.json create mode 100644 .sqlx/query-9be470705776fdd73222078776b785cee496fb822c03e6a8daada1a35b1f55b8.json create mode 100644 .sqlx/query-9e20c5ab6d09706a9c3b600b1db6b88515a9160d0149db85df08a4f9233f5256.json create mode 100644 .sqlx/query-a357ad6ba20b7645245646e0bbb114484a24e2bcc10ff0a291b35606c1e277f6.json create mode 100644 .sqlx/query-a4b97dde542b193867ca8beb78d88b75edaa08abbfe2ca09c7f3d21b03bcfcee.json create mode 100644 .sqlx/query-a71592742c8dc24bef841c890479d61aba9f6378f0006a8b22bda64e9384a369.json create mode 100644 .sqlx/query-ac6921146d07ec7c23da435a8c2494b15960b1fe041214b154d424f85e5b8381.json create mode 100644 .sqlx/query-b78f7a8b18a3aa0c98841c17e496c06fb0dfde9b95082d42e5418b416d4786c8.json create mode 100644 .sqlx/query-cc1eef4626da357a2605bb32c64271fffddde727a7e449dfaae658051025558a.json create mode 100644 .sqlx/query-d037e9597a9d4ba59c0825e8f264a757319754e5882af2d6d2ef465a98590092.json create mode 100644 .sqlx/query-f06ef7be08ca4b56d54b0c2e230b07d918a0f6bbbf7037c15773a0cda44f1f18.json create mode 100644 .sqlx/query-f6a2ae2f08904b0699b90d67b5c17b5d499cfe84d5a0dd7a58ad1411b6500182.json create mode 100644 .sqlx/query-f927c26731ebd4ac640777534b7072936235d40044ff86a6234046c35948823e.json create mode 100644 Dockerfile create mode 100644 config.auth create mode 100644 db/migrations/20261022100000_personal_calendars.sql create mode 100644 db/migrations/20261024120000_users.sql create mode 100644 docker-compose.yml create mode 100644 frontend/public/apple-touch-icon.png create mode 100644 frontend/public/favicon.svg create mode 100644 frontend/src/components/calendar/CalendarFormDialog.vue create mode 100644 frontend/src/components/calendar/EventFormDialog.vue create mode 100644 frontend/src/components/calendar/MonthCalendar.vue delete mode 100644 frontend/src/components/calendar/TasksCalendar.vue create mode 100644 frontend/src/services/api/calendars.ts create mode 100644 src/api/calendars.rs create mode 100644 src/api/users.rs create mode 100644 src/core/controller/calendars.rs create mode 100644 src/core/models/calendar.rs create mode 100644 src/core/models/user.rs create mode 100644 src/core/repositories/calendars_repository.rs create mode 100644 src/services/database/calendars.rs diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ad0af01 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +# Only what the Dockerfile copies matters: keep the context small, and the secrets out +.git +target +storage +dev-db +config.yml +config.yaml +config.auth +.env +.vscode +frontend/node_modules +frontend/dist diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..f4a7c5c --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,54 @@ +# One job on purpose. The checks (eslint, vue-tsc, cargo test) live in the +# Dockerfile stages, so this workflow needs a single job image — one that has +# docker, git and node. Splitting the checks into their own jobs would mean +# `container: rust:...`, and a JavaScript action like `actions/checkout` needs +# node inside the job container, which the rust image does not have. +# +# Deliberately no third-party actions beyond `checkout`: a self-hosted Forgejo +# runner resolves `uses:` against its own mirror, and `docker/*` is usually not +# there. Plain docker commands work everywhere. +name: build + +on: + push: + branches: [main] + workflow_dispatch: + +env: + IMAGE: registry.tibiscuit.ch/studium + +jobs: + image: + runs-on: ubuntu-latest + env: + # Secrets are read into the environment here, not interpolated into the + # shell commands below: `${{ secrets.X }}` inside a `run:` ends up in the + # process arguments, and the `secrets` context is not usable in `if:`. + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + PORTAINER_WEBHOOK: ${{ secrets.PORTAINER_WEBHOOK }} + steps: + - uses: actions/checkout@v4 + + # Turns itself on as soon as the registry has authentication and the two + # secrets exist; skipped while the registry is open. + - name: Log in to the registry + if: env.REGISTRY_USERNAME != '' + run: echo "$REGISTRY_PASSWORD" | docker login registry.tibiscuit.ch -u "$REGISTRY_USERNAME" --password-stdin + + - name: Build and push + run: | + set -eu + docker build \ + --build-arg GIT_HASH="${{ github.sha }}" \ + --tag "$IMAGE:${{ github.sha }}" \ + --tag "$IMAGE:latest" \ + . + docker push "$IMAGE:${{ github.sha }}" + docker push "$IMAGE:latest" + + # Portainer re-pulls the image and recreates the stack. Enable + # "Re-pull image" on the webhook, otherwise :latest stays the old layer. + - name: Redeploy on Portainer + if: env.PORTAINER_WEBHOOK != '' + run: curl -fsS -X POST "$PORTAINER_WEBHOOK" diff --git a/.sqlx/query-022450cd184d5ccd6f09d4b80d59315f3ee9067bfc00499f192c4c217efb2d29.json b/.sqlx/query-022450cd184d5ccd6f09d4b80d59315f3ee9067bfc00499f192c4c217efb2d29.json new file mode 100644 index 0000000..daaef11 --- /dev/null +++ b/.sqlx/query-022450cd184d5ccd6f09d4b80d59315f3ee9067bfc00499f192c4c217efb2d29.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT s.id, s.course_id, s.tag_id, s.weekday, s.start_time, s.end_time\n FROM time_slots s JOIN courses c ON c.id = s.course_id\n WHERE c.owner = $1\n ORDER BY s.weekday, s.start_time, s.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "tag_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "weekday", + "type_info": "Int2" + }, + { + "ordinal": 4, + "name": "start_time", + "type_info": "Time" + }, + { + "ordinal": 5, + "name": "end_time", + "type_info": "Time" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "022450cd184d5ccd6f09d4b80d59315f3ee9067bfc00499f192c4c217efb2d29" +} diff --git a/.sqlx/query-0270806a2f7521c299bb3f33aad94d87ffa4ea83df1841912a441ae50f396d9c.json b/.sqlx/query-0270806a2f7521c299bb3f33aad94d87ffa4ea83df1841912a441ae50f396d9c.json new file mode 100644 index 0000000..59012a0 --- /dev/null +++ b/.sqlx/query-0270806a2f7521c299bb3f33aad94d87ffa4ea83df1841912a441ae50f396d9c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM course_files\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "0270806a2f7521c299bb3f33aad94d87ffa4ea83df1841912a441ae50f396d9c" +} diff --git a/.sqlx/query-0ee076ba8e885a59e5f2b31f946401479f985c87ad4f28a2e502a05f49833889.json b/.sqlx/query-0ee076ba8e885a59e5f2b31f946401479f985c87ad4f28a2e502a05f49833889.json new file mode 100644 index 0000000..b3b3d9a --- /dev/null +++ b/.sqlx/query-0ee076ba8e885a59e5f2b31f946401479f985c87ad4f28a2e502a05f49833889.json @@ -0,0 +1,76 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT t.id, t.course_id, t.parent_id, t.name, t.description, t.links,\n t.deadline, t.done, t.time_spent,\n COALESCE(ARRAY_AGG(tt.tag_id ORDER BY tt.tag_id)\n FILTER (WHERE tt.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM tasks t\n JOIN courses c ON c.id = t.course_id AND c.owner = $1\n LEFT JOIN task_tags tt ON tt.task_id = t.id\n WHERE t.id IN (SELECT id FROM tasks WHERE parent_id IS NULL AND NOT done)\n OR t.parent_id IN (SELECT id FROM tasks WHERE parent_id IS NULL AND NOT done)\n GROUP BY t.id\n ORDER BY t.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "parent_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "links", + "type_info": "TextArray" + }, + { + "ordinal": 6, + "name": "deadline", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "done", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "time_spent", + "type_info": "Int4" + }, + { + "ordinal": 9, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + true, + false, + true, + false, + true, + false, + false, + null + ] + }, + "hash": "0ee076ba8e885a59e5f2b31f946401479f985c87ad4f28a2e502a05f49833889" +} diff --git a/.sqlx/query-16a674344d0d30f8ad3b11a25481121a97e8eacd9848499c8104579505203a79.json b/.sqlx/query-16a674344d0d30f8ad3b11a25481121a97e8eacd9848499c8104579505203a79.json new file mode 100644 index 0000000..e9006f9 --- /dev/null +++ b/.sqlx/query-16a674344d0d30f8ad3b11a25481121a97e8eacd9848499c8104579505203a79.json @@ -0,0 +1,77 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT t.id, t.course_id, t.parent_id, t.name, t.description, t.links,\n t.deadline, t.done, t.time_spent,\n COALESCE(ARRAY_AGG(tt.tag_id ORDER BY tt.tag_id)\n FILTER (WHERE tt.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM tasks t\n JOIN courses c ON c.id = t.course_id AND c.owner = $2\n LEFT JOIN task_tags tt ON tt.task_id = t.id\n WHERE t.id = $1\n GROUP BY t.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "parent_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "links", + "type_info": "TextArray" + }, + { + "ordinal": 6, + "name": "deadline", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "done", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "time_spent", + "type_info": "Int4" + }, + { + "ordinal": 9, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + true, + false, + true, + false, + true, + false, + false, + null + ] + }, + "hash": "16a674344d0d30f8ad3b11a25481121a97e8eacd9848499c8104579505203a79" +} diff --git a/.sqlx/query-16d59423114e405f69eac28cbdb62197be2c57f256c331b087cac6029d285884.json b/.sqlx/query-16d59423114e405f69eac28cbdb62197be2c57f256c331b087cac6029d285884.json new file mode 100644 index 0000000..3224a94 --- /dev/null +++ b/.sqlx/query-16d59423114e405f69eac28cbdb62197be2c57f256c331b087cac6029d285884.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM courses WHERE id = $1 AND owner = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "16d59423114e405f69eac28cbdb62197be2c57f256c331b087cac6029d285884" +} diff --git a/.sqlx/query-253febb057681ba7cb7b644c5ecfa054b43e30b6f81586a98f12029d8b99c1b8.json b/.sqlx/query-253febb057681ba7cb7b644c5ecfa054b43e30b6f81586a98f12029d8b99c1b8.json new file mode 100644 index 0000000..5dac060 --- /dev/null +++ b/.sqlx/query-253febb057681ba7cb7b644c5ecfa054b43e30b6f81586a98f12029d8b99c1b8.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO time_slots (course_id, tag_id, weekday, start_time, end_time)\n SELECT id, $2, $3, $4, $5 FROM courses WHERE id = $1 AND owner = $6", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Int2", + "Time", + "Time", + "Text" + ] + }, + "nullable": [] + }, + "hash": "253febb057681ba7cb7b644c5ecfa054b43e30b6f81586a98f12029d8b99c1b8" +} diff --git a/.sqlx/query-2925a80406e08b4d5f56bb4768e5e269a6a7ff2457f50ebe83032029d7a53105.json b/.sqlx/query-2925a80406e08b4d5f56bb4768e5e269a6a7ff2457f50ebe83032029d7a53105.json new file mode 100644 index 0000000..5c82272 --- /dev/null +++ b/.sqlx/query-2925a80406e08b4d5f56bb4768e5e269a6a7ff2457f50ebe83032029d7a53105.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE tasks SET name = $2, description = $3, links = $4, deadline = $5, done = $6\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $7)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "TextArray", + "Timestamptz", + "Bool", + "Text" + ] + }, + "nullable": [] + }, + "hash": "2925a80406e08b4d5f56bb4768e5e269a6a7ff2457f50ebe83032029d7a53105" +} diff --git a/.sqlx/query-2dbec0bbca07f88ce2ef1b67f962ce3cb5c49943895fd459c3fbef4f8255dc00.json b/.sqlx/query-2dbec0bbca07f88ce2ef1b67f962ce3cb5c49943895fd459c3fbef4f8255dc00.json new file mode 100644 index 0000000..5fe4e11 --- /dev/null +++ b/.sqlx/query-2dbec0bbca07f88ce2ef1b67f962ce3cb5c49943895fd459c3fbef4f8255dc00.json @@ -0,0 +1,65 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, calendar_id, title, location, description, starts_at, ends_at, all_day\n FROM events\n WHERE id = $1 AND calendar_id IN (SELECT id FROM calendars WHERE owner = $2)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "calendar_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "title", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "location", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "starts_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 6, + "name": "ends_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "all_day", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + false, + true, + false + ] + }, + "hash": "2dbec0bbca07f88ce2ef1b67f962ce3cb5c49943895fd459c3fbef4f8255dc00" +} diff --git a/.sqlx/query-349db07fde24a5c20267da22f454a0ac22e1cf64de7e993a0cbc3539d979893e.json b/.sqlx/query-349db07fde24a5c20267da22f454a0ac22e1cf64de7e993a0cbc3539d979893e.json new file mode 100644 index 0000000..9245d6c --- /dev/null +++ b/.sqlx/query-349db07fde24a5c20267da22f454a0ac22e1cf64de7e993a0cbc3539d979893e.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM calendars WHERE id = $1 AND owner = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "349db07fde24a5c20267da22f454a0ac22e1cf64de7e993a0cbc3539d979893e" +} diff --git a/.sqlx/query-36c8da4b087ac7ae55b6a691867f66d94319e023a2034870cb24cf901486274a.json b/.sqlx/query-36c8da4b087ac7ae55b6a691867f66d94319e023a2034870cb24cf901486274a.json new file mode 100644 index 0000000..c732808 --- /dev/null +++ b/.sqlx/query-36c8da4b087ac7ae55b6a691867f66d94319e023a2034870cb24cf901486274a.json @@ -0,0 +1,25 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO course_files (course_id, name, kind, path)\n SELECT id, $2, 'note', $3 FROM courses WHERE id = $1 AND owner = $4\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "36c8da4b087ac7ae55b6a691867f66d94319e023a2034870cb24cf901486274a" +} diff --git a/.sqlx/query-384d94fe1033d6610a80da44e200119c500dfadc9a274cfd87218e2b92829383.json b/.sqlx/query-384d94fe1033d6610a80da44e200119c500dfadc9a274cfd87218e2b92829383.json new file mode 100644 index 0000000..d3bd8d9 --- /dev/null +++ b/.sqlx/query-384d94fe1033d6610a80da44e200119c500dfadc9a274cfd87218e2b92829383.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE grades SET name = $2, score = $3, max_score = $4, weight = $5\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $6)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Float8", + "Float8", + "Float8", + "Text" + ] + }, + "nullable": [] + }, + "hash": "384d94fe1033d6610a80da44e200119c500dfadc9a274cfd87218e2b92829383" +} diff --git a/.sqlx/query-38c3a1dc809231f075a5945a79c22749b60d4401f525029edf15312f786877ce.json b/.sqlx/query-38c3a1dc809231f075a5945a79c22749b60d4401f525029edf15312f786877ce.json new file mode 100644 index 0000000..d69246a --- /dev/null +++ b/.sqlx/query-38c3a1dc809231f075a5945a79c22749b60d4401f525029edf15312f786877ce.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT f.id, f.course_id, f.name, f.kind, f.path, f.has_pdf, f.created_at, f.updated_at,\n COALESCE(ARRAY_AGG(ft.tag_id ORDER BY ft.tag_id)\n FILTER (WHERE ft.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM course_files f\n JOIN courses c ON c.id = f.course_id AND c.owner = $2\n LEFT JOIN file_tags ft ON ft.file_id = f.id\n WHERE f.id = $1\n GROUP BY f.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "path", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "has_pdf", + "type_info": "Bool" + }, + { + "ordinal": 6, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "updated_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 8, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + null + ] + }, + "hash": "38c3a1dc809231f075a5945a79c22749b60d4401f525029edf15312f786877ce" +} diff --git a/.sqlx/query-3bed2d1e90bcb627f9d9d3de84cd6fdeb8dd5e96ff7a77786632e33d4015b36c.json b/.sqlx/query-3bed2d1e90bcb627f9d9d3de84cd6fdeb8dd5e96ff7a77786632e33d4015b36c.json new file mode 100644 index 0000000..bf03274 --- /dev/null +++ b/.sqlx/query-3bed2d1e90bcb627f9d9d3de84cd6fdeb8dd5e96ff7a77786632e33d4015b36c.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM time_slots\n WHERE id = $1 AND course_id = $2\n AND course_id IN (SELECT id FROM courses WHERE owner = $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "3bed2d1e90bcb627f9d9d3de84cd6fdeb8dd5e96ff7a77786632e33d4015b36c" +} diff --git a/.sqlx/query-3dd5b4612a55c12f6518603e11c5cd1f3f5269649882f922495d355b976e532e.json b/.sqlx/query-3dd5b4612a55c12f6518603e11c5cd1f3f5269649882f922495d355b976e532e.json new file mode 100644 index 0000000..471fe4b --- /dev/null +++ b/.sqlx/query-3dd5b4612a55c12f6518603e11c5cd1f3f5269649882f922495d355b976e532e.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO calendars (owner, name, color) VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "3dd5b4612a55c12f6518603e11c5cd1f3f5269649882f922495d355b976e532e" +} diff --git a/.sqlx/query-408662559ba3c8ac507033502066b1c5ebf442b7d2f1751a32240c6d3bd993e0.json b/.sqlx/query-408662559ba3c8ac507033502066b1c5ebf442b7d2f1751a32240c6d3bd993e0.json new file mode 100644 index 0000000..2e63c9f --- /dev/null +++ b/.sqlx/query-408662559ba3c8ac507033502066b1c5ebf442b7d2f1751a32240c6d3bd993e0.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO events\n (calendar_id, title, location, description, starts_at, ends_at, all_day)\n SELECT id, $2, $3, $4, $5, $6, $7 FROM calendars WHERE id = $1 AND owner = $8\n RETURNING id, calendar_id, title, location, description, starts_at, ends_at,\n all_day", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "calendar_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "title", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "location", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "starts_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 6, + "name": "ends_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "all_day", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Text", + "Timestamptz", + "Timestamptz", + "Bool", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + false, + true, + false + ] + }, + "hash": "408662559ba3c8ac507033502066b1c5ebf442b7d2f1751a32240c6d3bd993e0" +} diff --git a/.sqlx/query-45e575bf790edc0158fe5211da34f165f723e159aa829b3df2dfadb169b95c11.json b/.sqlx/query-45e575bf790edc0158fe5211da34f165f723e159aa829b3df2dfadb169b95c11.json new file mode 100644 index 0000000..ae36ef2 --- /dev/null +++ b/.sqlx/query-45e575bf790edc0158fe5211da34f165f723e159aa829b3df2dfadb169b95c11.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO task_tags (task_id, tag_id)\n SELECT $1, tag_id FROM UNNEST($2::INTEGER[]) AS tag_id\n ON CONFLICT DO NOTHING", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "45e575bf790edc0158fe5211da34f165f723e159aa829b3df2dfadb169b95c11" +} diff --git a/.sqlx/query-4b1692df89b23fb197aa0ab6b19d45bb2382d2549db1ad475400594248abbeed.json b/.sqlx/query-4b1692df89b23fb197aa0ab6b19d45bb2382d2549db1ad475400594248abbeed.json new file mode 100644 index 0000000..9c8627c --- /dev/null +++ b/.sqlx/query-4b1692df89b23fb197aa0ab6b19d45bb2382d2549db1ad475400594248abbeed.json @@ -0,0 +1,58 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, kind, name, code, teachers, main_page_url, folder\n FROM courses WHERE owner = $1 ORDER BY name, id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "code", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "teachers", + "type_info": "TextArray" + }, + { + "ordinal": 5, + "name": "main_page_url", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "folder", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false, + true, + false + ] + }, + "hash": "4b1692df89b23fb197aa0ab6b19d45bb2382d2549db1ad475400594248abbeed" +} diff --git a/.sqlx/query-5c8607c6e765e5b87f24744438438b5fe951c58cc7be848b96cfb6a8f721585f.json b/.sqlx/query-5c8607c6e765e5b87f24744438438b5fe951c58cc7be848b96cfb6a8f721585f.json new file mode 100644 index 0000000..c868b05 --- /dev/null +++ b/.sqlx/query-5c8607c6e765e5b87f24744438438b5fe951c58cc7be848b96cfb6a8f721585f.json @@ -0,0 +1,59 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, kind, name, code, teachers, main_page_url, folder\n FROM courses WHERE id = $1 AND owner = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "code", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "teachers", + "type_info": "TextArray" + }, + { + "ordinal": 5, + "name": "main_page_url", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "folder", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false, + true, + false + ] + }, + "hash": "5c8607c6e765e5b87f24744438438b5fe951c58cc7be848b96cfb6a8f721585f" +} diff --git a/.sqlx/query-67912ef2ee6af9f27e021328b2938d6e039dc6c4f76e878bf3b996b716c54640.json b/.sqlx/query-67912ef2ee6af9f27e021328b2938d6e039dc6c4f76e878bf3b996b716c54640.json new file mode 100644 index 0000000..0421353 --- /dev/null +++ b/.sqlx/query-67912ef2ee6af9f27e021328b2938d6e039dc6c4f76e878bf3b996b716c54640.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO courses (owner, kind, name, code, teachers, main_page_url, folder)\n VALUES ($7, $1, $2, $3, $4, $5, $6)\n RETURNING id, kind, name, code, teachers, main_page_url, folder", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "code", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "teachers", + "type_info": "TextArray" + }, + { + "ordinal": 5, + "name": "main_page_url", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "folder", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "TextArray", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false, + true, + false + ] + }, + "hash": "67912ef2ee6af9f27e021328b2938d6e039dc6c4f76e878bf3b996b716c54640" +} diff --git a/.sqlx/query-688981658bd5bc4c5d061d0528f6c806cc2ce2fe6050dc9f52908d619285ed2e.json b/.sqlx/query-688981658bd5bc4c5d061d0528f6c806cc2ce2fe6050dc9f52908d619285ed2e.json new file mode 100644 index 0000000..4b97e4a --- /dev/null +++ b/.sqlx/query-688981658bd5bc4c5d061d0528f6c806cc2ce2fe6050dc9f52908d619285ed2e.json @@ -0,0 +1,77 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT t.id, t.course_id, t.parent_id, t.name, t.description, t.links,\n t.deadline, t.done, t.time_spent,\n COALESCE(ARRAY_AGG(tt.tag_id ORDER BY tt.tag_id)\n FILTER (WHERE tt.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM tasks t\n JOIN courses c ON c.id = t.course_id AND c.owner = $2\n LEFT JOIN task_tags tt ON tt.task_id = t.id\n WHERE t.course_id = $1\n GROUP BY t.id\n ORDER BY t.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "parent_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "links", + "type_info": "TextArray" + }, + { + "ordinal": 6, + "name": "deadline", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "done", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "time_spent", + "type_info": "Int4" + }, + { + "ordinal": 9, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + true, + false, + true, + false, + true, + false, + false, + null + ] + }, + "hash": "688981658bd5bc4c5d061d0528f6c806cc2ce2fe6050dc9f52908d619285ed2e" +} diff --git a/.sqlx/query-6a2d2f4b7c24bd671f0fe5c550e30a6297b7142cbc72ef69c073ad4072ad9ea0.json b/.sqlx/query-6a2d2f4b7c24bd671f0fe5c550e30a6297b7142cbc72ef69c073ad4072ad9ea0.json new file mode 100644 index 0000000..e9452eb --- /dev/null +++ b/.sqlx/query-6a2d2f4b7c24bd671f0fe5c550e30a6297b7142cbc72ef69c073ad4072ad9ea0.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO file_tags (file_id, tag_id)\n SELECT $1, tag_id FROM UNNEST($2::INTEGER[]) AS tag_id", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "6a2d2f4b7c24bd671f0fe5c550e30a6297b7142cbc72ef69c073ad4072ad9ea0" +} diff --git a/.sqlx/query-6f6c33a9ed3792a2dbfce200e3dd1ba4bc02fa0b93450e551584d3335475d79a.json b/.sqlx/query-6f6c33a9ed3792a2dbfce200e3dd1ba4bc02fa0b93450e551584d3335475d79a.json new file mode 100644 index 0000000..f64019d --- /dev/null +++ b/.sqlx/query-6f6c33a9ed3792a2dbfce200e3dd1ba4bc02fa0b93450e551584d3335475d79a.json @@ -0,0 +1,47 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, name, score, max_score, weight FROM grades\n WHERE course_id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $2)\n ORDER BY id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "score", + "type_info": "Float8" + }, + { + "ordinal": 3, + "name": "max_score", + "type_info": "Float8" + }, + { + "ordinal": 4, + "name": "weight", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false + ] + }, + "hash": "6f6c33a9ed3792a2dbfce200e3dd1ba4bc02fa0b93450e551584d3335475d79a" +} diff --git a/.sqlx/query-70f85820ef9062be82f0acc0c3cc347e7e4973a4d67ef8d5f8147ffa3f5a55bc.json b/.sqlx/query-70f85820ef9062be82f0acc0c3cc347e7e4973a4d67ef8d5f8147ffa3f5a55bc.json new file mode 100644 index 0000000..a2dd5a4 --- /dev/null +++ b/.sqlx/query-70f85820ef9062be82f0acc0c3cc347e7e4973a4d67ef8d5f8147ffa3f5a55bc.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO grades (course_id, name, score, max_score, weight)\n SELECT id, $2, $3, $4, $5 FROM courses WHERE id = $1 AND owner = $6", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Float8", + "Float8", + "Float8", + "Text" + ] + }, + "nullable": [] + }, + "hash": "70f85820ef9062be82f0acc0c3cc347e7e4973a4d67ef8d5f8147ffa3f5a55bc" +} diff --git a/.sqlx/query-74030bb10ad36911b9fd55d19d95f811842830075e7fbf0a7127a2a3f8e7d8c8.json b/.sqlx/query-74030bb10ad36911b9fd55d19d95f811842830075e7fbf0a7127a2a3f8e7d8c8.json new file mode 100644 index 0000000..194a73b --- /dev/null +++ b/.sqlx/query-74030bb10ad36911b9fd55d19d95f811842830075e7fbf0a7127a2a3f8e7d8c8.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM tasks\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "74030bb10ad36911b9fd55d19d95f811842830075e7fbf0a7127a2a3f8e7d8c8" +} diff --git a/.sqlx/query-78c9ebfe2e95ec579e3b2dd96e7fac23fbba3d057d006d2ab06c7f1c7f5a103b.json b/.sqlx/query-78c9ebfe2e95ec579e3b2dd96e7fac23fbba3d057d006d2ab06c7f1c7f5a103b.json new file mode 100644 index 0000000..4cfdef1 --- /dev/null +++ b/.sqlx/query-78c9ebfe2e95ec579e3b2dd96e7fac23fbba3d057d006d2ab06c7f1c7f5a103b.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE tasks SET time_spent = time_spent + $2\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $3)\n RETURNING time_spent", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time_spent", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "78c9ebfe2e95ec579e3b2dd96e7fac23fbba3d057d006d2ab06c7f1c7f5a103b" +} diff --git a/.sqlx/query-795f6a1eccdabe3c344949f9c7b382ae5709b1700f36f9d4dc3e2df5a68e882c.json b/.sqlx/query-795f6a1eccdabe3c344949f9c7b382ae5709b1700f36f9d4dc3e2df5a68e882c.json new file mode 100644 index 0000000..7b19e1d --- /dev/null +++ b/.sqlx/query-795f6a1eccdabe3c344949f9c7b382ae5709b1700f36f9d4dc3e2df5a68e882c.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT course_id FROM grades\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $2)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "course_id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "795f6a1eccdabe3c344949f9c7b382ae5709b1700f36f9d4dc3e2df5a68e882c" +} diff --git a/.sqlx/query-7c52bfa69d62471bd84baccaf19cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7.json b/.sqlx/query-7c52bfa69d62471bd84baccaf19cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7.json new file mode 100644 index 0000000..c017b7a --- /dev/null +++ b/.sqlx/query-7c52bfa69d62471bd84baccaf19cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO tasks (course_id, parent_id, name, description, links, deadline, done)\n SELECT id, $2, $3, $4, $5, $6, $7 FROM courses WHERE id = $1 AND owner = $8\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Text", + "Text", + "TextArray", + "Timestamptz", + "Bool", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "7c52bfa69d62471bd84baccaf19cdb444ed02c6fea2f6b6fe00bb7e3446e1ec7" +} diff --git a/.sqlx/query-920a585069249b2d0f2f0be096f231de7f96c73aa91152d11d9f6fce4f56904f.json b/.sqlx/query-920a585069249b2d0f2f0be096f231de7f96c73aa91152d11d9f6fce4f56904f.json new file mode 100644 index 0000000..3bcd37d --- /dev/null +++ b/.sqlx/query-920a585069249b2d0f2f0be096f231de7f96c73aa91152d11d9f6fce4f56904f.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, name, color FROM calendars WHERE owner = $1 ORDER BY id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "color", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "920a585069249b2d0f2f0be096f231de7f96c73aa91152d11d9f6fce4f56904f" +} diff --git a/.sqlx/query-952be5e6de4c5e1db46c523e6679f3e5405fdc6073252447a706de637f628319.json b/.sqlx/query-952be5e6de4c5e1db46c523e6679f3e5405fdc6073252447a706de637f628319.json new file mode 100644 index 0000000..7f3800c --- /dev/null +++ b/.sqlx/query-952be5e6de4c5e1db46c523e6679f3e5405fdc6073252447a706de637f628319.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE calendars SET name = $2, color = $3 WHERE id = $1 AND owner = $4", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "952be5e6de4c5e1db46c523e6679f3e5405fdc6073252447a706de637f628319" +} diff --git a/.sqlx/query-9b165200b303773be1afd4e94cfacb4d3cff3b249e6238032a336552e94423e4.json b/.sqlx/query-9b165200b303773be1afd4e94cfacb4d3cff3b249e6238032a336552e94423e4.json new file mode 100644 index 0000000..7edc0d9 --- /dev/null +++ b/.sqlx/query-9b165200b303773be1afd4e94cfacb4d3cff3b249e6238032a336552e94423e4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM tags WHERE slug = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "9b165200b303773be1afd4e94cfacb4d3cff3b249e6238032a336552e94423e4" +} diff --git a/.sqlx/query-9be470705776fdd73222078776b785cee496fb822c03e6a8daada1a35b1f55b8.json b/.sqlx/query-9be470705776fdd73222078776b785cee496fb822c03e6a8daada1a35b1f55b8.json new file mode 100644 index 0000000..45ec550 --- /dev/null +++ b/.sqlx/query-9be470705776fdd73222078776b785cee496fb822c03e6a8daada1a35b1f55b8.json @@ -0,0 +1,78 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT t.id, t.course_id, t.parent_id, t.name, t.description, t.links,\n t.deadline, t.done, t.time_spent,\n COALESCE(ARRAY_AGG(tt.tag_id ORDER BY tt.tag_id)\n FILTER (WHERE tt.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM tasks t\n JOIN courses c ON c.id = t.course_id AND c.owner = $3\n LEFT JOIN task_tags tt ON tt.task_id = t.id\n WHERE (t.deadline >= $1 AND t.deadline < $2)\n OR t.id IN (SELECT parent_id FROM tasks\n WHERE deadline >= $1 AND deadline < $2 AND parent_id IS NOT NULL)\n GROUP BY t.id\n ORDER BY t.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "parent_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "links", + "type_info": "TextArray" + }, + { + "ordinal": 6, + "name": "deadline", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "done", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "time_spent", + "type_info": "Int4" + }, + { + "ordinal": 9, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Timestamptz", + "Timestamptz", + "Text" + ] + }, + "nullable": [ + false, + false, + true, + false, + true, + false, + true, + false, + false, + null + ] + }, + "hash": "9be470705776fdd73222078776b785cee496fb822c03e6a8daada1a35b1f55b8" +} diff --git a/.sqlx/query-9e20c5ab6d09706a9c3b600b1db6b88515a9160d0149db85df08a4f9233f5256.json b/.sqlx/query-9e20c5ab6d09706a9c3b600b1db6b88515a9160d0149db85df08a4f9233f5256.json new file mode 100644 index 0000000..4fd24b1 --- /dev/null +++ b/.sqlx/query-9e20c5ab6d09706a9c3b600b1db6b88515a9160d0149db85df08a4f9233f5256.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, name, color FROM calendars WHERE id = $1 AND owner = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "color", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "9e20c5ab6d09706a9c3b600b1db6b88515a9160d0149db85df08a4f9233f5256" +} diff --git a/.sqlx/query-a357ad6ba20b7645245646e0bbb114484a24e2bcc10ff0a291b35606c1e277f6.json b/.sqlx/query-a357ad6ba20b7645245646e0bbb114484a24e2bcc10ff0a291b35606c1e277f6.json new file mode 100644 index 0000000..f6b28df --- /dev/null +++ b/.sqlx/query-a357ad6ba20b7645245646e0bbb114484a24e2bcc10ff0a291b35606c1e277f6.json @@ -0,0 +1,66 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, calendar_id, title, location, description, starts_at, ends_at, all_day\n FROM events\n WHERE starts_at < $2\n AND (ends_at > $1 OR (ends_at IS NULL AND starts_at >= $1))\n AND calendar_id IN (SELECT id FROM calendars WHERE owner = $3)\n ORDER BY starts_at, id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "calendar_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "title", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "location", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "starts_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 6, + "name": "ends_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "all_day", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Timestamptz", + "Timestamptz", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + false, + true, + false + ] + }, + "hash": "a357ad6ba20b7645245646e0bbb114484a24e2bcc10ff0a291b35606c1e277f6" +} diff --git a/.sqlx/query-a4b97dde542b193867ca8beb78d88b75edaa08abbfe2ca09c7f3d21b03bcfcee.json b/.sqlx/query-a4b97dde542b193867ca8beb78d88b75edaa08abbfe2ca09c7f3d21b03bcfcee.json new file mode 100644 index 0000000..10bb94c --- /dev/null +++ b/.sqlx/query-a4b97dde542b193867ca8beb78d88b75edaa08abbfe2ca09c7f3d21b03bcfcee.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM grades\n WHERE id = $1 AND course_id IN (SELECT id FROM courses WHERE owner = $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "a4b97dde542b193867ca8beb78d88b75edaa08abbfe2ca09c7f3d21b03bcfcee" +} diff --git a/.sqlx/query-a71592742c8dc24bef841c890479d61aba9f6378f0006a8b22bda64e9384a369.json b/.sqlx/query-a71592742c8dc24bef841c890479d61aba9f6378f0006a8b22bda64e9384a369.json new file mode 100644 index 0000000..434103b --- /dev/null +++ b/.sqlx/query-a71592742c8dc24bef841c890479d61aba9f6378f0006a8b22bda64e9384a369.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE course_files SET name = $2, path = $3, has_pdf = $4, updated_at = now()\n WHERE id = $1 AND kind = 'note'\n AND course_id IN (SELECT id FROM courses WHERE owner = $5)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Bool", + "Text" + ] + }, + "nullable": [] + }, + "hash": "a71592742c8dc24bef841c890479d61aba9f6378f0006a8b22bda64e9384a369" +} diff --git a/.sqlx/query-ac6921146d07ec7c23da435a8c2494b15960b1fe041214b154d424f85e5b8381.json b/.sqlx/query-ac6921146d07ec7c23da435a8c2494b15960b1fe041214b154d424f85e5b8381.json new file mode 100644 index 0000000..a18e1b9 --- /dev/null +++ b/.sqlx/query-ac6921146d07ec7c23da435a8c2494b15960b1fe041214b154d424f85e5b8381.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, course_id, tag_id, weekday, start_time, end_time\n FROM time_slots WHERE course_id = $1 ORDER BY weekday, start_time, id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "tag_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "weekday", + "type_info": "Int2" + }, + { + "ordinal": 4, + "name": "start_time", + "type_info": "Time" + }, + { + "ordinal": 5, + "name": "end_time", + "type_info": "Time" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "ac6921146d07ec7c23da435a8c2494b15960b1fe041214b154d424f85e5b8381" +} diff --git a/.sqlx/query-b78f7a8b18a3aa0c98841c17e496c06fb0dfde9b95082d42e5418b416d4786c8.json b/.sqlx/query-b78f7a8b18a3aa0c98841c17e496c06fb0dfde9b95082d42e5418b416d4786c8.json new file mode 100644 index 0000000..7fadf60 --- /dev/null +++ b/.sqlx/query-b78f7a8b18a3aa0c98841c17e496c06fb0dfde9b95082d42e5418b416d4786c8.json @@ -0,0 +1,72 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE events SET calendar_id = $2, title = $3, location = $4, description = $5,\n starts_at = $6, ends_at = $7, all_day = $8\n WHERE id = $1\n AND calendar_id IN (SELECT id FROM calendars WHERE owner = $9)\n AND $2 IN (SELECT id FROM calendars WHERE owner = $9)\n RETURNING id, calendar_id, title, location, description, starts_at, ends_at,\n all_day", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "calendar_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "title", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "location", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "starts_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 6, + "name": "ends_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "all_day", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Text", + "Text", + "Text", + "Timestamptz", + "Timestamptz", + "Bool", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + false, + true, + false + ] + }, + "hash": "b78f7a8b18a3aa0c98841c17e496c06fb0dfde9b95082d42e5418b416d4786c8" +} diff --git a/.sqlx/query-cc1eef4626da357a2605bb32c64271fffddde727a7e449dfaae658051025558a.json b/.sqlx/query-cc1eef4626da357a2605bb32c64271fffddde727a7e449dfaae658051025558a.json new file mode 100644 index 0000000..5de92b8 --- /dev/null +++ b/.sqlx/query-cc1eef4626da357a2605bb32c64271fffddde727a7e449dfaae658051025558a.json @@ -0,0 +1,46 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, name, color, slug, scopes FROM tags\n WHERE $1::TEXT IS NULL OR $1 = ANY(scopes)\n ORDER BY id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Jsonb" + }, + { + "ordinal": 2, + "name": "color", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "slug", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "scopes", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false + ] + }, + "hash": "cc1eef4626da357a2605bb32c64271fffddde727a7e449dfaae658051025558a" +} diff --git a/.sqlx/query-d037e9597a9d4ba59c0825e8f264a757319754e5882af2d6d2ef465a98590092.json b/.sqlx/query-d037e9597a9d4ba59c0825e8f264a757319754e5882af2d6d2ef465a98590092.json new file mode 100644 index 0000000..be64884 --- /dev/null +++ b/.sqlx/query-d037e9597a9d4ba59c0825e8f264a757319754e5882af2d6d2ef465a98590092.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT f.id, f.course_id, f.name, f.kind, f.path, f.has_pdf, f.created_at, f.updated_at,\n COALESCE(ARRAY_AGG(ft.tag_id ORDER BY ft.tag_id)\n FILTER (WHERE ft.tag_id IS NOT NULL), '{}') AS \"tag_ids!\"\n FROM course_files f\n JOIN courses c ON c.id = f.course_id AND c.owner = $2\n LEFT JOIN file_tags ft ON ft.file_id = f.id\n WHERE f.course_id = $1\n GROUP BY f.id\n ORDER BY f.created_at, f.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "course_id", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "path", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "has_pdf", + "type_info": "Bool" + }, + { + "ordinal": 6, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "updated_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 8, + "name": "tag_ids!", + "type_info": "Int4Array" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + null + ] + }, + "hash": "d037e9597a9d4ba59c0825e8f264a757319754e5882af2d6d2ef465a98590092" +} diff --git a/.sqlx/query-f06ef7be08ca4b56d54b0c2e230b07d918a0f6bbbf7037c15773a0cda44f1f18.json b/.sqlx/query-f06ef7be08ca4b56d54b0c2e230b07d918a0f6bbbf7037c15773a0cda44f1f18.json new file mode 100644 index 0000000..baf83c5 --- /dev/null +++ b/.sqlx/query-f06ef7be08ca4b56d54b0c2e230b07d918a0f6bbbf7037c15773a0cda44f1f18.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM events\n WHERE id = $1 AND calendar_id IN (SELECT id FROM calendars WHERE owner = $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "f06ef7be08ca4b56d54b0c2e230b07d918a0f6bbbf7037c15773a0cda44f1f18" +} diff --git a/.sqlx/query-f6a2ae2f08904b0699b90d67b5c17b5d499cfe84d5a0dd7a58ad1411b6500182.json b/.sqlx/query-f6a2ae2f08904b0699b90d67b5c17b5d499cfe84d5a0dd7a58ad1411b6500182.json new file mode 100644 index 0000000..b9bc259 --- /dev/null +++ b/.sqlx/query-f6a2ae2f08904b0699b90d67b5c17b5d499cfe84d5a0dd7a58ad1411b6500182.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM task_tags WHERE task_id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "f6a2ae2f08904b0699b90d67b5c17b5d499cfe84d5a0dd7a58ad1411b6500182" +} diff --git a/.sqlx/query-f927c26731ebd4ac640777534b7072936235d40044ff86a6234046c35948823e.json b/.sqlx/query-f927c26731ebd4ac640777534b7072936235d40044ff86a6234046c35948823e.json new file mode 100644 index 0000000..8ed4199 --- /dev/null +++ b/.sqlx/query-f927c26731ebd4ac640777534b7072936235d40044ff86a6234046c35948823e.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE courses\n SET name = $2, code = $3, teachers = $4, main_page_url = $5, folder = $6\n WHERE id = $1 AND owner = $7\n RETURNING id, kind, name, code, teachers, main_page_url, folder", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "kind", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "code", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "teachers", + "type_info": "TextArray" + }, + { + "ordinal": 5, + "name": "main_page_url", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "folder", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "TextArray", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false, + true, + false + ] + }, + "hash": "f927c26731ebd4ac640777534b7072936235d40044ff86a6234046c35948823e" +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef395bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,89 @@ +# Frontend: built first, it is the part that changes most often +FROM node:22-slim AS frontend +WORKDIR /build + +# Dependencies in their own layer, so a source-only change does not reinstall them +COPY frontend/package.json frontend/package-lock.json ./ +RUN npm ci + +COPY frontend/ ./ +# The checks run here rather than in a separate CI job: the build then fails on +# the runner for the same reason it would fail locally, and there is only one +# environment to keep working. +RUN npx eslint . --max-warnings=0 +RUN npm run build # type-check + vite build + + +# Backend: compiled against the sqlx offline data (`cargo sqlx prepare`), so no +# database is needed here +FROM rust:1.97-slim AS backend +WORKDIR /build + +ENV SQLX_OFFLINE=true +# Traceability: `build.rs` falls back on this when there is no git repository +ARG GIT_HASH=unknown +ENV GIT_HASH=${GIT_HASH} + +# Warm the dependency layer with a dummy main, so editing src/ does not rebuild +# every crate we depend on +COPY Cargo.toml Cargo.lock build.rs ./ +RUN mkdir src && echo 'fn main() {}' > src/main.rs \ + && cargo build --release \ + && rm -rf src + +COPY .sqlx/ .sqlx/ +COPY src/ src/ +# cargo skips a rebuild when only mtime changed: force it for our own crate +RUN touch src/main.rs \ + && cargo build --release --locked \ + && cargo test --release --locked + + +# Runtime +FROM debian:trixie-slim +LABEL org.opencontainers.image.title="studium" + +# The lecture notes are rendered by pandoc and pdflatex. latex-extra holds tcolorbox, +# sectsty and pmboxdraw, used by the template. curl serves the healthcheck, and +# fetches pandoc below. +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl ca-certificates \ + texlive-latex-base texlive-latex-recommended texlive-latex-extra \ + texlive-fonts-recommended texlive-pictures lmodern \ + && rm -rf /var/lib/apt/lists/* + +# The pandoc of Debian is too old for `--syntax-highlighting` (3.8+): the release of +# pandoc itself, the same version as in development +ARG PANDOC_VERSION=3.11 +RUN arch="$(dpkg --print-architecture)" \ + && curl -fsSL -o /tmp/pandoc.deb \ + "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-${arch}.deb" \ + && dpkg -i /tmp/pandoc.deb \ + && rm /tmp/pandoc.deb + +# The migrations travel with the image, so the stack needs nothing from the +# repository: the `migrate` service runs this same image with another entrypoint. +COPY --from=ghcr.io/amacneil/dbmate:2 /usr/local/bin/dbmate /usr/local/bin/dbmate +COPY db/migrations/ /app/db/migrations/ + +# Not root: the app only needs to write in its storage. The folder mounted there must +# belong to this uid (`chown -R 1000:1000` on the host). +RUN useradd --uid 1000 --create-home studium \ + && mkdir -p /data/storage \ + && chown studium:studium /data/storage + +WORKDIR /app +COPY --from=backend /build/target/release/studium /usr/local/bin/studium +COPY --from=frontend /build/dist/ /app/frontend/ +COPY LaTeX_pdf/ /app/LaTeX_pdf/ +COPY docker/config.yml /etc/studium/config.yml + +USER studium +EXPOSE 3000 + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD curl -fsS http://localhost:3000/api/version || exit 1 + +# No shell: signals reach the binary directly, so the graceful shutdown works +ENTRYPOINT ["/usr/local/bin/studium"] diff --git a/README.md b/README.md index e9e33cd..826b23e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,10 @@ shadcn-vue), on **PostgreSQL** with **dbmate** migrations. - Tailwind 4 and the shadcn-vue components already vendored in `frontend/src/components/ui` - A single binary in production: the backend serves the built frontend -There is **no authentication** in this template: add whatever the project needs. +Authentication is left to **Authelia**, in front of the app (forward auth of the reverse +proxy): it gives the login of the person in the `Remote-User` header, and each person has +their own courses, calendars and files. The app must only be reachable through Authelia. +Without it (development), `auth.default_user` in `config.yml` says who the requests act as. ## Getting started @@ -36,12 +39,29 @@ cargo run cd frontend && npm install && npm run dev ``` -Open http://localhost:5000. The api documentation is on http://localhost:3000/api/docs. +In development too, the app is reached through the real Authelia: the reverse proxy of the +server forwards `studium-dev.` to this machine (port 5000) through the VPN. Without +it, set `auth.default_user` in `config.yml` and open http://localhost:5000. +The api documentation is on http://localhost:3000/api/docs. `config.yml` is gitignored: it is where the secrets go. `config.example.yml` documents every key, keep it up to date. Every value can also come from the environment (`APP__POSTGRES__PASSWORD=...`), which is how the app is configured in production. +## Deployment + +A push on `main` builds the image (`Dockerfile`, which also runs the checks and the +tests), pushes it to `registry.tibiscuit.ch/studium` and redeploys the Portainer stack +(`.forgejo/workflows/build.yml`). The stack is `docker-compose.yml`: its header lists the +variables to set in Portainer. + +- The sql queries are checked at compile time: after changing one, run + `cargo sqlx prepare` and commit `.sqlx/`, or the image does not build. +- The files go to `/mnt/nas.data/dockers/studium` on the server, which must belong to + uid 1000 (the user of the container). +- Caddy puts Authelia in front of the app, and adds the `X-Proxy-Secret` header + (`PROXY_SECRET` of the stack): the app refuses any request without it. + ## Layout ``` @@ -54,8 +74,8 @@ key, keep it up to date. Every value can also come from the environment │ ├── services/ implementations of the repositories (postgres/sqlx) │ └── utils/ configuration ├── LaTeX_pdf/ template of the lecture notes pdf (pandoc + pdflatex) -├── storage/ files of the courses and associations, one folder each, -│ stands in for the NAS (gitignored) +├── storage/ files of the courses and associations, a folder per person +│ then per course, stands in for the NAS (gitignored) ├── db/ │ ├── migrations/ dbmate migrations │ ├── schema.sql dump regenerated by dbmate, do not edit by hand diff --git a/build.rs b/build.rs index 7db8f38..9a5332a 100644 --- a/build.rs +++ b/build.rs @@ -8,7 +8,10 @@ fn main() { .ok() .filter(|output| output.status.success()) .and_then(|output| String::from_utf8(output.stdout).ok()) - .map(|hash| hash.trim().chars().take(8).collect::()) + .map(|hash| hash.trim().to_owned()) + // No repository in a docker build: the hash is given as a build argument + .or_else(|| std::env::var("GIT_HASH").ok()) + .map(|hash| hash.chars().take(8).collect::()) .unwrap_or_else(|| "unknown".to_owned()); println!("cargo:rustc-env=GIT_HASH={git_hash}"); @@ -17,4 +20,5 @@ fn main() { env!("CARGO_PKG_NAME").replace("-", "_") ); println!("cargo:rerun-if-changed=.git/HEAD"); + println!("cargo:rerun-if-env-changed=GIT_HASH"); } diff --git a/config.auth b/config.auth new file mode 100644 index 0000000..e69de29 diff --git a/config.example.yml b/config.example.yml index 006f100..2d8e61b 100644 --- a/config.example.yml +++ b/config.example.yml @@ -15,8 +15,8 @@ postgres: frontend_dir: frontend/dist # Where the files of the courses and associations are stored (lecture notes and their -# pdf...), one folder each: Cours/CS-477 Advanced OS/Notes/..., Associations/... -# A local directory standing in for the NAS for now. +# pdf...): a folder per person, then one per course: jdoe/Cours/CS-477 Advanced OS/Notes/... +# A local directory, or the NAS mounted. storage_dir: storage # Rendering of the lecture notes to pdf (needs pandoc and pdflatex) @@ -25,15 +25,34 @@ notes: template_dir: LaTeX_pdf # Relative to template_dir logo: assets/epfl.png - # Shown in the header of the pdf, both optional - student_name: Jane Doe - student_id: "123456" -# Optional: the focus sessions of the pomodoro are also counted in TimeTagger, tagged -# with the course code, the tags and the name of the task. Without it, the time is only -# counted in the app. +# The app must be behind Authelia (forward auth of the reverse proxy), which gives the +# login of the person in the Remote-User header: each person has their own courses, +# calendars and files. The app must not be reachable without going through Authelia, +# or anyone could send this header. +auth: + # Login used for the requests without Remote-User. Only for development, never in + # production: anyone reaching the app would be this person. + # default_user: jdoe + # Where the "log out" link leads: the logout page of Authelia + # logout_url: https://auth.example.com/logout + # Secret the reverse proxy sends in the X-Proxy-Secret header: the requests without it + # are refused. Set it whenever the port of the app can be reached by anything else than + # the proxy (e.g. `openssl rand -hex 32`). + # proxy_secret: ... + +# Optional: the focus sessions of the pomodoro can also be counted in TimeTagger, tagged +# with the course code, the tags and the name of the task, for the people with a token. # timetagger: # # https://timetagger.app/api/v2 by default, or the api of your own server # url: https://timetagger.app/api/v2 -# # Api token, from the account page of TimeTagger -# token: ... + +# Settings of each person, by login, all optional +# users: +# jdoe: +# # Shown in the header of the notes (the name given by Authelia by default) +# student_name: Jane Doe +# student_id: "123456" +# # Api token, from the account page of TimeTagger. Without it, the time is only +# # counted in the app. +# timetagger_token: ... diff --git a/db/migrations/20261022100000_personal_calendars.sql b/db/migrations/20261022100000_personal_calendars.sql new file mode 100644 index 0000000..e0699ad --- /dev/null +++ b/db/migrations/20261022100000_personal_calendars.sql @@ -0,0 +1,33 @@ +-- migrate:up + +-- Personal calendars, apart from the courses and associations. Their events are not +-- tasks: nothing to check, only something happening at a time, maybe somewhere. +CREATE TABLE calendars ( + id SERIAL PRIMARY KEY, + "name" TEXT NOT NULL, + -- Hex color of the events, e.g. `#2563eb` + color TEXT NOT NULL CHECK (color ~ '^#[0-9a-fA-F]{6}$') +); + +-- An event of a personal calendar: a time range, or a single moment (a deadline, a +-- reminder) when `ends_at` is null. An all-day event goes from the midnight of its +-- first day to the midnight after its last one, in the time zone of the user. +CREATE TABLE events ( + id SERIAL PRIMARY KEY, + calendar_id INTEGER NOT NULL REFERENCES calendars (id) ON DELETE CASCADE, + title TEXT NOT NULL, + "location" TEXT, + description TEXT, + starts_at TIMESTAMPTZ NOT NULL, + ends_at TIMESTAMPTZ, + all_day BOOLEAN NOT NULL DEFAULT FALSE, + CHECK (ends_at IS NULL OR ends_at > starts_at), + CHECK (NOT all_day OR ends_at IS NOT NULL) +); + +CREATE INDEX events_starts_at_idx ON events (starts_at); +CREATE INDEX events_calendar_id_idx ON events (calendar_id); + +-- migrate:down +DROP TABLE IF EXISTS events; +DROP TABLE IF EXISTS calendars; diff --git a/db/migrations/20261024120000_users.sql b/db/migrations/20261024120000_users.sql new file mode 100644 index 0000000..dbfcee3 --- /dev/null +++ b/db/migrations/20261024120000_users.sql @@ -0,0 +1,25 @@ +-- migrate:up + +-- Each person has their own courses, associations and calendars: they are owned by the +-- login given by Authelia (`Remote-User`). Everything else (slots, grades, tasks, +-- files, events) belongs to the owner of its course or calendar. The tags stay shared. +-- What existed before is given to the first user of the app. +ALTER TABLE courses ADD COLUMN "owner" TEXT; +UPDATE courses SET "owner" = 'appellet'; +ALTER TABLE courses ALTER COLUMN "owner" SET NOT NULL; +-- The folders are in the folder of their owner in the storage: two people may have the +-- same course +ALTER TABLE courses DROP CONSTRAINT courses_folder_key; +ALTER TABLE courses ADD CONSTRAINT courses_owner_folder_key UNIQUE ("owner", folder); + +ALTER TABLE calendars ADD COLUMN "owner" TEXT; +UPDATE calendars SET "owner" = 'appellet'; +ALTER TABLE calendars ALTER COLUMN "owner" SET NOT NULL; +CREATE INDEX calendars_owner_idx ON calendars ("owner"); + +-- migrate:down +DROP INDEX IF EXISTS calendars_owner_idx; +ALTER TABLE calendars DROP COLUMN "owner"; +ALTER TABLE courses DROP CONSTRAINT courses_owner_folder_key; +ALTER TABLE courses ADD CONSTRAINT courses_folder_key UNIQUE (folder); +ALTER TABLE courses DROP COLUMN "owner"; diff --git a/db/schema.sql b/db/schema.sql index 4a2d0fa..a7d3338 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -19,6 +19,39 @@ SET default_tablespace = ''; SET default_table_access_method = heap; +-- +-- Name: calendars; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.calendars ( + id integer NOT NULL, + name text NOT NULL, + color text NOT NULL, + owner text NOT NULL, + CONSTRAINT calendars_color_check CHECK ((color ~ '^#[0-9a-fA-F]{6}$'::text)) +); + + +-- +-- Name: calendars_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.calendars_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: calendars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.calendars_id_seq OWNED BY public.calendars.id; + + -- -- Name: course_files; Type: TABLE; Schema: public; Owner: - -- @@ -68,6 +101,7 @@ CREATE TABLE public.courses ( main_page_url text, kind text NOT NULL, folder text NOT NULL, + owner text NOT NULL, CONSTRAINT courses_kind_check CHECK ((kind = ANY (ARRAY['course'::text, 'association'::text]))) ); @@ -92,6 +126,44 @@ CREATE SEQUENCE public.courses_id_seq ALTER SEQUENCE public.courses_id_seq OWNED BY public.courses.id; +-- +-- Name: events; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.events ( + id integer NOT NULL, + calendar_id integer NOT NULL, + title text NOT NULL, + location text, + description text, + starts_at timestamp with time zone NOT NULL, + ends_at timestamp with time zone, + all_day boolean DEFAULT false NOT NULL, + CONSTRAINT events_check CHECK (((ends_at IS NULL) OR (ends_at > starts_at))), + CONSTRAINT events_check1 CHECK (((NOT all_day) OR (ends_at IS NOT NULL))) +); + + +-- +-- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.events_id_seq OWNED BY public.events.id; + + -- -- Name: file_tags; Type: TABLE; Schema: public; Owner: - -- @@ -267,6 +339,13 @@ CREATE SEQUENCE public.time_slots_id_seq ALTER SEQUENCE public.time_slots_id_seq OWNED BY public.time_slots.id; +-- +-- Name: calendars id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendars ALTER COLUMN id SET DEFAULT nextval('public.calendars_id_seq'::regclass); + + -- -- Name: course_files id; Type: DEFAULT; Schema: public; Owner: - -- @@ -281,6 +360,13 @@ ALTER TABLE ONLY public.course_files ALTER COLUMN id SET DEFAULT nextval('public ALTER TABLE ONLY public.courses ALTER COLUMN id SET DEFAULT nextval('public.courses_id_seq'::regclass); +-- +-- Name: events id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.events ALTER COLUMN id SET DEFAULT nextval('public.events_id_seq'::regclass); + + -- -- Name: grades id; Type: DEFAULT; Schema: public; Owner: - -- @@ -309,6 +395,14 @@ ALTER TABLE ONLY public.tasks ALTER COLUMN id SET DEFAULT nextval('public.tasks_ ALTER TABLE ONLY public.time_slots ALTER COLUMN id SET DEFAULT nextval('public.time_slots_id_seq'::regclass); +-- +-- Name: calendars calendars_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendars + ADD CONSTRAINT calendars_pkey PRIMARY KEY (id); + + -- -- Name: course_files course_files_course_id_path_key; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -326,11 +420,11 @@ ALTER TABLE ONLY public.course_files -- --- Name: courses courses_folder_key; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: courses courses_owner_folder_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.courses - ADD CONSTRAINT courses_folder_key UNIQUE (folder); + ADD CONSTRAINT courses_owner_folder_key UNIQUE (owner, folder); -- @@ -341,6 +435,14 @@ ALTER TABLE ONLY public.courses ADD CONSTRAINT courses_pkey PRIMARY KEY (id); +-- +-- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.events + ADD CONSTRAINT events_pkey PRIMARY KEY (id); + + -- -- Name: file_tags file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -405,6 +507,13 @@ ALTER TABLE ONLY public.time_slots ADD CONSTRAINT time_slots_pkey PRIMARY KEY (id); +-- +-- Name: calendars_owner_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX calendars_owner_idx ON public.calendars USING btree (owner); + + -- -- Name: course_files_course_id_idx; Type: INDEX; Schema: public; Owner: - -- @@ -412,6 +521,20 @@ ALTER TABLE ONLY public.time_slots CREATE INDEX course_files_course_id_idx ON public.course_files USING btree (course_id); +-- +-- Name: events_calendar_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX events_calendar_id_idx ON public.events USING btree (calendar_id); + + +-- +-- Name: events_starts_at_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX events_starts_at_idx ON public.events USING btree (starts_at); + + -- -- Name: grades_course_id_idx; Type: INDEX; Schema: public; Owner: - -- @@ -441,6 +564,14 @@ ALTER TABLE ONLY public.course_files ADD CONSTRAINT course_files_course_id_fkey FOREIGN KEY (course_id) REFERENCES public.courses(id) ON DELETE CASCADE; +-- +-- Name: events events_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.events + ADD CONSTRAINT events_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.calendars(id) ON DELETE CASCADE; + + -- -- Name: file_tags file_tags_file_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -528,4 +659,6 @@ INSERT INTO public.schema_migrations (version) VALUES ('20260928120000'), ('20260928150000'), ('20260929090000'), - ('20260929180000'); + ('20260929180000'), + ('20261022100000'), + ('20261024120000'); diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c879ecc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,76 @@ +# Stack for Portainer. Everything it needs lives in the image, so it can be +# deployed by pasting this file — no checkout of the repository on the server. +# +# Environment variables to set in the Portainer stack: +# IMAGE registry.tibiscuit.ch/studium:latest +# POSTGRES_PASSWORD anything, it never leaves the internal network +# PROXY_SECRET shared with Caddy (`openssl rand -hex 32`): without it in the +# X-Proxy-Secret header, a request is refused +# APP_PORT host port for the reverse proxy to point at (default 3011) +# LOGOUT_URL logout page of Authelia, e.g. https://authelia.tibiscuit.ch/logout +# +# The settings of each person also come from the environment, by login (all optional): +# APP__USERS____STUDENT_NAME, APP__USERS____STUDENT_ID, +# APP__USERS____TIMETAGGER_TOKEN + +services: + db: + image: postgres:18.3-alpine + restart: unless-stopped + environment: + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in the stack} + POSTGRES_DB: studium + volumes: + # Postgres 18 moved PGDATA to /var/lib/postgresql/18/docker and its declared + # VOLUME to /var/lib/postgresql. Mounting the pre-18 /var/lib/postgresql/data + # leaves the real data outside the volume, and trips the entrypoint. + - db_data:/var/lib/postgresql + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U postgres -d studium'] + interval: 5s + timeout: 5s + retries: 10 + # initdb runs on the very first boot: do not count failures before it is done + start_period: 30s + networks: [internal] + + # Runs once per deployment, before the app: applies any new migration, then exits + migrate: + image: ${IMAGE:?set IMAGE in the stack} + restart: 'no' + entrypoint: + ['dbmate', '--migrations-dir', '/app/db/migrations', '--no-dump-schema', 'up'] + environment: + DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/studium?sslmode=disable + depends_on: + db: + condition: service_healthy + networks: [internal] + + app: + image: ${IMAGE:?set IMAGE in the stack} + restart: unless-stopped + ports: + - '${APP_PORT:-3011}:3000' + environment: + APP__POSTGRES__PASSWORD: ${POSTGRES_PASSWORD} + # The app trusts the Remote-User header of Authelia: only the requests carrying + # this secret, added by Caddy, are accepted + APP__AUTH__PROXY_SECRET: ${PROXY_SECRET:?set PROXY_SECRET in the stack} + APP__AUTH__LOGOUT_URL: ${LOGOUT_URL:-} + volumes: + # Files of the courses: a folder per person. Must belong to uid 1000, the user + # of the container. + - /mnt/nas.data/dockers/studium:/data/storage + depends_on: + db: + condition: service_healthy + migrate: + condition: service_completed_successfully + networks: [internal] + +volumes: + db_data: + +networks: + internal: diff --git a/frontend/index.html b/frontend/index.html index 2b6184e..e573ec8 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,7 +2,10 @@ - + + + + IPZV>&9d7ih200cZ=anR+ zg%X5)D7%mRw+PrMLaxG>R)E~p@7b_wk{tHh&@#l!&ab{&eH%K^RfXPI^imjvQpZc1 z3}LfhU@5|q04%PN&&OU0+!H}(Jfxk(#|V^>!0BGtU~maxH_A+e>DgJbIQHGgh;#4P zItNp^1>r`ZW32i$cuJ1I)Pok!Z_JXtvFOlsLATG+`u-rl1nvaty4{~4E-6BoD#D+# zvt+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K(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 0000000..1d3da47 --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index c766af3..c635ed4 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -1,5 +1,6 @@ + + diff --git a/frontend/src/components/calendar/EventFormDialog.vue b/frontend/src/components/calendar/EventFormDialog.vue new file mode 100644 index 0000000..0f9209f --- /dev/null +++ b/frontend/src/components/calendar/EventFormDialog.vue @@ -0,0 +1,370 @@ + + +