Compare commits

..

6 Commits

Author SHA1 Message Date
Marijn 281462fab8 Added Gedmo stuff, fix translations (#117)
* Added Gedmo stuff, fix translations

* Add CSRF token validation across backoffice forms

- Added CSRF validations to candidate correction, penalty, answer saving, and elimination forms.
- Updated corresponding Twig templates to include CSRF token inputs.
- Adjusted column count in `tab_result` template to maintain layout consistency.

* Add unique index constraint for `quiz_candidate` with soft delete support

- Updated migration to include a unique index on `quiz_candidate` table that excludes soft-deleted records.
- Adjusted `QuizCandidate` entity to reflect the new unique constraint with `deleted_at` condition.

* Add CSRF token validation for quiz-related actions

- Added CSRF validation to `enableQuiz`, `clearQuiz`, `deleteQuiz`, `toggleCandidate`, and `prepareElimination` actions.
- Updated Twig templates to replace links with POST forms to include CSRF tokens.
- Set HTTP method restrictions for related endpoints to `POST`.

* Fix unique index condition for `quiz_candidate` with soft deletes

- Updated condition in unique index definition of `quiz_candidate` to add parentheses for clarity.
- Adjusted related migration to reflect the revised condition.

* Remove if for post an use methods in Route instead

* Refactor CSRF token validation in backoffice controllers

- Applied `#[IsCsrfTokenValid]` attribute for CSRF checks to simplify and standardize validation.
- Removed manual `isCsrfTokenValid` calls and associated exception throwing.
- Updated method signatures across affected endpoints to remove unnecessary `Request` dependency.
- Ensured consistency in route HTTP method restrictions where applicable.

* Add rector and phpstan

* Add validation for answering incorrect quiz question

- Added logic to prevent candidates from answering questions out of sequence in `QuizController`.
- Updated Dutch translations to include the new error message.

* Things
2026-05-24 19:43:30 +02:00
dependabot[bot] c033965652 Bump symfonycasts/sass-bundle from 0.9.0 to 0.10.0 (#114)
Bumps [symfonycasts/sass-bundle](https://github.com/SymfonyCasts/sass-bundle) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/SymfonyCasts/sass-bundle/releases)
- [Commits](https://github.com/SymfonyCasts/sass-bundle/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: symfonycasts/sass-bundle
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 14:58:21 +02:00
dependabot[bot] 01a034d83e Bump martin-georgiev/postgresql-for-doctrine from 4.4.0 to 4.5.1 (#115)
Bumps [martin-georgiev/postgresql-for-doctrine](https://github.com/martin-georgiev/postgresql-for-doctrine) from 4.4.0 to 4.5.1.
- [Release notes](https://github.com/martin-georgiev/postgresql-for-doctrine/releases)
- [Changelog](https://github.com/martin-georgiev/postgresql-for-doctrine/blob/main/CHANGELOG.md)
- [Commits](https://github.com/martin-georgiev/postgresql-for-doctrine/compare/v4.4.0...v4.5.1)

---
updated-dependencies:
- dependency-name: martin-georgiev/postgresql-for-doctrine
  dependency-version: 4.5.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 14:58:00 +02:00
dependabot[bot] 122f84fe3c Bump sentry/sentry from 4.22.0 to 4.27.0 (#116)
Bumps [sentry/sentry](https://github.com/getsentry/sentry-php) from 4.22.0 to 4.27.0.
- [Release notes](https://github.com/getsentry/sentry-php/releases)
- [Changelog](https://github.com/getsentry/sentry-php/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-php/compare/4.22.0...4.27.0)

---
updated-dependencies:
- dependency-name: sentry/sentry
  dependency-version: 4.27.0
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 10:09:12 +02:00
dependabot[bot] e1b607ed2d Bump sentry/sentry-symfony from 5.9.0 to 5.10.0 (#113)
Bumps [sentry/sentry-symfony](https://github.com/getsentry/sentry-symfony) from 5.9.0 to 5.10.0.
- [Release notes](https://github.com/getsentry/sentry-symfony/releases)
- [Changelog](https://github.com/getsentry/sentry-symfony/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-symfony/compare/5.9.0...5.10.0)

---
updated-dependencies:
- dependency-name: sentry/sentry-symfony
  dependency-version: 5.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 10:08:54 +02:00
dependabot[bot] 622a0e1571 Bump doctrine/orm from 3.6.2 to 3.6.6 (#112)
Bumps [doctrine/orm](https://github.com/doctrine/orm) from 3.6.2 to 3.6.6.
- [Release notes](https://github.com/doctrine/orm/releases)
- [Commits](https://github.com/doctrine/orm/compare/3.6.2...3.6.6)

---
updated-dependencies:
- dependency-name: doctrine/orm
  dependency-version: 3.6.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 10:08:31 +02:00
32 changed files with 371 additions and 180 deletions
+18 -2
View File
@@ -15,12 +15,15 @@ concurrency:
permissions: permissions:
contents: read contents: read
packages: write
jobs: jobs:
tests: tests:
name: Tests name: Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -48,6 +51,10 @@ jobs:
run: docker compose exec -T php vendor/bin/php-cs-fixer check --diff --show-progress=none run: docker compose exec -T php vendor/bin/php-cs-fixer check --diff --show-progress=none
- name: Twig Coding Style - name: Twig Coding Style
run: docker compose exec -T php vendor/bin/twig-cs-fixer check run: docker compose exec -T php vendor/bin/twig-cs-fixer check
- name: Static Analysis (PHPStan)
run: docker compose exec -T php vendor/bin/phpstan analyse --no-progress --no-ansi --error-format=github
- name: Rector
run: docker compose exec -T php vendor/bin/rector process --dry-run --no-progress-bar --output-format=github
- name: Check HTTP reachability - name: Check HTTP reachability
run: curl -v --fail-with-body http://localhost run: curl -v --fail-with-body http://localhost
- name: Check Mercure reachability - name: Check Mercure reachability
@@ -60,12 +67,21 @@ jobs:
- name: Load fixtures - name: Load fixtures
run: docker compose exec -T php bin/console -e test doctrine:fixtures:load --no-interaction --group=test run: docker compose exec -T php bin/console -e test doctrine:fixtures:load --no-interaction --group=test
- name: Run PHPUnit - name: Run PHPUnit
run: docker compose exec -T php vendor/bin/phpunit run: docker compose exec -T php vendor/bin/phpunit --log-junit var/phpunit/junit.xml
- name: Publish PHPUnit test results
if: always()
uses: mikepenz/action-junit-report@v5
with:
report_paths: var/phpunit/junit.xml
check_name: PHPUnit
- name: Doctrine Schema Validator - name: Doctrine Schema Validator
run: docker compose exec -T php bin/console -e test doctrine:schema:validate run: docker compose exec -T php bin/console -e test doctrine:schema:validate
build-deploy: build-deploy:
name: Build and deploy to ${{ startsWith(github.ref, 'refs/tags/') && 'production' || (github.ref == 'refs/heads/main' && 'acceptance' || '') }} name: Build and deploy to ${{ startsWith(github.ref, 'refs/tags/') && 'production' || (github.ref == 'refs/heads/main' && 'acceptance' || '') }}
permissions:
contents: read
packages: write
environment: environment:
name: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || (github.ref == 'refs/heads/main' && 'acceptance' || '') }} name: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || (github.ref == 'refs/heads/main' && 'acceptance' || '') }}
url: ${{ vars.URL }} url: ${{ vars.URL }}
+1
View File
@@ -166,6 +166,7 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/gedmo/doctrine-extensions" /> <excludeFolder url="file://$MODULE_DIR$/vendor/gedmo/doctrine-extensions" />
<excludeFolder url="file://$MODULE_DIR$/vendor/stof/doctrine-extensions-bundle" /> <excludeFolder url="file://$MODULE_DIR$/vendor/stof/doctrine-extensions-bundle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/git-state" /> <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/git-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ergebnis/agent-detector" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
+1
View File
@@ -73,6 +73,7 @@
<inspection_tool class="PhpFullyQualifiedNameUsageInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true"> <inspection_tool class="PhpFullyQualifiedNameUsageInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="IGNORE_GLOBAL_NAMESPACE" value="true" /> <option name="IGNORE_GLOBAL_NAMESPACE" value="true" />
</inspection_tool> </inspection_tool>
<inspection_tool class="PhpPublicPropertyModifierCanBeOmittedInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PhpStanGlobal" enabled="true" level="WEAK WARNING" enabled_by_default="true" /> <inspection_tool class="PhpStanGlobal" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="optionConfiguration"> <option name="optionConfiguration">
Generated
+1
View File
@@ -203,6 +203,7 @@
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" /> <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php85" /> <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php85" />
<path value="$PROJECT_DIR$/vendor/sebastian/git-state" /> <path value="$PROJECT_DIR$/vendor/sebastian/git-state" />
<path value="$PROJECT_DIR$/vendor/ergebnis/agent-detector" />
</include_path> </include_path>
</component> </component>
<component name="PhpInterpreters"> <component name="PhpInterpreters">
+1 -1
View File
@@ -61,7 +61,7 @@ services:
image: axllent/mailpit image: axllent/mailpit
ports: ports:
- "1025" - "1025"
- "8025" - "8025:8025"
environment: environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1
+1 -1
View File
@@ -40,7 +40,7 @@
"symfony/ux-turbo": "^2.35.0", "symfony/ux-turbo": "^2.35.0",
"symfony/validator": "8.0.*", "symfony/validator": "8.0.*",
"symfony/yaml": "8.0.*", "symfony/yaml": "8.0.*",
"symfonycasts/sass-bundle": "^0.9", "symfonycasts/sass-bundle": "^0.10",
"symfonycasts/verify-email-bundle": "^1.18.0", "symfonycasts/verify-email-bundle": "^1.18.0",
"thecodingmachine/safe": "^3.4.0", "thecodingmachine/safe": "^3.4.0",
"twig/extra-bundle": "^3.24.0", "twig/extra-bundle": "^3.24.0",
Generated
+51 -44
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "cccceca487b3bce45a81110944723fd4", "content-hash": "05cf0154674041e04c48a37f5d7c9b42",
"packages": [ "packages": [
{ {
"name": "composer/pcre", "name": "composer/pcre",
@@ -1041,16 +1041,16 @@
}, },
{ {
"name": "doctrine/orm", "name": "doctrine/orm",
"version": "3.6.2", "version": "3.6.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/orm.git", "url": "https://github.com/doctrine/orm.git",
"reference": "4262eb495b4d2a53b45de1ac58881e0091f2970f" "reference": "471b12949ff9bc23ecdc809ce838613c1aa9a0b9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/orm/zipball/4262eb495b4d2a53b45de1ac58881e0091f2970f", "url": "https://api.github.com/repos/doctrine/orm/zipball/471b12949ff9bc23ecdc809ce838613c1aa9a0b9",
"reference": "4262eb495b4d2a53b45de1ac58881e0091f2970f", "reference": "471b12949ff9bc23ecdc809ce838613c1aa9a0b9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1123,9 +1123,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/doctrine/orm/issues", "issues": "https://github.com/doctrine/orm/issues",
"source": "https://github.com/doctrine/orm/tree/3.6.2" "source": "https://github.com/doctrine/orm/tree/3.6.6"
}, },
"time": "2026-01-30T21:41:41+00:00" "time": "2026-05-21T06:05:47+00:00"
}, },
{ {
"name": "doctrine/persistence", "name": "doctrine/persistence",
@@ -1477,16 +1477,16 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.9.0", "version": "2.10.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" "reference": "73ab136360b5dfd858006eae9795e8fe43c80361"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", "url": "https://api.github.com/repos/guzzle/psr7/zipball/73ab136360b5dfd858006eae9795e8fe43c80361",
"reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", "reference": "73ab136360b5dfd858006eae9795e8fe43c80361",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1501,9 +1501,9 @@
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0", "http-interop/http-factory-tests": "1.1.0",
"jshttp/mime-db": "1.54.0.1", "jshttp/mime-db": "1.54.0.1",
"phpunit/phpunit": "^8.5.44 || ^9.6.25" "phpunit/phpunit": "^8.5.52 || ^9.6.34"
}, },
"suggest": { "suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@@ -1574,7 +1574,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.9.0" "source": "https://github.com/guzzle/psr7/tree/2.10.1"
}, },
"funding": [ "funding": [
{ {
@@ -1590,7 +1590,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2026-03-10T16:41:02+00:00" "time": "2026-05-20T09:27:36+00:00"
}, },
{ {
"name": "jean85/pretty-package-versions", "name": "jean85/pretty-package-versions",
@@ -1839,16 +1839,16 @@
}, },
{ {
"name": "martin-georgiev/postgresql-for-doctrine", "name": "martin-georgiev/postgresql-for-doctrine",
"version": "v4.4.0", "version": "v4.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/martin-georgiev/postgresql-for-doctrine.git", "url": "https://github.com/martin-georgiev/postgresql-for-doctrine.git",
"reference": "cba0aaccc746ba2aefedc33c277b482e2ce139a0" "reference": "98154bfecbb0d4d84386eec0ec5c0818280efa94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/martin-georgiev/postgresql-for-doctrine/zipball/cba0aaccc746ba2aefedc33c277b482e2ce139a0", "url": "https://api.github.com/repos/martin-georgiev/postgresql-for-doctrine/zipball/98154bfecbb0d4d84386eec0ec5c0818280efa94",
"reference": "cba0aaccc746ba2aefedc33c277b482e2ce139a0", "reference": "98154bfecbb0d4d84386eec0ec5c0818280efa94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1864,12 +1864,12 @@
"doctrine/orm": "~2.14||~3.0", "doctrine/orm": "~2.14||~3.0",
"ekino/phpstan-banned-code": "^3.2.0", "ekino/phpstan-banned-code": "^3.2.0",
"friendsofphp/php-cs-fixer": "^3.94.2", "friendsofphp/php-cs-fixer": "^3.94.2",
"phpstan/phpstan": "^2.1.40", "phpstan/phpstan": "^2.1.46",
"phpstan/phpstan-deprecation-rules": "^2.0.4", "phpstan/phpstan-deprecation-rules": "^2.0.4",
"phpstan/phpstan-doctrine": "^2.0.20", "phpstan/phpstan-doctrine": "^2.0.20",
"phpstan/phpstan-phpunit": "^2.0.16", "phpstan/phpstan-phpunit": "^2.0.16",
"phpunit/phpunit": "^10.5.63||^11.5", "phpunit/phpunit": "^10.5.63||^11.5",
"rector/rector": "^2.3.8", "rector/rector": "^2.4.1",
"symfony/cache": "^6.4||^7.0", "symfony/cache": "^6.4||^7.0",
"symfony/var-exporter": "^6.4||^7.0" "symfony/var-exporter": "^6.4||^7.0"
}, },
@@ -1924,6 +1924,7 @@
"ltree", "ltree",
"macaddr", "macaddr",
"martin-georgiev", "martin-georgiev",
"math-functions",
"money", "money",
"multirange", "multirange",
"network-types", "network-types",
@@ -1938,6 +1939,7 @@
"soundex", "soundex",
"spatial", "spatial",
"text-search", "text-search",
"trigonometry",
"tsquery", "tsquery",
"tsvector", "tsvector",
"uuid", "uuid",
@@ -1947,7 +1949,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/martin-georgiev/postgresql-for-doctrine/issues", "issues": "https://github.com/martin-georgiev/postgresql-for-doctrine/issues",
"source": "https://github.com/martin-georgiev/postgresql-for-doctrine/tree/v4.4.0" "source": "https://github.com/martin-georgiev/postgresql-for-doctrine/tree/v4.5.1"
}, },
"funding": [ "funding": [
{ {
@@ -1959,7 +1961,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-03-21T18:11:34+00:00" "time": "2026-04-19T11:31:03+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
@@ -2748,16 +2750,16 @@
}, },
{ {
"name": "sentry/sentry", "name": "sentry/sentry",
"version": "4.22.0", "version": "4.27.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-php.git", "url": "https://github.com/getsentry/sentry-php.git",
"reference": "ce6ab95a7021f976a27b4628a4072e481c8acf60" "reference": "1f0544cff8443ac1d25d6521487118e28381a1c2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/ce6ab95a7021f976a27b4628a4072e481c8acf60", "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/1f0544cff8443ac1d25d6521487118e28381a1c2",
"reference": "ce6ab95a7021f976a27b4628a4072e481c8acf60", "reference": "1f0544cff8443ac1d25d6521487118e28381a1c2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2774,19 +2776,23 @@
"raven/raven": "*" "raven/raven": "*"
}, },
"require-dev": { "require-dev": {
"carthage-software/mago": "^1.13.3",
"friendsofphp/php-cs-fixer": "^3.4", "friendsofphp/php-cs-fixer": "^3.4",
"guzzlehttp/promises": "^2.0.3", "guzzlehttp/promises": "^2.0.3",
"guzzlehttp/psr7": "^1.8.4|^2.1.1", "guzzlehttp/psr7": "^1.8.4|^2.1.1",
"monolog/monolog": "^1.6|^2.0|^3.0", "monolog/monolog": "^1.6|^2.0|^3.0",
"nyholm/psr7": "^1.8", "nyholm/psr7": "^1.8",
"open-telemetry/api": "^1.0",
"open-telemetry/exporter-otlp": "^1.0",
"open-telemetry/sdk": "^1.0",
"phpbench/phpbench": "^1.0", "phpbench/phpbench": "^1.0",
"phpstan/phpstan": "^1.3", "phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^8.5.52|^9.6.34", "phpunit/phpunit": "^8.5.52|^9.6.34",
"spiral/roadrunner-http": "^3.6", "spiral/roadrunner-http": "^3.6",
"spiral/roadrunner-worker": "^3.6", "spiral/roadrunner-worker": "^3.6"
"vimeo/psalm": "^4.17"
}, },
"suggest": { "suggest": {
"ext-excimer": "Enable Sentry profiling with the Excimer PHP extension.",
"monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler."
}, },
"type": "library", "type": "library",
@@ -2823,7 +2829,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-php/issues", "issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/4.22.0" "source": "https://github.com/getsentry/sentry-php/tree/4.27.0"
}, },
"funding": [ "funding": [
{ {
@@ -2835,27 +2841,27 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2026-03-16T13:03:46+00:00" "time": "2026-05-06T14:32:16+00:00"
}, },
{ {
"name": "sentry/sentry-symfony", "name": "sentry/sentry-symfony",
"version": "5.9.0", "version": "5.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-symfony.git", "url": "https://github.com/getsentry/sentry-symfony.git",
"reference": "75a73de23b9af414b3c8b15c26187a4ae6c65732" "reference": "6f49255f4cdcfc43a3a283bd3a1f65d483e9192f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-symfony/zipball/75a73de23b9af414b3c8b15c26187a4ae6c65732", "url": "https://api.github.com/repos/getsentry/sentry-symfony/zipball/6f49255f4cdcfc43a3a283bd3a1f65d483e9192f",
"reference": "75a73de23b9af414b3c8b15c26187a4ae6c65732", "reference": "6f49255f4cdcfc43a3a283bd3a1f65d483e9192f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"guzzlehttp/psr7": "^2.1.1", "guzzlehttp/psr7": "^2.1.1",
"jean85/pretty-package-versions": "^1.5||^2.0", "jean85/pretty-package-versions": "^1.5||^2.0",
"php": "^7.2||^8.0", "php": "^7.2||^8.0",
"sentry/sentry": "^4.20.0", "sentry/sentry": "^4.23.0",
"symfony/cache-contracts": "^1.1||^2.4||^3.0", "symfony/cache-contracts": "^1.1||^2.4||^3.0",
"symfony/config": "^4.4.20||^5.0.11||^6.0||^7.0||^8.0", "symfony/config": "^4.4.20||^5.0.11||^6.0||^7.0||^8.0",
"symfony/console": "^4.4.20||^5.0.11||^6.0||^7.0||^8.0", "symfony/console": "^4.4.20||^5.0.11||^6.0||^7.0||^8.0",
@@ -2925,7 +2931,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-symfony/issues", "issues": "https://github.com/getsentry/sentry-symfony/issues",
"source": "https://github.com/getsentry/sentry-symfony/tree/5.9.0" "source": "https://github.com/getsentry/sentry-symfony/tree/5.10.0"
}, },
"funding": [ "funding": [
{ {
@@ -2937,7 +2943,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2026-02-23T12:32:36+00:00" "time": "2026-04-01T14:50:32+00:00"
}, },
{ {
"name": "stof/doctrine-extensions-bundle", "name": "stof/doctrine-extensions-bundle",
@@ -8082,16 +8088,16 @@
}, },
{ {
"name": "symfonycasts/sass-bundle", "name": "symfonycasts/sass-bundle",
"version": "v0.9.0", "version": "v0.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/SymfonyCasts/sass-bundle.git", "url": "https://github.com/SymfonyCasts/sass-bundle.git",
"reference": "3472f2018417b4f7258095089b327a7ba79018ad" "reference": "eedf6ace11e5323344726d2b6e0ba1635cf12bb5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/SymfonyCasts/sass-bundle/zipball/3472f2018417b4f7258095089b327a7ba79018ad", "url": "https://api.github.com/repos/SymfonyCasts/sass-bundle/zipball/eedf6ace11e5323344726d2b6e0ba1635cf12bb5",
"reference": "3472f2018417b4f7258095089b327a7ba79018ad", "reference": "eedf6ace11e5323344726d2b6e0ba1635cf12bb5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -8099,6 +8105,7 @@
"symfony/asset-mapper": "^6.3|^7.0|^8.0", "symfony/asset-mapper": "^6.3|^7.0|^8.0",
"symfony/console": "^5.4|^6.3|^7.0|^8.0", "symfony/console": "^5.4|^6.3|^7.0|^8.0",
"symfony/filesystem": "^5.4|^6.3|^7.0|^8.0", "symfony/filesystem": "^5.4|^6.3|^7.0|^8.0",
"symfony/finder": "^5.4|^6.3|^7.0|^8.0",
"symfony/http-client": "^5.4|^6.3|^7.0|^8.0", "symfony/http-client": "^5.4|^6.3|^7.0|^8.0",
"symfony/process": "^5.4|^6.3|^7.0|^8.0" "symfony/process": "^5.4|^6.3|^7.0|^8.0"
}, },
@@ -8131,9 +8138,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/SymfonyCasts/sass-bundle/issues", "issues": "https://github.com/SymfonyCasts/sass-bundle/issues",
"source": "https://github.com/SymfonyCasts/sass-bundle/tree/v0.9.0" "source": "https://github.com/SymfonyCasts/sass-bundle/tree/v0.10.0"
}, },
"time": "2025-11-29T13:44:16+00:00" "time": "2026-04-09T11:29:28+00:00"
}, },
{ {
"name": "symfonycasts/verify-email-bundle", "name": "symfonycasts/verify-email-bundle",
+4
View File
@@ -22,6 +22,10 @@ doctrine:
identity_generation_preferences: identity_generation_preferences:
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
auto_mapping: true auto_mapping: true
filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
enabled: true
mappings: mappings:
Tvdt: Tvdt:
type: attribute type: attribute
@@ -5,3 +5,4 @@ stof_doctrine_extensions:
orm: orm:
default: default:
timestampable: true timestampable: true
softdeleteable: true
+2
View File
@@ -0,0 +1,2 @@
symfonycasts_verify_email:
lifetime: 604800 # 1 week in seconds
+6
View File
@@ -1309,6 +1309,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* traces_sampler?: scalar|Param|null, * traces_sampler?: scalar|Param|null,
* profiles_sample_rate?: float|Param, // The sampling factor to apply to profiles. A value of 0 will deny sending any profiles, and a value of 1 will send all profiles. Profiles are sampled in relation to traces_sample_rate * profiles_sample_rate?: float|Param, // The sampling factor to apply to profiles. A value of 0 will deny sending any profiles, and a value of 1 will send all profiles. Profiles are sampled in relation to traces_sample_rate
* enable_logs?: bool|Param, * enable_logs?: bool|Param,
* log_flush_threshold?: mixed, // Default: null
* enable_metrics?: bool|Param, // Default: true * enable_metrics?: bool|Param, // Default: true
* attach_stacktrace?: bool|Param, * attach_stacktrace?: bool|Param,
* attach_metric_code_locations?: bool|Param, * attach_metric_code_locations?: bool|Param,
@@ -1318,6 +1319,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* spotlight?: bool|Param, * spotlight?: bool|Param,
* spotlight_url?: scalar|Param|null, * spotlight_url?: scalar|Param|null,
* release?: scalar|Param|null, // Default: "%env(default::SENTRY_RELEASE)%" * release?: scalar|Param|null, // Default: "%env(default::SENTRY_RELEASE)%"
* org_id?: int|Param,
* server_name?: scalar|Param|null, * server_name?: scalar|Param|null,
* ignore_exceptions?: list<scalar|Param|null>, * ignore_exceptions?: list<scalar|Param|null>,
* ignore_transactions?: list<scalar|Param|null>, * ignore_transactions?: list<scalar|Param|null>,
@@ -1328,6 +1330,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* before_send_log?: scalar|Param|null, * before_send_log?: scalar|Param|null,
* before_send_metric?: scalar|Param|null, * before_send_metric?: scalar|Param|null,
* trace_propagation_targets?: mixed, * trace_propagation_targets?: mixed,
* strict_trace_continuation?: bool|Param,
* tags?: array<string, scalar|Param|null>, * tags?: array<string, scalar|Param|null>,
* error_types?: scalar|Param|null, * error_types?: scalar|Param|null,
* max_breadcrumbs?: int|Param, * max_breadcrumbs?: int|Param,
@@ -1352,11 +1355,13 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* enabled?: bool|Param, // Default: false * enabled?: bool|Param, // Default: false
* capture_soft_fails?: bool|Param, // Default: true * capture_soft_fails?: bool|Param, // Default: true
* isolate_breadcrumbs_by_message?: bool|Param, // Default: false * isolate_breadcrumbs_by_message?: bool|Param, // Default: false
* isolate_context_by_message?: bool|Param, // Default: false
* }, * },
* tracing?: bool|array{ * tracing?: bool|array{
* enabled?: bool|Param, // Default: true * enabled?: bool|Param, // Default: true
* dbal?: bool|array{ * dbal?: bool|array{
* enabled?: bool|Param, // Default: true * enabled?: bool|Param, // Default: true
* ignore_prepare_spans?: bool|Param, // Default: false
* connections?: list<scalar|Param|null>, * connections?: list<scalar|Param|null>,
* }, * },
* twig?: bool|array{ * twig?: bool|array{
@@ -1376,6 +1381,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* @psalm-type SymfonycastsSassConfig = array{ * @psalm-type SymfonycastsSassConfig = array{
* root_sass?: list<scalar|Param|null>, * root_sass?: list<scalar|Param|null>,
* binary?: scalar|Param|null, // The Sass binary to use // Default: null * binary?: scalar|Param|null, // The Sass binary to use // Default: null
* search_for_binary?: scalar|Param|null, // Whether to search for the Sass binary in the system PATH // Default: true
* sass_options?: array{ * sass_options?: array{
* style?: "compressed"|"expanded"|Param, // The style of the generated CSS: compressed or expanded. // Default: "expanded" * style?: "compressed"|"expanded"|Param, // The style of the generated CSS: compressed or expanded. // Default: "expanded"
* charset?: bool|Param, // Whether to include the charset declaration in the generated Sass. * charset?: bool|Param, // Whether to include the charset declaration in the generated Sass.
+34
View File
@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260523095205 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add soft-delete support (deleted_at columns) and rename elimination.created to created_at';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE elimination ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE elimination RENAME COLUMN created TO created_at');
$this->addSql('ALTER TABLE given_answer ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE quiz_candidate ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE elimination DROP deleted_at');
$this->addSql('ALTER TABLE elimination RENAME COLUMN created_at TO created');
$this->addSql('ALTER TABLE given_answer DROP deleted_at');
$this->addSql('ALTER TABLE quiz_candidate DROP deleted_at');
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260523095302 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add updated_at column to elimination table and set it to created_at';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE elimination ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE elimination ALTER created_at TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('UPDATE elimination SET updated_at = created_at');
$this->addSql('ALTER TABLE elimination ALTER updated_at SET NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE elimination DROP updated_at');
$this->addSql('ALTER TABLE elimination ALTER created_at TYPE TIMESTAMP(0) WITH TIME ZONE');
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260524135246 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add unique constraint for quiz_candidate with deleted_at filter';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX uniq_ced2ffa291bd8781853cd175');
$this->addSql('CREATE UNIQUE INDEX UNIQ_CED2FFA291BD8781853CD175 ON quiz_candidate (candidate_id, quiz_id) WHERE (deleted_at IS NULL)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_CED2FFA291BD8781853CD175');
$this->addSql('CREATE UNIQUE INDEX uniq_ced2ffa291bd8781853cd175 ON quiz_candidate (candidate_id, quiz_id)');
}
}
@@ -10,6 +10,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Requirement\Requirement; use Symfony\Component\Routing\Requirement\Requirement;
use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid;
use Tvdt\Controller\AbstractController; use Tvdt\Controller\AbstractController;
use Tvdt\Entity\Elimination; use Tvdt\Entity\Elimination;
use Tvdt\Entity\Quiz; use Tvdt\Entity\Quiz;
@@ -20,10 +21,12 @@ final class PrepareEliminationController extends AbstractController
{ {
public function __construct(private readonly EliminationFactory $eliminationFactory, private readonly EntityManagerInterface $em) {} public function __construct(private readonly EliminationFactory $eliminationFactory, private readonly EntityManagerInterface $em) {}
#[IsCsrfTokenValid('prepare_elimination')]
#[Route( #[Route(
'/backoffice/season/{seasonCode:season}/quiz/{quiz}/elimination/prepare', '/backoffice/season/{seasonCode:season}/quiz/{quiz}/elimination/prepare',
name: 'tvdt_prepare_elimination', name: 'tvdt_prepare_elimination',
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID], requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID],
methods: ['POST'],
)] )]
public function index(Season $season, Quiz $quiz): RedirectResponse public function index(Season $season, Quiz $quiz): RedirectResponse
{ {
@@ -32,14 +35,16 @@ final class PrepareEliminationController extends AbstractController
return $this->redirectToRoute('tvdt_prepare_elimination_view', ['elimination' => $elimination->id]); return $this->redirectToRoute('tvdt_prepare_elimination_view', ['elimination' => $elimination->id]);
} }
#[IsCsrfTokenValid('prepare_elimination', methods: ['POST'])]
#[Route( #[Route(
'/backoffice/elimination/{elimination}', '/backoffice/elimination/{elimination}',
name: 'tvdt_prepare_elimination_view', name: 'tvdt_prepare_elimination_view',
requirements: ['elimination' => Requirement::UUID], requirements: ['elimination' => Requirement::UUID],
methods: ['GET', 'POST'],
)] )]
public function viewElimination(Elimination $elimination, Request $request): Response public function viewElimination(Elimination $elimination, Request $request): Response
{ {
if ('POST' === $request->getMethod()) { if ($request->isMethod('POST')) {
$elimination->updateFromInputBag($request->request); $elimination->updateFromInputBag($request->request);
$this->em->flush(); $this->em->flush();
@@ -48,6 +53,8 @@ final class PrepareEliminationController extends AbstractController
} }
$this->addFlash('success', 'Elimination updated'); $this->addFlash('success', 'Elimination updated');
return $this->redirectToRoute('tvdt_prepare_elimination_view', ['elimination' => $elimination->id]);
} }
return $this->render('backoffice/prepare_elimination/index.html.twig', [ return $this->render('backoffice/prepare_elimination/index.html.twig', [
+14 -10
View File
@@ -10,9 +10,9 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Requirement\Requirement; use Symfony\Component\Routing\Requirement\Requirement;
use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Tvdt\Controller\AbstractController; use Tvdt\Controller\AbstractController;
@@ -184,6 +184,7 @@ class QuizController extends AbstractController
]); ]);
} }
#[IsCsrfTokenValid('candidate_answer')]
#[IsGranted(SeasonVoter::EDIT, subject: 'season')] #[IsGranted(SeasonVoter::EDIT, subject: 'season')]
#[Route( #[Route(
'/backoffice/season/{seasonCode:season}/quiz/{quiz}/candidates/{question}', '/backoffice/season/{seasonCode:season}/quiz/{quiz}/candidates/{question}',
@@ -241,11 +242,13 @@ class QuizController extends AbstractController
]); ]);
} }
#[IsCsrfTokenValid('enable_quiz')]
#[IsGranted(SeasonVoter::EDIT, subject: 'season')] #[IsGranted(SeasonVoter::EDIT, subject: 'season')]
#[Route( #[Route(
'/backoffice/season/{seasonCode:season}/quiz/{quiz}/enable', '/backoffice/season/{seasonCode:season}/quiz/{quiz}/enable',
name: 'tvdt_backoffice_enable', name: 'tvdt_backoffice_enable',
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID.'|null'], requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID.'|null'],
methods: ['POST'],
)] )]
public function enableQuiz(Season $season, ?Quiz $quiz): RedirectResponse public function enableQuiz(Season $season, ?Quiz $quiz): RedirectResponse
{ {
@@ -259,11 +262,13 @@ class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $season->seasonCode]); return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $season->seasonCode]);
} }
#[IsCsrfTokenValid('clear_quiz')]
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')] #[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
#[Route( #[Route(
'/backoffice/quiz/{quiz}/clear', '/backoffice/quiz/{quiz}/clear',
name: 'tvdt_backoffice_quiz_clear', name: 'tvdt_backoffice_quiz_clear',
requirements: ['quiz' => Requirement::UUID], requirements: ['quiz' => Requirement::UUID],
methods: ['POST'],
)] )]
public function clearQuiz(Quiz $quiz): RedirectResponse public function clearQuiz(Quiz $quiz): RedirectResponse
{ {
@@ -277,11 +282,13 @@ class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]); return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]);
} }
#[IsCsrfTokenValid('delete_quiz')]
#[IsGranted(SeasonVoter::DELETE, subject: 'quiz')] #[IsGranted(SeasonVoter::DELETE, subject: 'quiz')]
#[Route( #[Route(
'/backoffice/quiz/{quiz}/delete', '/backoffice/quiz/{quiz}/delete',
name: 'tvdt_backoffice_quiz_delete', name: 'tvdt_backoffice_quiz_delete',
requirements: ['quiz' => Requirement::UUID], requirements: ['quiz' => Requirement::UUID],
methods: ['POST'],
)] )]
public function deleteQuiz(Quiz $quiz): RedirectResponse public function deleteQuiz(Quiz $quiz): RedirectResponse
{ {
@@ -292,18 +299,16 @@ class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $quiz->season->seasonCode]); return $this->redirectToRoute('tvdt_backoffice_season', ['seasonCode' => $quiz->season->seasonCode]);
} }
#[IsCsrfTokenValid('candidate_correction')]
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')] #[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
#[Route( #[Route(
'/backoffice/quiz/{quiz}/candidate/{candidate}/modify_correction', '/backoffice/quiz/{quiz}/candidate/{candidate}/modify_correction',
name: 'tvdt_backoffice_modify_correction', name: 'tvdt_backoffice_modify_correction',
requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID], requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID],
methods: ['POST'],
)] )]
public function modifyCorrection(Quiz $quiz, Candidate $candidate, Request $request): RedirectResponse public function modifyCorrection(Quiz $quiz, Candidate $candidate, Request $request): RedirectResponse
{ {
if (!$request->isMethod('POST')) {
throw new MethodNotAllowedHttpException(['POST']);
}
$corrections = (float) $request->request->get('corrections'); $corrections = (float) $request->request->get('corrections');
$this->quizCandidateRepository->setCorrectionsForCandidate($quiz, $candidate, $corrections); $this->quizCandidateRepository->setCorrectionsForCandidate($quiz, $candidate, $corrections);
@@ -311,18 +316,16 @@ class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]); return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]);
} }
#[IsCsrfTokenValid('candidate_penalty')]
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')] #[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
#[Route( #[Route(
'/backoffice/quiz/{quiz}/candidate/{candidate}/modify_penalty', '/backoffice/quiz/{quiz}/candidate/{candidate}/modify_penalty',
name: 'tvdt_backoffice_modify_penalty', name: 'tvdt_backoffice_modify_penalty',
requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID], requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID],
methods: ['POST'],
)] )]
public function modifyPenalty(Quiz $quiz, Candidate $candidate, Request $request): RedirectResponse public function modifyPenalty(Quiz $quiz, Candidate $candidate, Request $request): RedirectResponse
{ {
if (!$request->isMethod('POST')) {
throw new MethodNotAllowedHttpException(['POST']);
}
$penalty = (int) $request->request->get('penalty'); $penalty = (int) $request->request->get('penalty');
$this->quizCandidateRepository->setPenaltyForCandidate($quiz, $candidate, $penalty); $this->quizCandidateRepository->setPenaltyForCandidate($quiz, $candidate, $penalty);
@@ -330,12 +333,13 @@ class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]); return $this->redirectToRoute('tvdt_backoffice_quiz', ['seasonCode' => $quiz->season->seasonCode, 'quiz' => $quiz->id]);
} }
#[IsCsrfTokenValid('toggle_candidate')]
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')] #[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
#[Route( #[Route(
'/backoffice/quiz/{quiz}/candidate/{candidate}/toggle', '/backoffice/quiz/{quiz}/candidate/{candidate}/toggle',
name: 'tvdt_backoffice_toggle_candidate', name: 'tvdt_backoffice_toggle_candidate',
requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID], requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID],
methods: ['GET'], methods: ['POST'],
)] )]
public function toggleCandidate(Quiz $quiz, Candidate $candidate): RedirectResponse public function toggleCandidate(Quiz $quiz, Candidate $candidate): RedirectResponse
{ {
+2 -2
View File
@@ -55,7 +55,7 @@ final class EliminationController extends AbstractController
$candidate = $this->candidateRepository->getCandidateByHash($elimination->quiz->season, $candidateHash); $candidate = $this->candidateRepository->getCandidateByHash($elimination->quiz->season, $candidateHash);
if (!$candidate instanceof Candidate) { if (!$candidate instanceof Candidate) {
$this->addFlash(FlashType::Warning, $this->addFlash(FlashType::Warning,
t('Cound not find candidate with name %name%', ['%name%' => Base64::base64UrlDecode($candidateHash)])->trans($this->translator), t('Could not find candidate with name {name}', ['name' => Base64::base64UrlDecode($candidateHash)])->trans($this->translator),
); );
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]); return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]);
@@ -64,7 +64,7 @@ final class EliminationController extends AbstractController
$screenColour = $elimination->getScreenColour($candidate->name); $screenColour = $elimination->getScreenColour($candidate->name);
if (null === $screenColour) { if (null === $screenColour) {
$this->addFlash(FlashType::Warning, $this->translator->trans('Cound not find candidate with name %name% in elimination.', ['%name%' => $candidate->name])); $this->addFlash(FlashType::Warning, $this->translator->trans('Could not find candidate with name {name} in elimination.', ['name' => $candidate->name]));
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]); return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]);
} }
+1
View File
@@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Tvdt\Enum\FlashType; use Tvdt\Enum\FlashType;
+10 -1
View File
@@ -9,6 +9,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController; use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Tvdt\Entity\Answer; use Tvdt\Entity\Answer;
use Tvdt\Entity\Candidate; use Tvdt\Entity\Candidate;
@@ -70,10 +71,12 @@ final class QuizController extends AbstractController
return $this->render('quiz/enter_name.twig', ['season' => $season, 'form' => $form]); return $this->render('quiz/enter_name.twig', ['season' => $season, 'form' => $form]);
} }
#[IsCsrfTokenValid('question', tokenKey: 'token', methods: ['POST'])]
#[Route( #[Route(
path: '/{seasonCode:season}/{nameHash}', path: '/{seasonCode:season}/{nameHash}',
name: 'tvdt_quiz_quiz_page', name: 'tvdt_quiz_quiz_page',
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'nameHash' => self::CANDIDATE_HASH_REGEX], requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'nameHash' => self::CANDIDATE_HASH_REGEX],
methods: ['GET', 'POST'],
)] )]
public function quizPage( public function quizPage(
Season $season, Season $season,
@@ -96,7 +99,7 @@ final class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_quiz_enter_name', ['seasonCode' => $season->seasonCode]); return $this->redirectToRoute('tvdt_quiz_enter_name', ['seasonCode' => $season->seasonCode]);
} }
if ('POST' === $request->getMethod()) { if ($request->isMethod('POST')) {
// TODO: Extract saving answer logic to a service // TODO: Extract saving answer logic to a service
// Check if candidate is inactive for this quiz // Check if candidate is inactive for this quiz
$quizCandidate = $this->quizCandidateRepository->findOneBy(['quiz' => $quiz, 'candidate' => $candidate]); $quizCandidate = $this->quizCandidateRepository->findOneBy(['quiz' => $quiz, 'candidate' => $candidate]);
@@ -114,6 +117,12 @@ final class QuizController extends AbstractController
return $this->redirectToRoute('tvdt_quiz_quiz_page', ['seasonCode' => $season->seasonCode, 'nameHash' => $nameHash]); return $this->redirectToRoute('tvdt_quiz_quiz_page', ['seasonCode' => $season->seasonCode, 'nameHash' => $nameHash]);
} }
if ($answer->question !== $this->questionRepository->findNextQuestionForCandidate($candidate)) {
$this->addFlash(FlashType::Danger, $this->translator->trans('You cannot answer this question'));
return $this->redirectToRoute('tvdt_quiz_quiz_page', ['seasonCode' => $season->seasonCode, 'nameHash' => $nameHash]);
}
$givenAnswer = new GivenAnswer($candidate, $answer->question->quiz, $answer); $givenAnswer = new GivenAnswer($candidate, $answer->question->quiz, $answer);
$this->entityManager->persist($givenAnswer); $this->entityManager->persist($givenAnswer);
$this->entityManager->flush(); $this->entityManager->flush();
+6
View File
@@ -12,6 +12,7 @@ use Tvdt\Entity\Candidate;
use Tvdt\Entity\Question; use Tvdt\Entity\Question;
use Tvdt\Entity\Quiz; use Tvdt\Entity\Quiz;
use Tvdt\Entity\Season; use Tvdt\Entity\Season;
use Tvdt\Entity\SeasonSettings;
final class KrtekFixtures extends Fixture implements FixtureGroupInterface final class KrtekFixtures extends Fixture implements FixtureGroupInterface
{ {
@@ -48,6 +49,11 @@ final class KrtekFixtures extends Fixture implements FixtureGroupInterface
$season->activeQuiz = $quiz1; $season->activeQuiz = $quiz1;
$season->addQuiz($this->createQuiz2($season)); $season->addQuiz($this->createQuiz2($season));
\assert($season->settings instanceof SeasonSettings);
$season->settings->confirmAnswers = true;
$season->settings->showNumbers = true;
$manager->flush(); $manager->flush();
$this->addReference(self::KRTEK_SEASON, $season); $this->addReference(self::KRTEK_SEASON, $season);
+6 -5
View File
@@ -7,15 +7,20 @@ namespace Tvdt\Entity;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\InputBag;
use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\Uuid;
use Tvdt\Repository\EliminationRepository; use Tvdt\Repository\EliminationRepository;
#[Gedmo\SoftDeleteable]
#[ORM\Entity(repositoryClass: EliminationRepository::class)] #[ORM\Entity(repositoryClass: EliminationRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Elimination class Elimination
{ {
use SoftDeleteableEntity;
use TimestampableEntity;
public const string SCREEN_GREEN = 'green'; public const string SCREEN_GREEN = 'green';
public const string SCREEN_RED = 'red'; public const string SCREEN_RED = 'red';
@@ -30,10 +35,6 @@ class Elimination
#[ORM\Column(type: Types::JSONB)] #[ORM\Column(type: Types::JSONB)]
public array $data = []; public array $data = [];
#[Gedmo\Timestampable(on: 'create')]
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE, nullable: false)]
public private(set) \DateTimeImmutable $created;
public function __construct( public function __construct(
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
#[ORM\ManyToOne(inversedBy: 'eliminations')] #[ORM\ManyToOne(inversedBy: 'eliminations')]
+4
View File
@@ -7,13 +7,17 @@ namespace Tvdt\Entity;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\Uuid;
use Tvdt\Repository\GivenAnswerRepository; use Tvdt\Repository\GivenAnswerRepository;
#[Gedmo\SoftDeleteable]
#[ORM\Entity(repositoryClass: GivenAnswerRepository::class)] #[ORM\Entity(repositoryClass: GivenAnswerRepository::class)]
class GivenAnswer class GivenAnswer
{ {
use SoftDeleteableEntity;
#[ORM\Column(type: UuidType::NAME, unique: true)] #[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')] #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\GeneratedValue(strategy: 'CUSTOM')]
+1 -1
View File
@@ -42,7 +42,7 @@ class Quiz
/** @var Collection<int, Elimination> */ /** @var Collection<int, Elimination> */
#[ORM\OneToMany(targetEntity: Elimination::class, mappedBy: 'quiz', cascade: ['persist'], orphanRemoval: true)] #[ORM\OneToMany(targetEntity: Elimination::class, mappedBy: 'quiz', cascade: ['persist'], orphanRemoval: true)]
#[ORM\OrderBy(['created' => 'DESC'])] #[ORM\OrderBy(['createdAt' => 'DESC'])]
public private(set) Collection $eliminations; public private(set) Collection $eliminations;
public function __construct() public function __construct()
+5 -1
View File
@@ -7,14 +7,18 @@ namespace Tvdt\Entity;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\Uuid;
use Tvdt\Repository\QuizCandidateRepository; use Tvdt\Repository\QuizCandidateRepository;
#[Gedmo\SoftDeleteable]
#[ORM\Entity(repositoryClass: QuizCandidateRepository::class)] #[ORM\Entity(repositoryClass: QuizCandidateRepository::class)]
#[ORM\UniqueConstraint(columns: ['candidate_id', 'quiz_id'])] #[ORM\UniqueConstraint(columns: ['candidate_id', 'quiz_id'], options: ['where' => '(deleted_at IS NULL)'])]
class QuizCandidate class QuizCandidate
{ {
use SoftDeleteableEntity;
#[ORM\Column(type: UuidType::NAME, unique: true)] #[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')] #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\GeneratedValue(strategy: 'CUSTOM')]
-7
View File
@@ -89,13 +89,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this->password; return $this->password;
} }
/** @see UserInterface */
public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function addSeason(Season $season): static public function addSeason(Season $season): static
{ {
if (!$this->seasons->contains($season)) { if (!$this->seasons->contains($season)) {
@@ -15,6 +15,7 @@
<div class="row"> <div class="row">
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<form method="post"> <form method="post">
<input type="hidden" name="_token" value="{{ csrf_token('prepare_elimination') }}">
{%~ for candidate, colour in elimination.data %} {%~ for candidate, colour in elimination.data %}
<div class="row mb-3"> <div class="row mb-3">
<label for="colour-{{ candidate|lower }}" class="col-4 col-form-label">{{ candidate }}</label> <label for="colour-{{ candidate|lower }}" class="col-4 col-form-label">{{ candidate }}</label>
@@ -35,14 +35,16 @@
{% endif %} {% endif %}
</td> </td>
<td> <td>
<a href="{{ path('tvdt_backoffice_toggle_candidate', {quiz: quiz.id, candidate: candidate.id}) }}" <form action="{{ path('tvdt_backoffice_toggle_candidate', {quiz: quiz.id, candidate: candidate.id}) }}" method="POST">
class="btn btn-sm btn-outline-secondary"> <input type="hidden" name="_token" value="{{ csrf_token('toggle_candidate') }}">
<button type="submit" class="btn btn-sm btn-outline-secondary">
{% if quizCandidate == null or quizCandidate.active %} {% if quizCandidate == null or quizCandidate.active %}
{{ 'Deactivate'|trans }} {{ 'Deactivate'|trans }}
{% else %} {% else %}
{{ 'Activate'|trans }} {{ 'Activate'|trans }}
{% endif %} {% endif %}
</a> </button>
</form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@@ -1,18 +1,26 @@
<div data-controller="bo--quiz"> <div data-controller="bo--quiz">
<h4 class="mb-3">Quick actions</h4> <h4 class="mb-3">{{ 'Quick actions'|trans }}</h4>
<div class="mb-3 btn-group"> <div class="mb-3 btn-group">
{% if quiz is same as (season.activeQuiz) %} {% if quiz is same as (season.activeQuiz) %}
<a class="btn btn-secondary" <form action="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: 'null'}) }}" method="POST">
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: 'null'}) }}">{{ 'Deactivate Quiz'|trans }}</a> <input type="hidden" name="_token" value="{{ csrf_token('enable_quiz') }}">
<button type="submit" class="btn btn-secondary rounded-0 rounded-start">
{{ 'Deactivate Quiz'|trans }}
</button>
</form>
{% else %} {% else %}
<a class="btn btn-primary" <form action="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: quiz.id}) }}" method="POST">
href="{{ path('tvdt_backoffice_enable', {seasonCode: season.seasonCode, quiz: quiz.id}) }}">{{ 'Make active'|trans }}</a> <input type="hidden" name="_token" value="{{ csrf_token('enable_quiz') }}">
<button type="submit" class="btn btn-primary rounded-0 rounded-start">
{{ 'Make active'|trans }}
</button>
</form>
{% endif %} {% endif %}
<button class="btn btn-danger" data-action="click->bo--quiz#clearQuiz"> <button class="btn btn-danger" data-action="click->bo--quiz#clearQuiz">
{{ 'Clear Quiz...'|trans }} {{ 'Clear Quiz...'|trans }}
</button> </button>
<button class="btn btn-danger" data-action="click->bo--quiz#deleteQuiz"> <button class="btn btn-danger rounded-0 rounded-end" data-action="click->bo--quiz#deleteQuiz">
{{ 'Delete Quiz...'|trans }} {{ 'Delete Quiz...'|trans }}
</button> </button>
</div> </div>
@@ -28,7 +36,8 @@
data-bs-target="#question-{{ loop.index0 }}" data-bs-target="#question-{{ loop.index0 }}"
aria-controls="question-{{ loop.index0 }}"> aria-controls="question-{{ loop.index0 }}">
{% set questionError = questionErrors[question.id.toString] ?? null %} {% set questionError = questionErrors[question.id.toString] ?? null %}
<span class="badge rounded-pill me-2{% if questionError %} text-bg-danger{% else %} invisible{% endif %}"{% if questionError %} data-bs-toggle="tooltip" title="{{ questionError }}"{% endif %}>!</span> <span
class="badge rounded-pill me-2{% if questionError %} text-bg-danger{% else %} invisible{% endif %}"{% if questionError %} data-bs-toggle="tooltip" title="{{ questionError }}"{% endif %}>!</span>
{{~ loop.index -}}. {{ question.question -}} {{~ loop.index -}}. {{ question.question -}}
</button> </button>
</h2> </h2>
@@ -73,8 +82,10 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
<a href="{{ path('tvdt_backoffice_quiz_clear', {quiz: quiz.id}) }}" <form action="{{ path('tvdt_backoffice_quiz_clear', {quiz: quiz.id}) }}" method="POST">
class="btn btn-danger">{{ 'Yes'|trans }}</a> <input type="hidden" name="_token" value="{{ csrf_token('clear_quiz') }}">
<button type="submit" class="btn btn-danger">{{ 'Yes'|trans }}</button>
</form>
</div> </div>
</div> </div>
</div> </div>
@@ -96,8 +107,10 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'No'|trans }}</button>
<a href="{{ path('tvdt_backoffice_quiz_delete', {quiz: quiz.id}) }}" <form action="{{ path('tvdt_backoffice_quiz_delete', {quiz: quiz.id}) }}" method="POST">
class="btn btn-danger">{{ 'Yes'|trans }}</a> <input type="hidden" name="_token" value="{{ csrf_token('delete_quiz') }}">
<button type="submit" class="btn btn-danger">{{ 'Yes'|trans }}</button>
</form>
</div> </div>
</div> </div>
</div> </div>
+13 -10
View File
@@ -1,24 +1,26 @@
<h4 class="mb-3">{{ 'Score'|trans }}</h4> <h4 class="mb-3">{{ 'Score'|trans }}</h4>
<div class="btn-toolbar mb-3" role="toolbar"> <div class="btn-toolbar mb-3" role="toolbar">
<div class="btn-group me-2"> <div class="btn-group me-2">
{# <a class="btn btn-primary">{{ 'Start Elimination'|trans }}</a> #} {# <a class="btn btn-primary">{{ 'Start Elimination'|trans }}</a> #}
<a href="{{ path('tvdt_prepare_elimination', {seasonCode: season.seasonCode, quiz: quiz.id}) }}" <form action="{{ path('tvdt_prepare_elimination', {seasonCode: season.seasonCode, quiz: quiz.id}) }}" method="POST">
class="btn btn-secondary">{{ 'Prepare Custom Elimination'|trans }}</a> <input type="hidden" name="_token" value="{{ csrf_token('prepare_elimination') }}">
<button type="submit" class="btn btn-secondary rounded-0 rounded-start">{{ 'Prepare Custom Elimination'|trans }}</button>
</form>
{%~ if not quiz.eliminations.empty %} {%~ if not quiz.eliminations.empty %}
<button class="btn btn-secondary dropdown-toggle" <button class="btn btn-secondary dropdown-toggle"
data-bs-toggle="dropdown">{{ 'Load Prepared Elimination'|trans }}</button> data-bs-toggle="dropdown">{{ 'Load Prepared Elimination'|trans }}</button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{%~ for elimination in quiz.eliminations %} {%~ for elimination in quiz.eliminations %}
<li><a class="dropdown-item" <li><a class="dropdown-item"
href="{{ path('tvdt_prepare_elimination_view', {elimination: elimination.id}) }}">{{ elimination.created|format_datetime() }}</a> href="{{ path('tvdt_prepare_elimination_view', {elimination: elimination.id}) }}">{{ elimination.createdAt|format_datetime() }}</a>
</li> </li>
{%~ endfor %} {%~ endfor %}
</ul> </ul>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<p class="mb-3">{{ 'Number of dropouts:'|trans }} {{ quiz.dropouts }} </p> <p class="mb-3">{{ 'Number of dropouts:'|trans }} {{ quiz.dropouts }} </p>
<table class="table table-hover mb-3"> <table class="table table-hover mb-3">
<thead> <thead>
<tr> <tr>
<th scope="col">{{ 'Candidate'|trans }}</th> <th scope="col">{{ 'Candidate'|trans }}</th>
@@ -37,6 +39,7 @@
<td> <td>
<form method="post" <form method="post"
action="{{ path('tvdt_backoffice_modify_correction', {quiz: quiz.id, candidate: candidate.id}) }}"> action="{{ path('tvdt_backoffice_modify_correction', {quiz: quiz.id, candidate: candidate.id}) }}">
<input type="hidden" name="_token" value="{{ csrf_token('candidate_correction') }}">
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<input class="form-control form-control-sm" type="number" <input class="form-control form-control-sm" type="number"
@@ -52,7 +55,7 @@
<td> <td>
<form method="post" <form method="post"
action="{{ path('tvdt_backoffice_modify_penalty', {quiz: quiz.id, candidate: candidate.id}) }}"> action="{{ path('tvdt_backoffice_modify_penalty', {quiz: quiz.id, candidate: candidate.id}) }}">
<input type="hidden" name="_token" value="{{ csrf_token('candidate_answer') }}"> <input type="hidden" name="_token" value="{{ csrf_token('candidate_penalty') }}">
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<input class="form-control form-control-sm" type="number" <input class="form-control form-control-sm" type="number"
@@ -70,8 +73,8 @@
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
<td colspan="5">{{ 'No results'|trans }}</td> <td colspan="6">{{ 'No results'|trans }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
+1 -1
View File
@@ -13,7 +13,7 @@
{% block body %} {% block body %}
<div class="row"> <div class="row">
<div class="col-md-6 col-12"> <div class="col-md-6 col-12">
<h2 class="mb-3">{{ t('Add a quiz to %name%', {'%name%': season.name})|trans }} </h2> <h2 class="mb-3">{{ t('Add a quiz to {name}', {name: season.name})|trans }} </h2>
{{ form_start(form) }} {{ form_start(form) }}
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.sheet) }} {{ form_row(form.sheet) }}
+1 -1
View File
@@ -4,7 +4,7 @@
{% for label, messages in flashes %} {% for label, messages in flashes %}
{% for message in messages %} {% for message in messages %}
<div class="alert alert-{{ label }} alert-dismissible " role="alert"> <div class="alert alert-{{ label }} alert-dismissible " role="alert">
{{ message }} {{ message|trans }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div> </div>
{% endfor %} {% endfor %}
+17 -9
View File
@@ -37,9 +37,9 @@
<source>Add Quiz</source> <source>Add Quiz</source>
<target>Test toevoegen</target> <target>Test toevoegen</target>
</trans-unit> </trans-unit>
<trans-unit id="ehB6pAw" resname="Add a quiz to %name%"> <trans-unit id="apgpM9w" resname="Add a quiz to {name}">
<source>Add a quiz to %name%</source> <source>Add a quiz to {name}</source>
<target>Voeg een test toe aan %name%</target> <target>Voeg een test toe aan {name}</target>
</trans-unit> </trans-unit>
<trans-unit id="qiXD5ve" resname="All Seasons"> <trans-unit id="qiXD5ve" resname="All Seasons">
<source>All Seasons</source> <source>All Seasons</source>
@@ -109,13 +109,13 @@
<source>Corrections</source> <source>Corrections</source>
<target>Jokers</target> <target>Jokers</target>
</trans-unit> </trans-unit>
<trans-unit id="Lu7u8U2" resname="Cound not find candidate with name %name%"> <trans-unit id="9JHLsoe" resname="Could not find candidate with name {name}">
<source>Cound not find candidate with name %name%</source> <source>Could not find candidate with name {name}</source>
<target>Kon kandidaat met naam %name% niet vinden</target> <target>Kon kandidaat met naam {name} niet vinden</target>
</trans-unit> </trans-unit>
<trans-unit id="YQUiB4T" resname="Cound not find candidate with name %name% in elimination."> <trans-unit id="h589jDz" resname="Could not find candidate with name {name} in elimination.">
<source>Cound not find candidate with name %name% in elimination.</source> <source>Could not find candidate with name {name} in elimination.</source>
<target>Kon geen kandidaat vinden met de naam %name% in de eliminatie</target> <target>Kon geen kandidaat vinden met de naam {name} in de eliminatie</target>
</trans-unit> </trans-unit>
<trans-unit id="0DvmToq" resname="Create a season"> <trans-unit id="0DvmToq" resname="Create a season">
<source>Create a season</source> <source>Create a season</source>
@@ -301,6 +301,10 @@
<source>Questions</source> <source>Questions</source>
<target>Vragen</target> <target>Vragen</target>
</trans-unit> </trans-unit>
<trans-unit id="1jiUI_8" resname="Quick actions">
<source>Quick actions</source>
<target>Snelle acties</target>
</trans-unit>
<trans-unit id="0tv0gq." resname="Quiz"> <trans-unit id="0tv0gq." resname="Quiz">
<source>Quiz</source> <source>Quiz</source>
<target>Test</target> <target>Test</target>
@@ -429,6 +433,10 @@
<source>You are not allowed to answer this quiz</source> <source>You are not allowed to answer this quiz</source>
<target>Je mag deze test niet beantwoorden</target> <target>Je mag deze test niet beantwoorden</target>
</trans-unit> </trans-unit>
<trans-unit id="78moQnF" resname="You cannot answer this question">
<source>You cannot answer this question</source>
<target>Je kan deze vraag niet beantwoorden</target>
</trans-unit>
<trans-unit id="0afY1NF" resname="You have no seasons yet."> <trans-unit id="0afY1NF" resname="You have no seasons yet.">
<source>You have no seasons yet.</source> <source>You have no seasons yet.</source>
<target>Je hebt nog geen seizoenen.</target> <target>Je hebt nog geen seizoenen.</target>