Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@

/CLAUDE.md
/config/reference.php
.claude/
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo

## [Unreleased]

- [PR-53](https://github.com/itk-dev/aapodwalk_api/pull/53)
Update guidelines for attaching media to POIs

## [1.0.2] - 2026-05-21

- [PR-54](https://github.com/itk-dev/aapodwalk_api/pull/54)
Expand All @@ -20,6 +23,8 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo

## [1.0.1] - 2025-23-06

- [PR-42](https://github.com/itk-dev/aapodwalk_api/pull/42)
Upgraded Symfony from 7.2 to 7.4 LTS
- [PR-41](https://github.com/itk-dev/aapodwalk_api/pull/41)
Security Updates

Expand Down Expand Up @@ -82,7 +87,3 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo
- Added order param to PointOfInterest.
- Added centerlatitude, centerlongitude, zoom, partcount and totalduration to route.
- Add proximity to point of interest, that allows for setting an unlockable distance in meters.

[Unreleased]: https://github.com/itk-dev/aapodwalk_api/compare/1.0.2...HEAD
[1.0.2]: https://github.com/itk-dev/aapodwalk_api/compare/1.0.0...1.0.2
[1.0.0]: https://github.com/itk-dev/aapodwalk_api/releases/tag/1.0.0
40 changes: 31 additions & 9 deletions assets/styles/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,43 @@
}

/* Show label and inputs above eachother instead for inline when in collection */
.form-group.field-collection.accordion {
.accordion-item {
.form-group {
display: block;
.form-group.field-collection {
.accordion-item .accordion-body .form-group {
display: block;

> label {
margin: 0;
padding: 0 0 8px;
inline-size: initial;
}
> label {
margin: 0;
padding: 0 0 8px;
inline-size: initial;
}
}
.accordion-button {
padding: 8px 7px;
}

/* Keep the move/delete buttons inline with the accordion headline */
.accordion-header {
display: flex;
align-items: center;
padding-inline-end: 0;

.accordion-button {
flex: 1 1 auto;
width: auto;
}

.accordion-actions {
display: flex;
align-items: center;
flex-shrink: 0;
gap: 4px;
padding-inline-end: 8px;
}

.field-collection-delete-button {
position: static;
}
}
}

.ea-index {
Expand Down
37 changes: 9 additions & 28 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,19 @@ parameters:
media_processor.options:
# Template are processed in the defined order; the first one with a matching pattern will be used.
templates:
- name: 'Videotool (audio)'
- name: 'MP3 audio'
help:
en: |
Insert "direkte link til playeren", e.g. <code>https://media.videotool.dk/?vn=467_2024120710215424183468967435</code>
Use the "Kopier download link til lydfil i MP3" button from the Videotool admin (under "Del download links") to copy a direct MP3 download link, then paste it here.
<img src="/images/videotool-mp3-download-link.png" alt="Videotool: Del download links — Kopier download link til lydfil i MP3" style="display: block; max-width: 600px; width: 100%%; height: auto; margin-top: .5rem; border: 1px solid var(--bs-border-color, #ccc); border-radius: 4px;">
da: |
Indsæt "direkte link til playeren", fx https://media.videotool.dk/?vn=467_2024120710215424183468967435
pattern: "~^https://media.videotool.dk/?\\?vn=(?P<id>[^&#]+)&is_audio=1$~"
Brug knappen "Kopier download link til lydfil i MP3" i Videotool-administrationen (under "Del download links") til at kopiere et direkte MP3-downloadlink, og indsæt det her.
<img src="/images/videotool-mp3-download-link.png" alt="Videotool: Del download links — Kopier download link til lydfil i MP3" style="display: block; max-width: 600px; width: 100%%; height: auto; margin-top: .5rem; border: 1px solid var(--bs-border-color, #ccc); border-radius: 4px;">
pattern: '~^https?://~i'
template: >-
<div style="position: relative; padding-bottom: 26.25%%; height: 0;">
<iframe aria-label="{{ title }}"
type="text/html"
style="position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important;"
src="{{ url }}&ao=1"
frameborder="0"
allowfullscreen
allow="autoplay; fullscreen"></iframe>
</div>

- name: 'Videotool (video)'
help: |
Indsæt "direkte link til playeren", fx https://media.videotool.dk/?vn=467_2024120710155950260322839288
pattern: "~^https://media.videotool.dk/?\\?vn=(?P<id>[^&#]+)$~"
template: >-
<div style="position: relative; padding-bottom: 56.25%%; height: 0;">
<iframe aria-label="{{ title }}"
type="text/html"
style="position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important;"
src="{{ url }}"
frameborder="0"
allowfullscreen
allow="autoplay; fullscreen"></iframe>
</div>
<audio controls preload="none" style="width: 100%%;" src="{{ url }}" aria-label="{{ title }}">
{{ url }}
</audio>

services:
# default configuration for services in *this* file
Expand Down
Binary file added public/images/videotool-mp3-download-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions src/Controller/Admin/PointOfInterestCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use App\Service\EasyAdminHelper;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
Expand Down Expand Up @@ -42,11 +41,13 @@ public function configureCrud(Crud $crud): Crud
public function configureFields(string $pageName): iterable
{
$route = AssociationField::new('route', new TranslatableMessage('Route', [], 'admin'))
->setRequired(true);
->setRequired(true)
->setColumns(12);

$position = NumberField::new('poiOrder', new TranslatableMessage('Order', [], 'admin'))
->addCssClass('route-point-position')
->setRequired(false);
->setRequired(false)
->setColumns(12);

// Check if this controller is being used in a collection.
if ($this->getContext()?->getEntity()?->getInstance() instanceof Route) {
Expand Down Expand Up @@ -80,14 +81,10 @@ public function configureFields(string $pageName): iterable

$mediaUrlLabel = new TranslatableMessage('Media URL', [], 'admin');
yield UrlField::new('mediaUrl', $mediaUrlLabel)
->setHelp(new TranslatableMessage('Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).', [], 'admin'))
->setFormTypeOptions([
'block_name' => 'mediaUrl',
])->setColumns(12);
yield BooleanField::new('mediaIsAudio', new TranslatableMessage('Is audio?', [], 'admin'))
->setHelp(new TranslatableMessage('Check if "{media_url}" points to an audio file.', [
'media_url' => $mediaUrlLabel,
], 'admin'))
->renderAsSwitch(false)->setColumns(12);

yield TextareaField::new('subtitles', new TranslatableMessage('Subtitles', [], 'admin'))
->setRequired(true)
Expand Down
10 changes: 3 additions & 7 deletions translations/admin+intl-icu.da.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@
<source>Media URL</source>
<target state="translated">Medie-url</target>
</trans-unit>
<trans-unit id="E.HTA7V" resname="Is audio?">
<source>Is audio?</source>
<target state="translated">Er lyd?</target>
</trans-unit>
<trans-unit id="ptuJUXQ" resname="Media preview">
<source>Media preview</source>
<target state="translated">Forhåndsvisning</target>
Expand All @@ -253,9 +249,9 @@
<source>Information on media URLs</source>
<target state="translated">Information om medie-url’er</target>
</trans-unit>
<trans-unit id="CPIQaaz" resname="Check if &quot;{media_url}&quot; points to an audio file.">
<source>Check if "{media_url}" points to an audio file.</source>
<target state="translated">Marker hvis "{media_url}" peger på en lydfil.</target>
<trans-unit id="RyyZOc." resname="Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).">
<source>Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).</source>
<target state="translated">Indsæt et direkte mp3-downloadlink til lydfilen (ikke et Videotool iframe/afspiller-link).</target>
</trans-unit>
<trans-unit id="s3PJeIL" resname="Add new point">
<source>Add new point</source>
Expand Down
10 changes: 3 additions & 7 deletions translations/admin+intl-icu.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@
<source>Media URL</source>
<target>Media URL</target>
</trans-unit>
<trans-unit id="E.HTA7V" resname="Is audio?">
<source>Is audio?</source>
<target>Is audio?</target>
</trans-unit>
<trans-unit id="ptuJUXQ" resname="Media preview">
<source>Media preview</source>
<target>Media preview</target>
Expand All @@ -253,9 +249,9 @@
<source>Information on media URLs</source>
<target>Information on media URLs</target>
</trans-unit>
<trans-unit id="CPIQaaz" resname="Check if &quot;{media_url}&quot; points to an audio file.">
<source>Check if "{media_url}" points to an audio file.</source>
<target>Check if "{media_url}" points to an audio file.</target>
<trans-unit id="RyyZOc." resname="Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).">
<source>Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).</source>
<target>Insert a direct mp3 download link to the audio file (not a Videotool iframe/player link).</target>
</trans-unit>
<trans-unit id="s3PJeIL" resname="Add new point">
<source>Add new point</source>
Expand Down