Skip to content

Commit

Permalink
MDL-72095 theme_boost: max width for activity pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas Brands committed Dec 8, 2021
1 parent 5ee0b62 commit 946fd91
Show file tree
Hide file tree
Showing 68 changed files with 228 additions and 242 deletions.
1 change: 1 addition & 0 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$PAGE->set_url('/admin/settings.php', array('section' => $section));
$PAGE->set_pagetype('admin-setting-' . $section);
$PAGE->set_pagelayout('admin');
$PAGE->has_secondary_navigation_setter(false);
$PAGE->navigation->clear_cache();
navigation_node::require_admin_tree();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: The my overview block allows users to persistence of their page limits
Then I should see "Course 13"
And I reload the page
Then I should see "Course 13"
And I should see "All" in the "[data-action='limit-toggle']" "css_element"
And I should see "All" in the ".block-myoverview [data-action='limit-toggle']" "css_element"

Scenario: Toggle the page limit between grouping changes
Given I am on the "My courses" page logged in as "student1"
Expand All @@ -52,4 +52,4 @@ Feature: The my overview block allows users to persistence of their page limits
And I click on "All" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 13"
And I should see "All" in the "[data-action='limit-toggle']" "css_element"
And I should see "All" in the ".block-myoverview [data-action='limit-toggle']" "css_element"
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Feature: My overview block pagination
| student1 | C12 | student |
| student1 | C13 | student |
When I am on the "My courses" page logged in as "student1"
Then I should see "12" in the "[data-action='limit-toggle']" "css_element"
Then I should see "12" in the ".block_myoverview [data-action='limit-toggle']" "css_element"
And I log out

Scenario: I should only see pagination limit options less than total number of enrolled courses
Expand Down
1 change: 1 addition & 0 deletions contentbank/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$PAGE->set_context($context);
$PAGE->set_title($title);
$PAGE->set_heading($title);
$PAGE->add_body_class('limitedwidth');
$PAGE->set_pagetype('contentbank');

// Get all contents managed by active plugins where the user has permission to render them.
Expand Down
1 change: 1 addition & 0 deletions course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
}

$PAGE->set_title($title);
$PAGE->add_body_class('limitedwidth');
$PAGE->set_heading($fullname);

echo $OUTPUT->header();
Expand Down
1 change: 1 addition & 0 deletions course/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
}

$PAGE->set_pagelayout('coursecategory');
$PAGE->add_body_class('limitedwidth');
$courserenderer = $PAGE->get_renderer('core', 'course');

$PAGE->set_heading($heading);
Expand Down
2 changes: 2 additions & 0 deletions course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
}
$PAGE->set_pagetype($pagepath);
$PAGE->set_pagelayout('admin');
$PAGE->add_body_class('limitedwidth');


