Skip to content

Commit

Permalink
Add alt to the logo, adapt css for logo
Browse files Browse the repository at this point in the history
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
JuliaKirschenheuter authored and backportbot-nextcloud[bot] committed Dec 8, 2022
1 parent 4c4095a commit 667d821
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 39 deletions.
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.

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.

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

0 comments on commit 667d821

Please sign in to comment.