Merge branch 'MDL-56582-master' of https://github.com/xow/moodle

This commit is contained in:
Dan Poltawski 2016-11-02 13:49:50 +00:00
commit c624351e97
6 changed files with 119 additions and 8 deletions

View File

@ -25,11 +25,14 @@
defined('MOODLE_INTERNAL') || die();
$bodyattributes = $OUTPUT->body_attributes([]);
$regionmainsettingsmenu = $OUTPUT->region_main_settings_menu();
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT,
'bodyattributes' => $bodyattributes,
'regionmainsettingsmenu' => $regionmainsettingsmenu,
'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu)
];
echo $OUTPUT->render_from_template('theme_boost/columns1', $templatecontext);

View File

@ -39,14 +39,16 @@ if ($navdraweropen) {
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
$blockshtml = $OUTPUT->blocks('side-pre');
$hasblocks = strpos($blockshtml, 'data-block=') !== false;
$regionmainsettingsmenu = $OUTPUT->region_main_settings_menu();
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))),
'output' => $OUTPUT,
'sidepreblocks' => $blockshtml,
'hasblocks' => $hasblocks,
'bodyattributes' => $bodyattributes,
'navdraweropen' => $navdraweropen
'navdraweropen' => $navdraweropen,
'regionmainsettingsmenu' => $regionmainsettingsmenu,
'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu)
];
$templatecontext['flatnavigation'] = $PAGE->flatnav;

View File

@ -45,6 +45,15 @@ $blocks-plus-gutter: $blocks-column-width + $grid-gutter-width;
z-index: 100;
margin: 1rem;
}
.region_main_settings_menu_proxy {
width: 4rem;
height: 2rem;
background-color: $card-bg;
margin-left: $card-spacer-x / 2;
margin-bottom: $card-spacer-x / 2;
border-bottom-left-radius: 0.5rem;
float: right;
}
#region-main-settings-menu.has-blocks,
#region-main.has-blocks {
display: inline-block;

View File

@ -19,6 +19,11 @@
height: 24px;
width: auto;
}
/** Prevent user notifications overlapping with region main settings menu */
#user-notifications {
display: block;
overflow: hidden;
}
/** Page layout CSS starts **/
.layout-option-noheader #page-header,

View File

@ -1,3 +1,40 @@
{{!
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/>.
}}
{{!
@template theme_boost/columns1
Boost 1 column layout template.
Context variables required for this template:
* sitename - The name of the site
* output - The core renderer for the page
* bodyattributes - attributes for the body tag as a string of html attributes
* regionmainsettingsmenu - HTML for the region main settings menu
* hasregionmainsettingsmenu - There is a region main settings menu on this page.
Example context (json):
{
"sitename": "Moodle",
"output":{},
"bodyattributes":"",
"regionmainsettingsmenu": "",
"hasregionmainsettingsmenu": false
}
}}
{{{ output.doctype }}}
<html {{{ output.htmlattributes }}}>
<head>
@ -16,11 +53,16 @@
<div id="page" class="container-fluid">
<div id="page-content" class="row">
<div id="region-main-box" class="col-xs-12">
<div id="region-main-settings-menu">
<div> {{{ output.region_main_settings_menu }}} </div>
</div>
{{#hasregionmainsettingsmenu}}
<div id="region-main-settings-menu" class="has-blocks">
<div> {{{ regionmainsettingsmenu }}} </div>
</div>
{{/hasregionmainsettingsmenu}}
<section id="region-main">
<div class="card card-block">
{{#hasregionmainsettingsmenu}}
<div class="region_main_settings_menu_proxy"></div>
{{/hasregionmainsettingsmenu}}
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}

View File

@ -1,3 +1,48 @@
{{!
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/>.
}}
{{!
@template theme_boost/columns2
Admin time setting template.
Boost 2 column layout template.
Context variables required for this template:
* sitename - The name of the site
* output - The core renderer for the page
* bodyattributes - attributes for the body tag as a string of html attributes
* sidepreblocks - HTML for the blocks
* hasblocks - true if there are blocks on this page
* navdraweropen - true if the nav drawer should be open on page load
* regionmainsettingsmenu - HTML for the region main settings menu
* hasregionmainsettingsmenu - There is a region main settings menu on this page.
Example context (json):
{
"sitename": "Moodle",
"output":{},
"bodyattributes":"",
"sitepreblocks":"BLOCKS HTML",
"hasblocks":true,
"navdraweropen":true,
"regionmainsettingsmenu": "",
"hasregionmainsettingsmenu": false
}
}}
{{{ output.doctype }}}
<html {{{ output.htmlattributes }}}>
<head>
@ -24,9 +69,11 @@
<section data-region="blocks-column" class="hidden-md-down">
{{{ sidepreblocks }}}
</section>
<div id="region-main-settings-menu" class="has-blocks">
<div> {{{ output.region_main_settings_menu }}} </div>
</div>
{{#hasregionmainsettingsmenu}}
<div id="region-main-settings-menu" class="has-blocks">
<div> {{{ regionmainsettingsmenu }}} </div>
</div>
{{/hasregionmainsettingsmenu}}
<section id="region-main" class="has-blocks">
{{/hasblocks}}
{{^hasblocks}}
@ -36,6 +83,9 @@
<section id="region-main">
{{/hasblocks}}
<div class="card card-block">
{{#hasregionmainsettingsmenu}}
<div class="region_main_settings_menu_proxy"></div>
{{/hasregionmainsettingsmenu}}
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}