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.
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
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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)), |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
dtto src/Event/Event.php
| public function getFunctions() :array | ||
| { | ||
| return [ | ||
| new TwigFunction('eventLogo', [Event::class, 'getFullLogoUrl']), | ||
| ]; | ||
| } | ||
|
|
There was a problem hiding this comment.
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 }}"> |
There was a problem hiding this comment.
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 }}"> |
There was a problem hiding this comment.
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 }}"> |
There was a problem hiding this comment.
dtto src/Settings/TwigExtension.php
08f97f2 to
abbce93
Compare
018e2ee to
bac2b63
Compare
16ee02a to
8d5f87d
Compare
9c3ace6 to
921ae07
Compare
b53d9fc to
3d7ad63
Compare
c85d9fb to
f64c6a6
Compare
f64c6a6 to
e03037e
Compare
4d948a5 to
6c3709c
Compare
b6c3333 to
3c8df25
Compare
No description provided.