소스 검색

fix(theming): Make sure the footer is hidden if not content is rendered

Previously the footer was empty, but the backdrop was still shown.
This hides the footer if no text content was defined.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
tags/v28.0.0beta2
Ferdinand Thiessen 7 달 전
부모
커밋
32ac5e7af8
No account linked to committer's email address
5개의 변경된 파일29개의 추가작업 그리고 12개의 파일을 삭제
  1. 10
    5
      apps/theming/lib/ThemingDefaults.php
  2. 1
    2
      core/css/guest.scss
  3. 7
    2
      core/templates/layout.guest.php
  4. 1
    1
      core/templates/layout.public.php
  5. 10
    2
      themes/example/defaults.php

+ 10
- 5
apps/theming/lib/ThemingDefaults.php 파일 보기

@@ -172,11 +172,16 @@ class ThemingDefaults extends \OC_Defaults {
public function getShortFooter() {
$slogan = $this->getSlogan();
$baseUrl = $this->getBaseUrl();
if ($baseUrl !== '') {
$footer = '<a href="' . $baseUrl . '" target="_blank"' .
' rel="noreferrer noopener" class="entity-name">' . $this->getEntity() . '</a>';
} else {
$footer = '<span class="entity-name">' .$this->getEntity() . '</span>';
$entity = $this->getEntity();
$footer = '';

if ($entity !== '') {
if ($baseUrl !== '') {
$footer = '<a href="' . $baseUrl . '" target="_blank"' .
' rel="noreferrer noopener" class="entity-name">' . $entity . '</a>';
} else {
$footer = '<span class="entity-name">' .$entity . '</span>';
}
}
$footer .= ($slogan !== '' ? ' – ' . $slogan : '');


+ 1
- 2
core/css/guest.scss 파일 보기

@@ -107,7 +107,7 @@ body {
.wrapper {
width: 100%;
max-width: 700px;
margin-top: 10vh;
margin-block: 10vh auto;
}

/* Default FORM */
@@ -736,7 +736,6 @@ img.icon-loading-small-dark, object.icon-loading-small-dark, video.icon-loading-

/* FOOTER */
footer {
margin-top: auto;
.info .entity-name {
font-weight: bold;
}

+ 7
- 2
core/templates/layout.guest.php 파일 보기

@@ -47,9 +47,14 @@ p($theme->getTitle());
</main>
</div>
</div>
<footer class="guest-box">
<?php
$longFooter = $theme->getLongFooter();
?>
<footer class="guest-box <?php if ($longFooter === '') {
p('hidden');
} ?>">
<p class="info">
<?php print_unescaped($theme->getLongFooter()); ?>
<?php print_unescaped($longFooter); ?>
</p>
</footer>
</body>

+ 1
- 1
core/templates/layout.public.php 파일 보기

@@ -103,7 +103,7 @@ if (isset($template) && $template->getActionCount() !== 0) {
</h1>
<?php print_unescaped($_['content']); ?>
</main>
<?php if (isset($template) && $template->getFooterVisible()) { ?>
<?php if (isset($template) && $template->getFooterVisible() && ($theme->getLongFooter() !== '' || $_['showSimpleSignUpLink'])) { ?>
<footer>
<p><?php print_unescaped($theme->getLongFooter()); ?></p>
<?php

+ 10
- 2
themes/example/defaults.php 파일 보기

@@ -81,8 +81,16 @@ class OC_Theme {
* @return string short footer
*/
public function getShortFooter(): string {
$footer = '© ' . date('Y') . ' <a href="' . $this->getBaseUrl() . '" target="_blank">' . $this->getEntity() . '</a>' .
'<br/>' . $this->getSlogan();
$entity = $this->getEntity();

$footer = '© ' . date('Y');

// Add link if entity name is not empty
if ($entity !== '') {
$footer .= ' <a href="' . $this->getBaseUrl() . '" target="_blank">' . $entity . '</a>' . '<br/>';
}

$footer .= $this->getSlogan();

return $footer;
}

Loading…
취소
저장