Skip to content

Commit 7c7082f

Browse files
Merge pull request #39 from itk-dev/feature/5267-in-platform-documentation
5267: In-platform documentation
2 parents f007966 + fe95cad commit 7c7082f

31 files changed

+905
-130
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.env.*.local
55
/config/secrets/prod/prod.decrypt.private.php
66
/public/bundles/
7+
/public/uploads/qr-logos/
78
/var/
89
/vendor/
910
###< symfony/framework-bundle ###

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ See [keep a changelog] for information about writing changes to this log.
88

99
## [Unreleased]
1010

11+
[PR-41](https://github.com/itk-dev/itqr/pull/41)
12+
- Added archived concept
13+
[PR-40](https://github.com/itk-dev/itqr/pull/40)
14+
- Added styling to static page.
15+
[PR-39](https://github.com/itk-dev/itqr/pull/39)
16+
- Added various help texts and in-platform-documentation.
1117
[PR-38](https://github.com/itk-dev/itqr/pull/38)
1218
- Limit number of URLs to 1
1319
- Increase URL data type from varchar to text

assets/styles/archived.css

Lines changed: 162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/styles/static.css

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
:root {
2+
--spacer-md: 1rem;
3+
--spacer-lg: calc(var(--spacer-md) * 2);
4+
--shadow-color: 240deg 27% 62%;
5+
--shadow-elevation-low:
6+
0.3px 0.3px 0.4px hsl(var(--shadow-color) / 0.34),
7+
0.4px 0.4px 0.6px -1.7px hsl(var(--shadow-color) / 0.28),
8+
0.9px 1px 1.3px -3.5px hsl(var(--shadow-color) / 0.21);
9+
--shadow-elevation-medium:
10+
0.3px 0.3px 0.4px hsl(var(--shadow-color) / 0.29),
11+
0.5px 0.6px 0.8px -0.9px hsl(var(--shadow-color) / 0.25),
12+
1px 1.2px 1.5px -1.7px hsl(var(--shadow-color) / 0.22),
13+
2.2px 2.6px 3.3px -2.6px hsl(var(--shadow-color) / 0.19),
14+
4.5px 5.2px 6.7px -3.5px hsl(var(--shadow-color) / 0.16);
15+
--shadow-elevation-high:
16+
0.3px 0.3px 0.4px hsl(var(--shadow-color) / 0.27),
17+
0.7px 0.8px 1px -0.4px hsl(var(--shadow-color) / 0.25),
18+
1.2px 1.4px 1.8px -0.8px hsl(var(--shadow-color) / 0.24),
19+
1.9px 2.2px 2.8px -1.2px hsl(var(--shadow-color) / 0.22),
20+
2.9px 3.4px 4.4px -1.6px hsl(var(--shadow-color) / 0.21),
21+
4.5px 5.2px 6.7px -1.9px hsl(var(--shadow-color) / 0.19),
22+
6.7px 7.8px 10px -2.3px hsl(var(--shadow-color) / 0.18),
23+
9.7px 11.3px 14.5px -2.7px hsl(var(--shadow-color) / 0.16),
24+
13.6px 16px 20.5px -3.1px hsl(var(--shadow-color) / 0.14),
25+
18.7px 21.9px 28.1px -3.5px hsl(var(--shadow-color) / 0.13);
26+
}
27+
*, *::before, *::after {
28+
box-sizing: border-box;
29+
}
30+
31+
* {
32+
margin: 0;
33+
}
34+
35+
@media (prefers-reduced-motion: no-preference) {
36+
html {
37+
interpolate-size: allow-keywords;
38+
}
39+
}
40+
41+
body {
42+
line-height: 1.5;
43+
-webkit-font-smoothing: antialiased;
44+
font-family: 'Roboto', sans-serif;
45+
background-color: ghostwhite;
46+
}
47+
48+
img, picture, video, canvas, svg {
49+
display: block;
50+
max-width: 100%;
51+
}
52+
53+
input, button, textarea, select {
54+
font: inherit;
55+
}
56+
57+
p, h1, h2, h3, h4, h5, h6 {
58+
overflow-wrap: break-word;
59+
}
60+
61+
p {
62+
text-wrap: pretty;
63+
}
64+
65+
h1, h2, h3, h4, h5, h6 {
66+
text-wrap: balance;
67+
}
68+
69+
#root, #__next {
70+
isolation: isolate;
71+
}
72+
73+
.container {
74+
background-color: #fff;
75+
display: flex;
76+
flex-direction: column;
77+
min-height: 100vh;
78+
max-width: 800px;
79+
margin: 0 auto;
80+
padding: 0 var(--spacer-md);
81+
> h1 {
82+
font-size: clamp(1.75rem, 4.5vw, 3rem);
83+
margin: var(--spacer-md) 0;
84+
}
85+
86+
> p {
87+
88+
}
89+
}
90+
91+
@media screen and (min-width: 800px) {
92+
.container {
93+
padding: 0 var(--spacer-lg);
94+
}
95+
}

config/packages/security.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ security:
1313
dev:
1414
pattern: ^/(_(profiler|wdt)|css|images|js)/
1515
security: false
16+
api:
17+
pattern: ^/api
18+
stateless: true
1619
main:
1720
custom_authenticators:
1821
- App\Security\AzureOIDCAuthenticator

config/routes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ root_redirect:
77
path: /
88
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController
99
defaults:
10-
route: 'qr_index'
10+
route: 'admin'
1111
permanent: true

migrations/Version20250826113021.php renamed to migrations/Version20250905124617.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20250826113021 extends AbstractMigration
13+
final class Version20250905124617 extends AbstractMigration
1414
{
1515
public function getDescription(): string
1616
{
@@ -20,12 +20,14 @@ public function getDescription(): string
2020
public function up(Schema $schema): void
2121
{
2222
// this up() migration is auto-generated, please modify it to your needs
23+
$this->addSql('ALTER TABLE qr ADD alternative_url VARCHAR(255) DEFAULT NULL, ADD status VARCHAR(255) NOT NULL');
2324
$this->addSql('ALTER TABLE url CHANGE url url TEXT NOT NULL');
2425
}
2526

2627
public function down(Schema $schema): void
2728
{
2829
// this down() migration is auto-generated, please modify it to your needs
2930
$this->addSql('ALTER TABLE url CHANGE url url VARCHAR(255) NOT NULL');
31+
$this->addSql('ALTER TABLE qr DROP alternative_url, DROP status');
3032
}
3133
}

public/img/qrcode-archived.png

99.6 KB
Loading

src/Controller/Admin/BatchDownloadController.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
use App\Form\Type\BatchDownloadType;
66
use App\Helper\DownloadHelper;
77
use App\Repository\QrRepository;
8+
use GuzzleHttp\Utils;
9+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
810
use Symfony\Component\HttpFoundation\RequestStack;
911
use Symfony\Component\HttpFoundation\Response;
1012
use Symfony\Component\Routing\Attribute\Route;
1113

12-
final class BatchDownloadController extends DashboardController
14+
final class BatchDownloadController extends AbstractController
1315
{
1416
public function __construct(
1517
private readonly RequestStack $requestStack,
@@ -22,18 +24,24 @@ public function __construct(
2224
* @throws \Endroid\QrCode\Exception\ValidationException
2325
*/
2426
#[Route('/admin/batch/download', name: 'admin_batch_download')]
25-
public function index(): Response
27+
public function batchDownload(string|array $selectedEntityIds): Response
2628
{
29+
/*
30+
If this method is called from the crud context menu and only regards a single item,
31+
selectedEntityIds is a string. Convert to array to compatibilize.
32+
*/
33+
if (!is_array($selectedEntityIds)) {
34+
$selectedEntityIds = [$selectedEntityIds];
35+
}
2736
$form = $this->createForm(BatchDownloadType::class);
28-
2937
$request = $this->requestStack->getCurrentRequest();
3038

3139
$form->handleRequest($request);
3240

3341
if ($form->isSubmitted() && $form->isValid()) {
3442
$data = $form->getData();
3543

36-
$qrEntities = $this->qrRepository->findBy(['id' => $request->query->all()]);
44+
$qrEntities = $this->qrRepository->findBy(['id' => $selectedEntityIds]);
3745

3846
if (!$qrEntities) {
3947
throw $this->createNotFoundException('No QR codes found');
@@ -44,8 +52,8 @@ public function index(): Response
4452

4553
return $this->render('form/batchDownload.html.twig', [
4654
'form' => $form,
47-
'selectedQrCodes' => json_encode($request->query->all()),
48-
'count' => count($request->query->all()),
55+
'selectedQrCodes' => Utils::jsonEncode($selectedEntityIds),
56+
'count' => count($selectedEntityIds),
4957
]);
5058
}
5159
}

0 commit comments

Comments
 (0)