Skip to content
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

[stable25] Add alt to the logo, adapt css for logo #35676

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ body {
}

#header .logo {
background-image: var(--image-logo, url('../../core/img/logo/logo.svg'));
background-repeat: no-repeat;
background-size: contain;
background-position: center;
width: 175px;
height: 130px;
max-width: 175px;
width: auto;
max-height: 130px;
margin: 0 auto;
position: relative;
left: unset;
Expand Down
6 changes: 0 additions & 6 deletions core/css/header.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/css/header.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/css/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,9 @@
}
.logo {
display: inline-flex;
background-image: var(--image-logoheader, var(--image-logo, url('../img/logo/logo.svg')));
background-repeat: no-repeat;
background-size: contain;
background-position: center;
width: 62px;
position: absolute;
left: 12px;
top: 1px;
bottom: 1px;
// Invert if not customized and background is bright
filter: var(--image-logoheader-custom, var(--background-image-invert-if-bright));
}
Expand Down
6 changes: 0 additions & 6 deletions core/css/server.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/css/server.css.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/templates/layout.guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<?php if ($_['bodyid'] === 'body-login'): ?>
<header role="banner">
<div id="header">
<div class="logo"></div>

<img class="logo" alt="<?php p($l->t('%s logo', [$theme->getName()])); ?>" src="<?= ($_['logoUrl'] ?? '') !== '' ? $_['logoUrl'] : $theme->getLogo(); ?>">
</div>
</header>
<?php endif; ?>
Expand Down
11 changes: 2 additions & 9 deletions core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,8 @@
</div>

<header id="header">
<div class="header-left">
<div class="logo logo-icon svg"></div>
<span id="nextcloud" class="header-appname">
<?php if (isset($template) && $template->getHeaderTitle() !== '') { ?>
<?php p($template->getHeaderTitle()); ?>
<?php } else { ?>
<?php p($theme->getName()); ?>
<?php } ?>
</span>
<div class="header-left" id="nextcloud">
<img class="logo logo-icon svg" alt="<?php p($l->t('%s logo', [$theme->getName()])); ?>" src="<?= ($_['logoUrl'] ?? '') !== '' ? $_['logoUrl'] : $theme->getLogo(); ?>">
<?php if (isset($template) && $template->getHeaderDetails() !== '') { ?>
<div class="header-shared-by">
<?php p($template->getHeaderDetails()); ?>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<div class="header-left">
<a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
id="nextcloud">
<div class="logo logo-icon"></div>
<img class="logo logo-icon" alt="<?php p($l->t('%s logo', [$theme->getName()])); ?>" src="<?= ($_['logoUrl'] ?? '') !== '' ? $_['logoUrl'] : $theme->getLogo(); ?>">
</a>

<nav id="header-left__appmenu"></nav>
Expand Down
9 changes: 5 additions & 4 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ public function __construct($renderAs, $appId = '') {
$this->assign('enabledThemes', $themesService->getEnabledThemes());
}

// set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');
$this->assign('logoUrl', $logoUrl);

// Add navigation entry
$this->assign('application', '');
$this->assign('appid', $appId);
Expand Down Expand Up @@ -188,6 +184,11 @@ public function __construct($renderAs, $appId = '') {
} else {
parent::__construct('core', 'layout.base');
}

// set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');
$this->assign('logoUrl', $logoUrl);

// Send the language and the locale to our layouts
$lang = \OC::$server->getL10NFactory()->findLanguage();
$locale = \OC::$server->getL10NFactory()->findLocale($lang);
Expand Down