Skip to content

Commit

Permalink
MDL-64706 theme_boost: Remove logo link in secure template
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch authored and Jenkins committed Mar 5, 2019
1 parent b7d8cd0 commit c430bed
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 12 deletions.
21 changes: 21 additions & 0 deletions lib/tests/behat/securelayout.feature
@@ -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 changes: 37 additions & 0 deletions lib/tests/fixtures/securetestpage.php
@@ -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 <luca.boesch@bfh.ch>
* @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();
18 changes: 6 additions & 12 deletions theme/boost/templates/navbar-secure.mustache
Expand Up @@ -19,18 +19,12 @@
}}
<nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex" aria-label="{{#str}}navigation{{/str}}">

<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">
Expand Down

0 comments on commit c430bed

Please sign in to comment.