-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move assets into separate file #301
base: staging
Are you sure you want to change the base?
Conversation
moved font and color css handling to new theme css file;
also handle null logo urls from twig.
public static function getFullLogoUrl(?string $logoUrl): string | ||
{ | ||
if ($logoUrl === null) { return "";} | ||
return "/assets" . $logoUrl; |
There was a problem hiding this comment.
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
@@ -232,7 +232,7 @@ public function showIban(): bool | |||
|
|||
public function getSkautLogoPath(Participant $participant): string | |||
{ | |||
return '/SKAUT_horizontalni_logo_250.png'; | |||
return '/assets/SKAUT_horizontalni_logo_250.png'; |
There was a problem hiding this comment.
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
@@ -224,7 +225,7 @@ private function sendMailFromTemplate( | |||
$email->htmlTemplate('emails/' . $templateName . '.twig'); | |||
$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)), |
There was a problem hiding this comment.
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
|
||
<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"> |
There was a problem hiding this comment.
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
public function getFunctions() :array | ||
{ | ||
return [ | ||
new TwigFunction('eventLogo', [Event::class, 'getFullLogoUrl']), | ||
]; | ||
} | ||
|
There was a problem hiding this comment.
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
<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 }}"> |
There was a problem hiding this comment.
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
@@ -67,7 +67,7 @@ | |||
<footer> | |||
{% 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 }}"> |
There was a problem hiding this comment.
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
@@ -81,7 +81,7 @@ | |||
<footer> | |||
{% 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 }}"> |
There was a problem hiding this comment.
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
No description provided.