Skip to content

Commit

Permalink
Merge pull request #35071 from nextcloud/fix/384-missing_alt_text_for…
Browse files Browse the repository at this point in the history
…_logo_on_multiple_pages

Add alt to the logo, adapt css for logo
  • Loading branch information
JuliaKirschenheuter authored Dec 8, 2022
2 parents fa7364e + bba5ab0 commit 11d7cd0
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 41 deletions.
9 changes: 3 additions & 6 deletions core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,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 @@ -120,10 +120,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 @@ -194,6 +190,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

0 comments on commit 11d7cd0

Please sign in to comment.