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

Fix issues when using the public layout without a PublicTemplateResponse #10530

Merged
merged 3 commits into from
Aug 6, 2018
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
5 changes: 5 additions & 0 deletions core/css/public.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
min-height: calc(100vh - 160px);
}

/** don't apply content header padding on the base layout */
&.layout-base #content {
padding-top: 0;
}

/* force layout to make sure the content element's height matches its contents' height */
.ie #content {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion core/templates/layout.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
<body id="body-public">
<body id="body-public" class="layout-base">
<?php include 'layout.noscript.warning.php'; ?>
<div id="content" class="app-public" role="main">
<?php print_unescaped($_['content']); ?>
Expand Down
14 changes: 7 additions & 7 deletions core/templates/layout.public.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" >
<head data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
<meta charset="utf-8">
<title>
<?php
Expand All @@ -14,7 +14,7 @@
<meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:$theme->getTitle()); ?>">
<meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!=='files')? $_['application']:$theme->getTitle()); ?>">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
Expand All @@ -30,22 +30,22 @@
<div id="notification-container">
<div id="notification"></div>
</div>
<header id="header" class="<?php p($_['header-classes']); ?>">
<header id="header">
<div class="header-left">
<span id="nextcloud">
<div class="logo logo-icon svg"></div>
<h1 class="header-appname">
<?php p($template->getHeaderTitle()); ?>
<?php if (isset($template)) { p($template->getHeaderTitle()); } else { p($theme->getName());} ?>
</h1>
<div class="header-shared-by">
<?php p($template->getHeaderDetails()) ?>
<?php if (isset($template)) { p($template->getHeaderDetails()); } ?>
</div>
</span>
</div>

<?php
/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
if($template->getActionCount() !== 0) {
if(isset($template) && $template->getActionCount() !== 0) {
$primary = $template->getPrimaryAction();
$others = $template->getOtherActions();
?>
Expand Down Expand Up @@ -76,7 +76,7 @@
<div id="content" class="app-<?php p($_['appid']) ?>" role="main">
<?php print_unescaped($_['content']); ?>
</div>
<?php if($template->getFooterVisible()) { ?>
<?php if(isset($template) && $template->getFooterVisible()) { ?>
<footer>
<p class="info"><?php print_unescaped($theme->getLongFooter()); ?></p>
</footer>
Expand Down