MDL-64706 theme_boost: Remove logo link in secure template

This commit is contained in:
Luca Bösch
2019-03-05 04:16:40 +01:00
committed by Jenkins
parent 78fa8d7e8e
commit 7f22b14efb
3 changed files with 64 additions and 12 deletions
+21
View File
@@ -0,0 +1,21 @@
@core
Feature: Page displaying with secure layout
In order to securely perform tasks
As a student
I need not to be able to exit the page using the header logo
Background:
# Get to the fixture page.
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| label | L1 | <a href="../lib/tests/fixtures/securetestpage.php">Fixture link</a> | C1 | label1 |
Scenario: Confirm that there is no header link
Given I log in as "admin"
And I am on "Course 1" course homepage
When I follow "Fixture link"
Then I should see "Acceptance test site" in the "nav" "css_element"
But "Acceptance test site" "link" should not exist
+37
View File
@@ -0,0 +1,37 @@
<?php
// 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/>.
/**
* Fixture for testing secure layout pages have no nav link.
*
* @package core
* @copyright 2019 Luca Bösch <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../../config.php');
// Behat test fixture only.
defined('BEHAT_SITE_RUNNING') || die('Only available on Behat test server');
$PAGE->set_pagelayout('secure');
$PAGE->set_url('/lib/tests/fixtures/securetestpage.php');
$PAGE->set_context(context_system::instance());
echo $OUTPUT->header();
echo $OUTPUT->heading('Hello world');
echo $OUTPUT->footer();
+6 -12
View File
@@ -19,18 +19,12 @@
}}
<nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex">
<a href="{{{ config.wwwroot }}}" class="navbar-brand {{# output.should_display_navbar_logo }}has-logo{{/ output.should_display_navbar_logo }}
{{^ output.should_display_navbar_logo }}
d-none d-sm-inline
{{/ output.should_display_navbar_logo }}
">
{{# output.should_display_navbar_logo }}
<span class="logo d-none d-sm-inline">
<img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
</span>
{{/ output.should_display_navbar_logo }}
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
</a>
{{# output.should_display_navbar_logo }}
<span class="logo d-none d-sm-inline">
<img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
</span>
{{/ output.should_display_navbar_logo }}
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">