Skip to content

Commit 503340c

Browse files
author
roadiz-ci
committed
feat: Introduce projectLogoUrl configuration to replace admin image usage (#234)
1 parent 95199f2 commit 503340c

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

src/RozierServiceRegistry.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function getMaxFilesize(): int|float
5050
return UploadedFile::getMaxFilesize();
5151
}
5252

53+
/** @deprecated */
5354
public function getAdminImage(): ?DocumentInterface
5455
{
5556
return $this->settingsBag->getDocument('admin_image');

templates/admin/blocks/adminImage.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="company">
2-
{% if rozier.adminImage %}
3-
<a class="admin-image" href="{{ path('adminHomePage') }}">{{- rozier.adminImage|display({ picture: true, width: 180, quality: 70 }) -}}</a>
2+
{% if project_logo_url is not empty %}
3+
<a class="admin-image" href="{{ path('adminHomePage') }}"><img loading="lazy" src="{{ project_logo_url }}" alt=""/></a>
44
{% else %}
55
<a class="uk-icon-rz-roadiz-icon" href="{{ path('adminHomePage') }}"></a>
66
{% endif %}

templates/admin/blocks/loginImage.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="login-logo">
2-
{% if rozier.adminImage %}
3-
{{- rozier.adminImage|display({ picture: true, width: 200, quality: 70 }) -}}
2+
{% if project_logo_url is not empty %}
3+
<img loading="lazy" src="{{ project_logo_url }}" alt=""/>
44
{% else %}
55
<i class="uk-icon-rz-roadiz-icon"></i>
66
{% endif %}
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
{% if rozier.adminImage and rozier.adminImage.mimeType == 'image/png' %}
2-
<link rel="apple-touch-icon" sizes="180x180" href="{{ rozier.adminImage|url({absolute: true, fit:'180x180'}) }}">
3-
<link rel="icon" type="{{ rozier.adminImage.mimeType }}"
4-
sizes="32x32"
5-
href="{{ rozier.adminImage|url({absolute: true, fit:'32x32'}) }}">
6-
<link rel="icon" type="{{ rozier.adminImage.mimeType }}"
7-
sizes="16x16"
8-
href="{{ rozier.adminImage|url({absolute: true, fit:'16x16'}) }}">
1+
{% if project_logo_url is not empty %}
2+
<link rel="apple-touch-icon" href="{{ project_logo_url }}">
3+
<link rel="icon" href="{{ project_logo_url }}">
94
{% else %}
105
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('/bundles/roadizrozier/apple-touch-icon.png') }}">
116
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('/bundles/roadizrozier/favicon-32x32.png') }}">
127
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('/bundles/roadizrozier/favicon-16x16.png') }}">
138
{% endif %}
14-
{% if rozier.adminImage and rozier.adminImage.mimeType == 'image/svg+xml' and main_color %}
15-
<link rel="mask-icon" href="{{ rozier.adminImage|url({absolute: true}) }}" color="{{ main_color }}">
9+
{% if project_logo_url matches '/\.svg$/' and main_color %}
10+
<link rel="mask-icon" href="{{ project_logo_url }}" color="{{ main_color }}">
1611
{% endif %}
1712
{% if main_color %}
1813
<meta name="msapplication-TileColor" content="{{ main_color }}">
@@ -23,4 +18,4 @@
2318
<meta name="apple-mobile-web-app-status-bar-style" content="#808080">
2419
<meta name="theme-color" content="#808080">
2520
{% endif %}
26-
<meta name="mobile-web-app-capable" content="yes" />
21+
<meta name="mobile-web-app-capable" content="yes"/>

0 commit comments

Comments
 (0)