diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b53733e8e0413b54a92dc721936cb86cfb74aa0..8beab2e52d96641789ac66d770118657f6847f02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,19 +1,19 @@ include: - - project: "AlekSIS/official/AlekSIS" - file: /ci/general.yml - - project: "AlekSIS/official/AlekSIS" - file: /ci/prepare/lock.yml - - project: "AlekSIS/official/AlekSIS" - file: /ci/test/lint.yml - - project: "AlekSIS/official/AlekSIS" - file: /ci/test/security.yml - - project: "AlekSIS/official/AlekSIS" - file: /ci/build/dist.yml - - project: "AlekSIS/official/AlekSIS" - file: /ci/build/docs.yml - - project: "AlekSIS/official/AlekSIS" - file: "/ci/deploy/trigger_dist.yml" - - project: "AlekSIS/official/AlekSIS" - file: "/ci/docker/image.yml" - - project: "AlekSIS/official/AlekSIS" - file: /ci/publish/pypi.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/general.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/prepare/lock.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/test/lint.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/test/security.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/build/dist.yml + - project: "AlekSIS/official/AlekSIS" + file: /ci/build/docs.yml + - project: "AlekSIS/official/AlekSIS" + file: "/ci/deploy/trigger_dist.yml" + - project: "AlekSIS/official/AlekSIS" + file: "/ci/docker/image.yml" + - project: "AlekSIS/official/AlekSIS" + file: /ci/publish/pypi.yml diff --git a/aleksis/apps/stoelindeling/frontend/index.js b/aleksis/apps/stoelindeling/frontend/index.js index 367dad9dc24bca2bde0a0018761fc07af0754212..cf576c564221af38365e775a09fd836b286d7311 100644 --- a/aleksis/apps/stoelindeling/frontend/index.js +++ b/aleksis/apps/stoelindeling/frontend/index.js @@ -1,69 +1,67 @@ -export default - { - meta: { - inMenu: true, - titleKey: "stoelindeling.menu_title", - icon: "mdi-view-list-outline", - permission: "stoelindeling.view_seatingplans_rule", - }, - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, - children: [ - { - path: "seating_plans/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.seatingPlans", - meta: { - inMenu: true, - titleKey: "stoelindeling.menu_title", - icon: "mdi-view-list-outline", - permission: "stoelindeling.view_seatingplans_rule", - }, - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, +export default { + meta: { + inMenu: true, + titleKey: "stoelindeling.menu_title", + icon: "mdi-view-list-outline", + permission: "stoelindeling.view_seatingplans_rule", + }, + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, + }, + children: [ + { + path: "seating_plans/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.seatingPlans", + meta: { + inMenu: true, + titleKey: "stoelindeling.menu_title", + icon: "mdi-view-list-outline", + permission: "stoelindeling.view_seatingplans_rule", }, - { - path: "seating_plans/create/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.createSeatingPlan", - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, }, - { - path: "seating_plans/:pk/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.seatingPlan", - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, + }, + { + path: "seating_plans/create/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.createSeatingPlan", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, }, - { - path: "seating_plans/:pk/edit/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.editSeatingPlan", - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, + }, + { + path: "seating_plans/:pk/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.seatingPlan", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, }, - { - path: "seating_plans/:pk/copy/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.copySeatingPlan", - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, + }, + { + path: "seating_plans/:pk/edit/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.editSeatingPlan", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, }, - { - path: "seating_plans/:pk/delete/", - component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), - name: "stoelindeling.deleteSeatingPlan", - props: { - byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, - }, + }, + { + path: "seating_plans/:pk/copy/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.copySeatingPlan", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, + }, + }, + { + path: "seating_plans/:pk/delete/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "stoelindeling.deleteSeatingPlan", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, }, - ], - } - + }, + ], +}; diff --git a/aleksis/apps/stoelindeling/frontend/messages/de.json b/aleksis/apps/stoelindeling/frontend/messages/de.json index 4d4542c438bbc95914e3371e7219bbdc6f8580d2..2422e7d288ca61cce47ddbea0193a99ae07e8653 100644 --- a/aleksis/apps/stoelindeling/frontend/messages/de.json +++ b/aleksis/apps/stoelindeling/frontend/messages/de.json @@ -3,4 +3,3 @@ "menu_title": "Sitzpläne" } } - diff --git a/aleksis/apps/stoelindeling/frontend/messages/en.json b/aleksis/apps/stoelindeling/frontend/messages/en.json index a95f9cc2015a4239ad6a880ad04ca623f220763f..ff661f5ec5f5a31822d2e758e106b633826b0c33 100644 --- a/aleksis/apps/stoelindeling/frontend/messages/en.json +++ b/aleksis/apps/stoelindeling/frontend/messages/en.json @@ -3,4 +3,3 @@ "menu_title": "Seating plans" } } - diff --git a/aleksis/apps/stoelindeling/frontend/messages/ru.json b/aleksis/apps/stoelindeling/frontend/messages/ru.json index b58b25b5033b6cf8221799cca45636e6d3b63c68..6b236063928ab79537f98e80a8236f0846b77c30 100644 --- a/aleksis/apps/stoelindeling/frontend/messages/ru.json +++ b/aleksis/apps/stoelindeling/frontend/messages/ru.json @@ -1,5 +1,5 @@ { - "stoelindeling": { - "menu_title": "Планы раÑÑадки" - } + "stoelindeling": { + "menu_title": "Планы раÑÑадки" + } } diff --git a/aleksis/apps/stoelindeling/frontend/messages/uk.json b/aleksis/apps/stoelindeling/frontend/messages/uk.json index 64657a7f7ba742098935cf058348fc0cbf987182..3c089f2dcf92ee3c3ab78e171e64fe9ab61fa67f 100644 --- a/aleksis/apps/stoelindeling/frontend/messages/uk.json +++ b/aleksis/apps/stoelindeling/frontend/messages/uk.json @@ -1,5 +1,5 @@ { - "stoelindeling": { - "menu_title": "Плани розÑаджень" - } + "stoelindeling": { + "menu_title": "Плани розÑаджень" + } } diff --git a/aleksis/apps/stoelindeling/static/css/stoelindeling/seating_plan.css b/aleksis/apps/stoelindeling/static/css/stoelindeling/seating_plan.css index 7a7891faa09f09c31411bc55d384d12535648b14..7446b6acc2aaadca36847b6ee185db5ab57f2f7b 100644 --- a/aleksis/apps/stoelindeling/static/css/stoelindeling/seating_plan.css +++ b/aleksis/apps/stoelindeling/static/css/stoelindeling/seating_plan.css @@ -1,78 +1,78 @@ .seat { - width: 80px; - height: 80px; - margin: 2px; - padding: 2px; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; - align-items: center; - font-size: 0.8em; - word-break: break-word; - position: relative; + width: 80px; + height: 80px; + margin: 2px; + padding: 2px; + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; + align-items: center; + font-size: 0.8em; + word-break: break-word; + position: relative; } .drag-area .seat { - cursor: grab; + cursor: grab; } #seats { - overflow: auto; - width: auto; + overflow: auto; + width: auto; } .seat-grid { - display: flex; - overflow-x: scroll; + display: flex; + overflow-x: scroll; } .seat-grid-col { - margin: 0; + margin: 0; } .seat-grid-cell { - width: 86px; - height: 86px; - border: 1px dashed darkgrey; + width: 86px; + height: 86px; + border: 1px dashed darkgrey; } #not-used-seats { - display: flex; - flex-direction: row; - flex-wrap: wrap; + display: flex; + flex-direction: row; + flex-wrap: wrap; } .seat-grid-add-col { - padding: 0 5px; + padding: 0 5px; } .seat-grid-add-col button { - height: 100%; - padding: 0 5px; + height: 100%; + padding: 0 5px; } .seat-grid-add-row { - padding: 5px 5px; - width: 100%; + padding: 5px 5px; + width: 100%; } .seat-grid-add-row button { - width: 100%; + width: 100%; } .seat .clip-circle { - width: auto; - height: 60%; - position: absolute; - left: 16px; - right: 16px; - top: 5px; + width: auto; + height: 60%; + position: absolute; + left: 16px; + right: 16px; + top: 5px; } .seat-name { - position: absolute; - bottom: 2px; - left: 2px; - right: 2px; + position: absolute; + bottom: 2px; + left: 2px; + right: 2px; } diff --git a/aleksis/apps/stoelindeling/static/js/stoelindeling/edit_seating_plan.js b/aleksis/apps/stoelindeling/static/js/stoelindeling/edit_seating_plan.js index d1dd2d9ffeaf438eae7deaa2a8ba3b7eb76be87f..e5155560f74cb7c320a500d4c2bd5f5a8c11bbfa 100644 --- a/aleksis/apps/stoelindeling/static/js/stoelindeling/edit_seating_plan.js +++ b/aleksis/apps/stoelindeling/static/js/stoelindeling/edit_seating_plan.js @@ -1,90 +1,115 @@ function setPosition(event) { - const parent = $(event.to); - const xPos = parent.data("x"); - const yPos = parent.data("y"); + const parent = $(event.to); + const xPos = parent.data("x"); + const yPos = parent.data("y"); - let pk = $(event.item).attr("data-pk"); - let sel = $("#seating-plan-form input[value=" + pk + "].pk-input"); - let x = sel.nextAll("input.x-input").first(); - let y = sel.nextAll("input.y-input").first(); - let seated = sel.nextAll("input.seated-input").first(); + let pk = $(event.item).attr("data-pk"); + let sel = $("#seating-plan-form input[value=" + pk + "].pk-input"); + let x = sel.nextAll("input.x-input").first(); + let y = sel.nextAll("input.y-input").first(); + let seated = sel.nextAll("input.seated-input").first(); - if (parent.hasClass("seat-grid-cell")) { - x.val(xPos); - y.val(yPos); - seated.val("True"); - } else { - x.val("0"); - y.val("0"); - seated.val("False"); - } + if (parent.hasClass("seat-grid-cell")) { + x.val(xPos); + y.val(yPos); + seated.val("True"); + } else { + x.val("0"); + y.val("0"); + seated.val("False"); + } } function enableSeatGridCells() { - $('.seat-grid-cell').sortable({ - group: 'seats', - animation: 150, - onEnd: setPosition - }); + $(".seat-grid-cell").sortable({ + group: "seats", + animation: 150, + onEnd: setPosition, + }); } function getStartY() { - return Number.parseInt($(".seat-grid .seat-grid-col .seat-grid-cell").first().data("y")) + return Number.parseInt( + $(".seat-grid .seat-grid-col .seat-grid-cell").first().data("y") + ); } function getEndY() { - return Number.parseInt($(".seat-grid .seat-grid-col .seat-grid-cell").last().data("y")) + return Number.parseInt( + $(".seat-grid .seat-grid-col .seat-grid-cell").last().data("y") + ); } function getStartX() { - return Number.parseInt($(".seat-grid .seat-grid-col .seat-grid-cell").first().data("x")) + return Number.parseInt( + $(".seat-grid .seat-grid-col .seat-grid-cell").first().data("x") + ); } function getEndX() { - return Number.parseInt($(".seat-grid .seat-grid-col .seat-grid-cell").last().data("x")) + return Number.parseInt( + $(".seat-grid .seat-grid-col .seat-grid-cell").last().data("x") + ); } function buildRow(x) { - const el = $("<div class='seat-grid-col'></div>"); - for (let y = getStartY(); y <= getEndY(); y++) { - el.append("<div class='seat-grid-cell' data-x='" + x + "' data-y='" + y + "'></div>"); - } - return el; + const el = $("<div class='seat-grid-col'></div>"); + for (let y = getStartY(); y <= getEndY(); y++) { + el.append( + "<div class='seat-grid-cell' data-x='" + x + "' data-y='" + y + "'></div>" + ); + } + return el; } - $(document).ready(function () { - $('#not-used-seats').sortable({ - group: 'seats', - animation: 150, - onEnd: setPosition - }); - enableSeatGridCells(); + $("#not-used-seats").sortable({ + group: "seats", + animation: 150, + onEnd: setPosition, + }); + enableSeatGridCells(); - $("#seat-row-add-top").click(function () { - const y = getStartY() - 1; - $(".seat-grid .seat-grid-col").each(function (idx, el) { - const x = Number.parseInt($(el).children(".seat-grid-cell").first().data("x")); - $(el).prepend("<div class='seat-grid-cell' data-x='" + x + "' data-y='" + y + "'></div>"); - }); - enableSeatGridCells(); - }); - $("#seat-row-add-bottom").click(function () { - const y = getEndY() + 1; - $(".seat-grid .seat-grid-col").each(function (idx, el) { - const x = Number.parseInt($(el).children(".seat-grid-cell").first().data("x")); - $(el).prepend("<div class='seat-grid-cell' data-x='" + x + "' data-y='" + y + "'></div>"); - }); - enableSeatGridCells(); + $("#seat-row-add-top").click(function () { + const y = getStartY() - 1; + $(".seat-grid .seat-grid-col").each(function (idx, el) { + const x = Number.parseInt( + $(el).children(".seat-grid-cell").first().data("x") + ); + $(el).prepend( + "<div class='seat-grid-cell' data-x='" + + x + + "' data-y='" + + y + + "'></div>" + ); }); - $("#seat-col-add-left").click(function () { - const el = buildRow(getStartX() - 1); - el.insertBefore(".seat-grid-col:first"); - enableSeatGridCells(); - }); - $("#seat-col-add-right").click(function () { - const el = buildRow(getEndX() + 1); - el.insertAfter(".seat-grid-col:last"); - enableSeatGridCells(); + enableSeatGridCells(); + }); + $("#seat-row-add-bottom").click(function () { + const y = getEndY() + 1; + $(".seat-grid .seat-grid-col").each(function (idx, el) { + const x = Number.parseInt( + $(el).children(".seat-grid-cell").first().data("x") + ); + $(el).prepend( + "<div class='seat-grid-cell' data-x='" + + x + + "' data-y='" + + y + + "'></div>" + ); }); + enableSeatGridCells(); + }); + $("#seat-col-add-left").click(function () { + const el = buildRow(getStartX() - 1); + el.insertBefore(".seat-grid-col:first"); + enableSeatGridCells(); + }); + $("#seat-col-add-right").click(function () { + const el = buildRow(getEndX() + 1); + el.insertAfter(".seat-grid-col:last"); + enableSeatGridCells(); + }); }); diff --git a/aleksis/apps/stoelindeling/views.py b/aleksis/apps/stoelindeling/views.py index b3a9db165e0bf2dcd4c449bb63f2ce5798a936c7..f2e95ecfac6a5aad84c3dc0bb00f717b5a094985 100644 --- a/aleksis/apps/stoelindeling/views.py +++ b/aleksis/apps/stoelindeling/views.py @@ -1,6 +1,6 @@ from django.contrib import messages from django.shortcuts import redirect -from django.urls import reverse, reverse_lazy +from django.urls import reverse from django.utils.decorators import method_decorator from django.utils.translation import gettext as _ from django.views.decorators.cache import never_cache