diff --git a/public/SKAUT_horizontalni_logo_250.png b/public/assets/SKAUT_horizontalni_logo_250.png similarity index 100% rename from public/SKAUT_horizontalni_logo_250.png rename to public/assets/SKAUT_horizontalni_logo_250.png diff --git a/public/ZNAK_EN_Scouting_Slovakia_500.png b/public/assets/ZNAK_EN_Scouting_Slovakia_500.png similarity index 100% rename from public/ZNAK_EN_Scouting_Slovakia_500.png rename to public/assets/ZNAK_EN_Scouting_Slovakia_500.png diff --git a/public/favicon-16x16.png b/public/assets/favicon-16x16.png similarity index 100% rename from public/favicon-16x16.png rename to public/assets/favicon-16x16.png diff --git a/public/logo_aqua23_168.png b/public/assets/logo_aqua23_168.png similarity index 100% rename from public/logo_aqua23_168.png rename to public/assets/logo_aqua23_168.png diff --git a/public/logo_aqua_zelene_168.png b/public/assets/logo_aqua_zelene_168.png similarity index 100% rename from public/logo_aqua_zelene_168.png rename to public/assets/logo_aqua_zelene_168.png diff --git a/public/logo_cej22_200.png b/public/assets/logo_cej22_200.png similarity index 100% rename from public/logo_cej22_200.png rename to public/assets/logo_cej22_200.png diff --git a/public/logo_cej24_color_160.png b/public/assets/logo_cej24_color_160.png similarity index 100% rename from public/logo_cej24_color_160.png rename to public/assets/logo_cej24_color_160.png diff --git a/public/logo_korbo_89.png b/public/assets/logo_korbo_89.png similarity index 100% rename from public/logo_korbo_89.png rename to public/assets/logo_korbo_89.png diff --git a/public/logo_navigamus21_cerna_200.png b/public/assets/logo_navigamus21_cerna_200.png similarity index 100% rename from public/logo_navigamus21_cerna_200.png rename to public/assets/logo_navigamus21_cerna_200.png diff --git a/public/logo_navigamus21_modra_200.png b/public/assets/logo_navigamus21_modra_200.png similarity index 100% rename from public/logo_navigamus21_modra_200.png rename to public/assets/logo_navigamus21_modra_200.png diff --git a/public/logo_obrok23_200.png b/public/assets/logo_obrok23_200.png similarity index 100% rename from public/logo_obrok23_200.png rename to public/assets/logo_obrok23_200.png diff --git a/public/logo_obrok24.png b/public/assets/logo_obrok24.png similarity index 100% rename from public/logo_obrok24.png rename to public/assets/logo_obrok24.png diff --git a/public/logo_wsj23_220.png b/public/assets/logo_wsj23_220.png similarity index 100% rename from public/logo_wsj23_220.png rename to public/assets/logo_wsj23_220.png diff --git a/public/styles.css b/public/styles.css index 129e2ab1..ee7f1c6e 100755 --- a/public/styles.css +++ b/public/styles.css @@ -1,103 +1,3 @@ -@font-face { - font-family: 'themix'; - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.eot'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.eot? #iefix') format('embedded-opentype'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.woff') format('woff'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400.woff2') format('woff2'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400.otf') format('opentype'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400.svg#themix') format('svg'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'themix'; - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.eot'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.eot? #iefix') format('embedded-opentype'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.woff') format('woff'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.woff2') format('woff2'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.otf') format('opentype'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.svg#themix') format('svg'); - font-weight: 400; - font-style: italic; -} - -@font-face { - font-family: 'themix'; - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.eot'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.eot? #iefix') format('embedded-opentype'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.woff') format('woff'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700.woff2') format('woff2'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700.otf') format('opentype'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700.svg#themix') format('svg'); - font-weight: 700; - font-style: normal; -} - -@font-face { - font-family: 'themix'; - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.eot'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.eot? #iefix') format('embedded-opentype'); - src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.woff') format('woff'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.woff2') format('woff2'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.otf') format('opentype'), - url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.svg#themix') format('svg'); - font-weight: 700; - font-style: italic; -} - -@font-face { - font-family: 'skautbold'; - src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.eot'); - src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.eot? #iefix') format('embedded-opentype'); - src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.woff') format('woff'), - url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.otf') format('opentype'), - url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.svg#skautbold') format('svg'); - font-weight: normal; - font-style: normal; -} - -:root { - background: var(--color-background); - --border-radius: 6px; - font-family: 'themix', sans-serif; - box-sizing: border-box; - color: var(--color-main); - color-scheme: light dark; - accent-color: var(--color-main); -} - -@media (prefers-color-scheme: light) { - :root { - --color-background: #e6ebed; - --color-card-background: #f9f9f9; - --color-input-background: #ffffff; - --color-main: #0D71B9; - --color-accent: #b9550d; - --color-fading: #a6d9ff; - --color-light: #3ba5f1; - --color-dark: #06375a; - --color-grey: #636363; - --color-link: #0000ee; - --color-link-visited: #551a8b; - } -} - -@media (prefers-color-scheme: dark) { - :root { - --color-background: #212121; - --color-card-background: #252525; - --color-input-background: #2f2f2f; - --color-main: #85A2D5; - --color-accent: #d5b885; - --color-fading: #1f2e3d; - --color-light: #3e6ab5; - --color-dark: #d1dcef; - --color-grey: #888888; - --color-link: lightskyblue; - --color-link-visited: #ad76de; - } -} *, *::before, *::after { box-sizing: inherit; diff --git a/public/theme.css b/public/theme.css new file mode 100644 index 00000000..deeb3ec7 --- /dev/null +++ b/public/theme.css @@ -0,0 +1,100 @@ +@font-face { + font-family: 'themix'; + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.eot'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.eot? #iefix') format('embedded-opentype'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400.woff') format('woff'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400.woff2') format('woff2'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400.otf') format('opentype'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400.svg#themix') format('svg'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'themix'; + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.eot'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.eot? #iefix') format('embedded-opentype'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.woff') format('woff'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.woff2') format('woff2'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.otf') format('opentype'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_400i.svg#themix') format('svg'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: 'themix'; + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.eot'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.eot? #iefix') format('embedded-opentype'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700.woff') format('woff'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700.woff2') format('woff2'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700.otf') format('opentype'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700.svg#themix') format('svg'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'themix'; + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.eot'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.eot? #iefix') format('embedded-opentype'); + src: url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.woff') format('woff'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.woff2') format('woff2'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.otf') format('opentype'), + url('https://cdn.skauting.cz/fonts/TheMix_LT_700i.svg#themix') format('svg'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: 'skautbold'; + src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.eot'); + src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.eot? #iefix') format('embedded-opentype'); + src: url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.woff') format('woff'), + url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.otf') format('opentype'), + url('https://cdn.skauting.cz/fonts/skaut-bold-webfont.svg#skautbold') format('svg'); + font-weight: normal; + font-style: normal; +} + +:root { + background: var(--color-background); + --border-radius: 6px; + font-family: 'themix', sans-serif; + box-sizing: border-box; + color: var(--color-main); + color-scheme: light dark; + accent-color: var(--color-main); +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: #e6ebed; + --color-card-background: #f9f9f9; + --color-input-background: #ffffff; + --color-main: #0D71B9; + --color-accent: #b9550d; + --color-fading: #a6d9ff; + --color-light: #3ba5f1; + --color-dark: #06375a; + --color-grey: #636363; + --color-link: #0000ee; + --color-link-visited: #551a8b; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: #212121; + --color-card-background: #252525; + --color-input-background: #2f2f2f; + --color-main: #85A2D5; + --color-accent: #d5b885; + --color-fading: #1f2e3d; + --color-light: #3e6ab5; + --color-dark: #d1dcef; + --color-grey: #888888; + --color-link: lightskyblue; + --color-link-visited: #ad76de; + } +} diff --git a/src/Event/Event.php b/src/Event/Event.php index 082d8ee2..56d812a0 100755 --- a/src/Event/Event.php +++ b/src/Event/Event.php @@ -123,7 +123,13 @@ public function getAvailableRoles(): array public function getLogoInBase64(): string { - return ImageUtils::getLocalImageInBase64($this->logoUrl); + return ImageUtils::getLocalImageInBase64(self::getFullLogoUrl($this->logoUrl)); + } + + public static function getFullLogoUrl(?string $logoUrl): string + { + if ($logoUrl === null) { return "";} + return "/assets" . $logoUrl; } public function getMinimalPpCount(Participant $participant): int diff --git a/src/Event/EventType/EventType.php b/src/Event/EventType/EventType.php index cd35d86e..9c3c0b60 100755 --- a/src/Event/EventType/EventType.php +++ b/src/Event/EventType/EventType.php @@ -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'; } public function getSkautStampSignPath(Participant $participant): string diff --git a/src/Mailer/Mailer.php b/src/Mailer/Mailer.php index 32dea71b..d21f3ff2 100755 --- a/src/Mailer/Mailer.php +++ b/src/Mailer/Mailer.php @@ -4,6 +4,7 @@ namespace kissj\Mailer; +use kissj\Event\Event; use kissj\Participant\Participant; use kissj\Payment\Payment; use kissj\Payment\QrCodeService; @@ -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)), ])); array_map(fn (string $attachment) => $email->attach($attachment), $attachments); foreach ($embeds as $embed) { diff --git a/src/Settings/TwigExtension.php b/src/Settings/TwigExtension.php index 07f3aab5..cb253e49 100755 --- a/src/Settings/TwigExtension.php +++ b/src/Settings/TwigExtension.php @@ -10,11 +10,23 @@ use kissj\Participant\Troop\TroopLeader; use kissj\Participant\Troop\TroopParticipant; use kissj\User\UserStatus; +use kissj\Event\Event; use Twig\Extension\AbstractExtension; use Twig\TwigTest; +use Twig\TwigFunction; class TwigExtension extends AbstractExtension { + /** + * @return TwigFunction[] + */ + public function getFunctions() :array + { + return [ + new TwigFunction('eventLogo', [Event::class, 'getFullLogoUrl']), + ]; + } + /** * @return TwigTest[] */ diff --git a/src/Templates/translatable/_layout.twig b/src/Templates/translatable/_layout.twig index 5e06bf8a..f84a1abf 100755 --- a/src/Templates/translatable/_layout.twig +++ b/src/Templates/translatable/_layout.twig @@ -8,10 +8,16 @@ -