$modmoodleform = "$CFG->dirroot/mod/$module->name/mod_form.php";
if (file_exists($modmoodleform)) {
Expand Down
1 change: 1 addition & 0 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

// Must set layout before gettting section info. See MDL-47555.
$PAGE->set_pagelayout('course');
$PAGE->add_body_class('limitedwidth');

if ($section and $section > 0) {

Expand Down
2 changes: 1 addition & 1 deletion grade/grading/form/guide/tests/behat/edit_guide.feature
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Feature: Marking guides can be created and edited
And I wait "1" seconds
Then the field "Guide criterion B criterion remark" matches value "Comment \"4\""
When I press "Save changes"
And I follow "Assignment: Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page
And I follow "View all submissions"
# Checking that the user grade is correct.
Then I should see "80" in the "Student 1" "table_row"
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}
$PAGE->set_url('/', $urlparams);
$PAGE->set_pagelayout('frontpage');
$PAGE->add_body_class('limitedwidth');
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_other_editing_capability('moodle/course:activityvisibility');
Expand Down
53 changes: 25 additions & 28 deletions lib/templates/full_header.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,34 @@
"welcomemessage": "welcomemessage"
}
}}
<header id="page-header" class="row">
<div class="col-12 py-3">
<div class="card border-0">
<div class="card-body p-2 navigation-card">
<div class="d-flex flex-wrap">
{{#hasnavbar}}
<div id="page-navbar" class="p-1">
{{{navbar}}}
</div>
{{/hasnavbar}}
<div class="ml-auto d-flex">
{{{pageheadingbutton}}}
</div>
<div id="course-header">
{{{courseheader}}}
</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">
{{#headeractions}}
<div class="header-action ml-2">{{{.}}}</div>
{{/headeractions}}
</div>
<header id="page-header" class="header-maxwidth">
<div class="w-100">
<div class="d-flex flex-wrap">
{{#hasnavbar}}
<div id="page-navbar" class="p-1">
{{{navbar}}}
</div>
{{/hasnavbar}}
<div class="ml-auto d-flex">
{{{pageheadingbutton}}}
</div>
<div id="course-header">
{{{courseheader}}}
</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">
{{#headeractions}}
<div class="header-action ml-2">{{{.}}}</div>
{{/headeractions}}
</div>
</div>

{{> core/welcome }}
</div>
</header>
5 changes: 5 additions & 0 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ public function view($action='', $args = array()) {
$nextpageparams['id'] = $this->get_course_module()->id;
}

if (empty($action)) {
$PAGE->add_body_class('limitedwidth');
}

// Handle form submissions first.
if ($action == 'savesubmission') {
$action = 'editsubmission';
Expand Down Expand Up @@ -649,6 +653,7 @@ public function view($action='', $args = array()) {
} else if ($action == 'viewpluginassignsubmission') {
$o .= $this->view_plugin_content('assignsubmission');
} else if ($action == 'editsubmission') {
$PAGE->add_body_class('limitedwidth');
$o .= $this->view_edit_submission_page($mform, $notices);
} else if ($action == 'grader') {
$o .= $this->view_grader();
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/quickgrading.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "View all submissions"
When I click on "Grade" "link" in the "Student 1" "table_row"
And I press "Save changes"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
Then I should see "1" in the "Needs grading" "table_row"

@skip_chrome_zerosize
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/rescale_grades.feature
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Given I follow "View all submissions"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I wait until the page is ready
And I follow "Assignment: Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Rescale existing grades" to "Yes"
Expand Down
1 change: 1 addition & 0 deletions mod/book/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

$PAGE->set_url('/mod/book/edit.php', array('cmid'=>$cmid, 'id'=>$chapterid, 'pagenum'=>$pagenum, 'subchapter'=>$subchapter));
$PAGE->set_pagelayout('admin'); // TODO: Something. This is a bloody hack!
$PAGE->add_body_class('limitedwidth');

if ($chapterid) {
$chapter = $DB->get_record('book_chapters', array('id'=>$chapterid, 'bookid'=>$book->id), '*', MUST_EXIST);
Expand Down
1 change: 1 addition & 0 deletions mod/book/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
$pagetitle = $book->name . ": " . $chapter->title;
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);
$PAGE->add_body_class('limitedwidth');

book_add_fake_block($chapters, $chapter, $book, $cm, $edit);

Expand Down
1 change: 1 addition & 0 deletions mod/chat/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
$PAGE->set_url('/mod/chat/view.php', array('id' => $cm->id));
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
$PAGE->add_body_class('limitedwidth');

// Print the page header.
echo $OUTPUT->header();
Expand Down
2 changes: 2 additions & 0 deletions mod/choice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
// Completion and trigger events.
choice_view($choice, $course, $cm, $context);

$PAGE->add_body_class('limitedwidth');

echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($choice->name), 2, null);
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->add_body_class('limitedwidth');
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($feedback->name));
Expand Down Expand Up @@ -96,4 +97,3 @@
echo '</div>';

echo $OUTPUT->footer();

1 change: 1 addition & 0 deletions mod/feedback/complete.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
$PAGE->set_title($feedback->name);
$PAGE->set_pagelayout('incourse');
$PAGE->set_secondary_active_tab('modulepage');
$PAGE->add_body_class('limitedwidth');

// Check if the feedback is open (timeopen, timeclose).
if (!$feedbackcompletion->is_open()) {
Expand Down
1 change: 1 addition & 0 deletions mod/feedback/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$actionbar = new \mod_feedback\output\edit_action_bar($cm->id, $url, $lastposition);
$PAGE->add_body_class('limitedwidth');

//Adding the javascript module for the items dragdrop.
if (count($feedbackitems) > 1) {
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

require_login($course);
$PAGE->set_pagelayout('incourse');
$PAGE->add_body_class('limitedwidth');

// Trigger instances list viewed event.
$event = \mod_feedback\event\course_module_instance_list_viewed::create(array('context' => $context));
Expand Down Expand Up @@ -126,4 +127,3 @@
/// Finish the page

echo $OUTPUT->footer();

2 changes: 1 addition & 1 deletion mod/feedback/show_entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
navigation_node::override_active_url($baseurl);
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->add_body_class('limitedwidth');
echo $OUTPUT->header();

/** @var \mod_feedback\output\renderer $renderer */
Expand Down Expand Up @@ -163,4 +164,3 @@

// Finish the page.
echo $OUTPUT->footer();

2 changes: 1 addition & 1 deletion mod/feedback/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$PAGE->set_url('/mod/feedback/view.php', array('id' => $cm->id));
$PAGE->set_title($feedback->name);
$PAGE->set_heading($course->fullname);
$PAGE->add_body_class('limitedwidth');

// Check access to the given courseid.
if ($courseid AND $courseid != SITEID) {
Expand Down Expand Up @@ -152,4 +153,3 @@
}

echo $OUTPUT->footer();

1 change: 1 addition & 0 deletions mod/folder/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($folder);
$PAGE->set_secondary_active_tab('modulepage');
$PAGE->add_body_class('limitedwidth');

$data = new stdClass();
$data->id = $cm->id;
Expand Down
1 change: 1 addition & 0 deletions mod/folder/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($folder);

$PAGE->add_body_class('limitedwidth');

$output = $PAGE->get_renderer('mod_folder');

Expand Down
1 change: 1 addition & 0 deletions mod/forum/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function($exportdata) use ($fields, $striphtml, $humandates, $canviewfullname, $
$PAGE->set_url($url);
$PAGE->set_title($pagetitle);
$PAGE->set_pagelayout('admin');
$PAGE->add_body_class('limitedwidth');
$PAGE->set_heading($pagetitle);

echo $OUTPUT->header();
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$PAGE->set_url($url);
$PAGE->force_settings_menu();
$PAGE->set_secondary_active_tab('modulepage');
$PAGE->add_body_class('limitedwidth');

if ($mode != get_user_preferences('lesson_view', 'collapsed') && $mode !== 'single') {
set_user_preference('lesson_view', $mode);
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/editpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
$PAGE->set_url('/mod/lesson/editpage.php', array('pageid'=>$pageid, 'id'=>$id, 'qtype'=>$qtype));
$PAGE->set_pagelayout('admin');
$PAGE->set_secondary_active_tab('modulepage');
$PAGE->add_body_class('limitedwidth');

if ($edit) {
$editpage = lesson_page::load($pageid, $lesson);
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
$PAGE->navbar->add($strimportquestions);
$PAGE->set_title($strimportquestions);
$PAGE->set_heading($course->fullname);
$PAGE->add_body_class('limitedwidth');
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($lesson->name), 2);
echo $OUTPUT->heading_with_help($strimportquestions, 'importquestions', 'lesson', '', '', 3);
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/overridedelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
$PAGE->add_body_class('limitedwidth');
$PAGE->navbar->add($title);
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/overrideedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
$PAGE->navbar->add($pagetitle);
$PAGE->set_pagelayout('admin');
$PAGE->set_secondary_active_tab('mod_lesson_useroverrides');
$PAGE->add_body_class('limitedwidth');
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/overrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

// Display a list of overrides.
$PAGE->set_pagelayout('admin');
$PAGE->add_body_class('limitedwidth');
$PAGE->set_title(get_string('overrides', 'lesson'));
$PAGE->set_heading($course->fullname);

Expand Down
1 change: 1 addition & 0 deletions mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
}
$PAGE->set_url($url);
$PAGE->force_settings_menu();
$PAGE->add_body_class('limitedwidth');

$context = $lesson->context;
$canmanage = $lesson->can_manage();
Expand Down
1 change: 1 addition & 0 deletions mod/page/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
$PAGE->set_title($course->shortname.': '.$page->name);
$PAGE->set_heading($course->fullname);
} else {
$PAGE->add_body_class('limitedwidth');
$PAGE->set_title($course->shortname.': '.$page->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($page);
Expand Down
1 change: 1 addition & 0 deletions mod/quiz/attempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@

$headtags = $attemptobj->get_html_head_contributions($page);
$PAGE->set_title($attemptobj->attempt_page_title($page));
$PAGE->add_body_class('limitedwidth');
$PAGE->set_heading($attemptobj->get_course()->fullname);

if ($attemptobj->is_last_page($page)) {
Expand Down
1 change: 1 addition & 0 deletions mod/quiz/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
// End of process commands =====================================================.

$PAGE->set_pagelayout('incourse');
$PAGE->add_body_class('limitedwidth');
$PAGE->set_pagetype('mod-quiz-edit');

$output = $PAGE->get_renderer('mod_quiz', 'edit');
Expand Down
Loading

0 comments on commit 946fd91

Please sign in to comment.