Commit 5d03ab36 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-55838 theme_boost: Fix secure layout

It was out of date with the columns2 layout and had links outside it's content.
parent cd4a6b8b
......@@ -694,4 +694,12 @@ class core_renderer extends \core_renderer {
return $skipped;
}
/**
* Secure login info.
*
* @return string
*/
public function secure_login_info() {
return $this->login_info(false);
}
}
......@@ -24,10 +24,16 @@
defined('MOODLE_INTERNAL') || die();
$blockshtml = $OUTPUT->blocks('side-pre');
$hasblocks = strpos($blockshtml, 'data-block=') !== false;
$bodyattributes = $OUTPUT->body_attributes();
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT,
'sidepreblocks' => $OUTPUT->blocks('side-pre'),
'bodyattributes' => $bodyattributes,
'sidepreblocks' => $blockshtml,
'hasblocks' => $hasblocks
];
echo $OUTPUT->render_from_template('theme_boost/secure', $templatecontext);
......
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Page header.
}}
<header role="banner" class="pos-f-t navbar navbar-full navbar-light bg-faded navbar-static-top moodle-has-zindex">
<div class="container-fluid">
<span role="banner" class="navbar-brand {{# output.should_display_navbar_logo }}has-logo{{/ output.should_display_navbar_logo }}
{{^ output.should_display_navbar_logo }}
hidden-sm-down
{{/ output.should_display_navbar_logo }}
">
{{# output.should_display_navbar_logo }}
<span class="logo hidden-xs-down">
<img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
</span>
{{/ output.should_display_navbar_logo }}
<span class="site-name hidden-sm-down">{{{ sitename }}}</span>
</span>
<div class="pull-xs-right nav-link">
{{{ output.secure_login_info }}}
</div>
</div>
</header>
......@@ -43,56 +43,53 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body {{{ output.body_attributes }}}>
<body {{{ bodyattributes }}}>
{{{ output.standard_top_of_body_html }}}
<div id="page-wrapper">
<header class="navbar navbar-full navbar-light bg-faded navbar-static-top moodle-has-zindex">
<div class="container">
<div class="clearfix">
<button class="navbar-toggler pull-xs-right hidden-sm-up" data-toggle="collapse" data-target="#bd-main-mav"><span class="sr-only">{{#str}}expand{{/str}}</span></button>
</div>
{{{ output.standard_top_of_body_html }}}
<a role="banner" href="{{{ config.wwwroot }}}" class="navbar-brand">
{{# output.should_display_navbar_logo }}
<div class="logo">
<img src="{{output.get_compact_logo_url}}" alt={{#quote}}{{sitename}}{{/quote}}>
</div>
{{/ output.should_display_navbar_logo }}
<div class="site-name">{{{ sitename }}}</div>
</a>
{{>theme_boost/header-secure}}
<div class="collapse navbar-toggleable-xs" id="bd-main-nav">
<nav class="nav navbar-nav">
<!-- search_box -->
{{{ output.search_box }}}
<!-- custom_menu -->
{{{ output.custom_menu }}}
<!-- page_heading_menu -->
{{{ output.page_heading_menu }}}
<!-- login info -->
{{{ output.login_info }}}
</nav>
</div>
</div>
</header>
<div id="page" class="container-fluid">
{{! Secured full header }}
<div id="page" class="container">
{{{ output.full_header }}}
<div id="page-header" class="row">
<div class="col-xs-12 p-y-1">
<div class="page-context-header">
<div class="page-header-headings">
{{{ output.page_heading }}}
</div>
</div>
</div>
</div>
<div id="page-content" class="row">
<div id="region-main-box" class="col-xs-12">
<div class="row">
<section id="region-main" class="col-xs-12">
<div id="page-content" class="row">
<div id="region-main-box" class="col-xs-12">
<section id="region-main" {{#hasblocks}}class="has-blocks"{{/hasblocks}}>
<div class="card card-block">
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}
</div>
</section>
{{#hasblocks}}
<section data-region="blocks-column">
{{{ sidepreblocks }}}
</section>
{{/hasblocks}}
</div>
</div>
</div>
</div>
<footer id="page-footer" class="p-y-1 bg-inverse">
<div class="container">
<div id="course-footer">{{{ output.course_footer }}}</div>
{{{ output.standard_end_of_body_html }}}
{{{ output.standard_end_of_body_html }}}
</div>
</footer>
</div>
</body>
</html>
{{#js}}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment