Merge branch 'MDL-73114-master' of https://github.com/bmbrands/moodle
This commit is contained in:
@@ -4255,7 +4255,7 @@ EOD;
|
||||
}
|
||||
|
||||
// The user context currently has images and buttons. Other contexts may follow.
|
||||
if (isset($headerinfo['user']) || $context->contextlevel == CONTEXT_USER) {
|
||||
if ((isset($headerinfo['user']) || $context->contextlevel == CONTEXT_USER) && $this->page->pagetype !== 'my-index') {
|
||||
if (isset($headerinfo['user'])) {
|
||||
$user = $headerinfo['user'];
|
||||
} else {
|
||||
@@ -4420,7 +4420,7 @@ EOD;
|
||||
$homepage = get_home_page();
|
||||
$homepagetype = null;
|
||||
// Add a special case since /my/courses is a part of the /my subsystem.
|
||||
if ($homepage == HOMEPAGE_MY && $this->page->title !== get_string('mycourses')) {
|
||||
if ($homepage == HOMEPAGE_MY || $homepage == HOMEPAGE_MYCOURSES) {
|
||||
$homepagetype = 'my-index';
|
||||
} else if ($homepage == HOMEPAGE_SITE) {
|
||||
$homepagetype = 'site-index';
|
||||
|
||||
@@ -45,18 +45,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-sm-flex align-items-center">
|
||||
{{#contextheader}}
|
||||
<div class="mr-auto">
|
||||
{{{contextheader}}}
|
||||
</div>
|
||||
{{/contextheader}}
|
||||
<div class="header-actions-container flex-shrink-0" data-region="header-actions-container">
|
||||
{{^welcomemessage}}
|
||||
{{#contextheader}}
|
||||
<div class="mr-auto">
|
||||
{{{contextheader}}}
|
||||
</div>
|
||||
{{/contextheader}}
|
||||
{{/welcomemessage}}
|
||||
{{> core/welcome }}
|
||||
<div class="header-actions-container ml-auto" data-region="header-actions-container">
|
||||
{{#headeractions}}
|
||||
<div class="header-action ml-2">{{{.}}}</div>
|
||||
{{/headeractions}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{> core/welcome }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ $PAGE->set_pagetype('my-index');
|
||||
$PAGE->blocks->add_region('content');
|
||||
$PAGE->set_subpage($currentpage->id);
|
||||
$PAGE->set_title($pagetitle);
|
||||
$PAGE->set_heading($header);
|
||||
$PAGE->set_heading($pagetitle);
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
|
||||
if (!isguestuser()) { // Skip default home page for guests
|
||||
|
||||
@@ -81,7 +81,7 @@ class core_renderer extends \core_renderer {
|
||||
}
|
||||
|
||||
// The user context currently has images and buttons. Other contexts may follow.
|
||||
if (isset($headerinfo['user']) || $context->contextlevel == CONTEXT_USER) {
|
||||
if ((isset($headerinfo['user']) || $context->contextlevel == CONTEXT_USER) && $this->page->pagetype !== 'my-index') {
|
||||
if (isset($headerinfo['user'])) {
|
||||
$user = $headerinfo['user'];
|
||||
} else {
|
||||
@@ -179,12 +179,6 @@ class core_renderer extends \core_renderer {
|
||||
$heading = $this->heading($contextheader->heading, $contextheader->headinglevel, 'h2');
|
||||
}
|
||||
|
||||
$showheader = empty($this->page->layout_options['nocontextheader']);
|
||||
if (!$showheader) {
|
||||
// Return the heading wrapped in an sr-only element so it is only visible to screen-readers.
|
||||
return html_writer::div($heading, 'sr-only');
|
||||
}
|
||||
|
||||
// All the html stuff goes here.
|
||||
$html = html_writer::start_div('page-context-header');
|
||||
|
||||
|
||||
@@ -81,14 +81,15 @@ $THEME->layouts = [
|
||||
// My courses page.
|
||||
'mycourses' => array(
|
||||
'file' => 'drawers.php',
|
||||
'regions' => array()
|
||||
'regions' => array(),
|
||||
'options' => array('nonavbar' => true),
|
||||
),
|
||||
// My dashboard page.
|
||||
'mydashboard' => array(
|
||||
'file' => 'drawers.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
'options' => array('nonavbar' => true, 'langmenu' => true, 'nocontextheader' => true),
|
||||
'options' => array('nonavbar' => true, 'langmenu' => true),
|
||||
),
|
||||
// My public page.
|
||||
'mypublic' => array(
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
@javascript @theme_boost
|
||||
Feature: Welcome message on boost
|
||||
To be welcome in moodle
|
||||
As a User
|
||||
I need to see a welcome message on the first page
|
||||
|
||||
Scenario: Login and be welcomed on the homepage
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 0 |
|
||||
When I log in as "admin"
|
||||
Then I should not see "Acceptance test site" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I should see "Acceptance test site" in the "page-header" "region"
|
||||
|
||||
Scenario: Login and be welcomed on the dashboard
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 1 |
|
||||
When I log in as "admin"
|
||||
Then I should not see "Dashboard" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I should see "Dashboard" in the "page-header" "region"
|
||||
|
||||
Scenario: Login and be welcomed on the my courses page
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 3 |
|
||||
When I log in as "admin"
|
||||
Then I should not see "My courses" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I should see "My courses" in the "page-header" "region"
|
||||
@@ -82,7 +82,7 @@ $THEME->layouts = [
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre', 'side-post'),
|
||||
'defaultregion' => 'side-pre',
|
||||
'options' => array('nonavbar' => true, 'langmenu' => true, 'nocontextheader' => true),
|
||||
'options' => array('langmenu' => true),
|
||||
),
|
||||
// My public page.
|
||||
'mypublic' => array(
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
@javascript @theme_classic
|
||||
Feature: Welcome message on classic
|
||||
To be welcome in moodle
|
||||
As a User
|
||||
I need to see a welcome message on the first page
|
||||
|
||||
Scenario: Login and be welcomed on the homepage
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 0 |
|
||||
When I log in as "admin"
|
||||
Then I should see "Acceptance test site" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
|
||||
Scenario: Login and be welcomed on the dashboard
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 1 |
|
||||
When I log in as "admin"
|
||||
Then I should see "Dashboard" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
|
||||
Scenario: Login and be welcomed on the my courses page
|
||||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 3 |
|
||||
When I log in as "admin"
|
||||
Then I should see "My courses" in the "page-header" "region"
|
||||
And I should see "Welcome, Admin!" in the "page-header" "region"
|
||||
And I reload the page
|
||||
And I should not see "Welcome, Admin!" in the "page-header" "region"
|
||||
Reference in New Issue
Block a user