Skip to content

Move assets into separate file#301

Open
tomtomklima wants to merge 5 commits intostagingfrom
moveAssets
Open

Move assets into separate file#301
tomtomklima wants to merge 5 commits intostagingfrom
moveAssets

Conversation

@tomtomklima
Copy link
Contributor

No description provided.

public static function getFullLogoUrl(?string $logoUrl): string
{
if ($logoUrl === null) { return "";}
return "/assets" . $logoUrl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Takto natvrdo vypálená adresa do kódu není dobře - když to budeme chtít přesunout, tak budeme muset změnit kód, což je špatně. Lepší by bylo toto zanést do infra, aby webserver hledal v této složce automaticky a kód appky to vůbec nemusel vědět

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promiň, ale vůbec tedy nevím jak bych to měl já udělat

public function getSkautLogoPath(Participant $participant): string
{
return '/SKAUT_horizontalni_logo_250.png';
return '/assets/SKAUT_horizontalni_logo_250.png';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto v src/Event/Event.php

$email->context(array_merge($parameters, [
'fullRegistrationLink' => $this->settings->getFullUrlLink(),
'eventImageExists' => is_file(__DIR__ . '/../../public/' . $event->logoUrl),
'eventImageExists' => is_file(__DIR__ . '/../../public/' . Event::getFullLogoUrl($event->logoUrl)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Není potřeba volat staticky, když máme k dispozici už konkrétní objekt, kde to je

</title>

<link rel="shortcut icon" href="/favicon-16x16.png" type="image/x-icon">
<link rel="shortcut icon" href="../../../public/assets/favicon-16x16.png" type="image/x-icon">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto src/Event/Event.php

Comment on lines +23 to +29
public function getFunctions() :array
{
return [
new TwigFunction('eventLogo', [Event::class, 'getFullLogoUrl']),
];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

není potřeba, když se nebude volat staticky

{% if event is not null %}
<a href="{{ event.webUrl }}" class="footer-item" target="_blank">
<img class="footer-logo" src="{{ event.logoUrl }}" alt="logo of {{ event.readableName }}">
<img class="footer-logo" src="{{ eventLogo(event.logoUrl) }}" alt="logo of {{ event.readableName }}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto src/Settings/TwigExtension.php

{% if eventImageExists %}
<a href="{{ event.webUrl }}" class="footer-item" target="_blank">
<img class="footer-logo" src="{{ email.image( event.logoUrl ) }}" alt="logo of {{ event.readableName }}">
<img class="footer-logo" src="{{ email.image(eventLogo(event.logoUrl)) }}" alt="logo of {{ event.readableName }}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto src/Settings/TwigExtension.php

{% if eventImageExists %}
<a href="{{ event.webUrl }}" class="footer-item" target="_blank">
<img class="footer-logo" src="{{ email.image( event.logoUrl ) }}" alt="logo of {{ event.readableName }}">
<img class="footer-logo" src="{{ email.image(eventLogo(event.logoUrl)) }}" alt="logo of {{ event.readableName }}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto src/Settings/TwigExtension.php

@tomtomklima tomtomklima force-pushed the staging branch 2 times, most recently from 08f97f2 to abbce93 Compare February 26, 2025 21:31
@paaton paaton force-pushed the staging branch 2 times, most recently from 018e2ee to bac2b63 Compare May 4, 2025 16:28
@tomtomklima tomtomklima force-pushed the staging branch 2 times, most recently from 16ee02a to 8d5f87d Compare May 5, 2025 21:13
@paaton paaton force-pushed the staging branch 2 times, most recently from 9c3ace6 to 921ae07 Compare July 19, 2025 23:20
@tomtomklima tomtomklima force-pushed the staging branch 2 times, most recently from b53d9fc to 3d7ad63 Compare August 9, 2025 16:01
@vojtechmares vojtechmares removed their request for review October 28, 2025 18:12
@tomtomklima tomtomklima force-pushed the staging branch 2 times, most recently from 4d948a5 to 6c3709c Compare November 2, 2025 11:28
@tomtomklima tomtomklima force-pushed the staging branch 2 times, most recently from b6c3333 to 3c8df25 Compare December 8, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants