MDL-70801 core_my: Add a new courses page

This commit is contained in:
Mathew May 2021-10-21 12:13:36 +08:00
parent c69c33b14d
commit 6ca9c2154a
33 changed files with 417 additions and 51 deletions

View file

@ -64,10 +64,9 @@ class boostnavbar implements \renderable {
// Set the designated one path for courses.
$mycoursesnode = $this->get_item('mycourses');
if (!is_null($mycoursesnode)) {
// TODO: Once MDL-70801 lands point this to the new page.
$url = new \moodle_url('/course/');
$url = new \moodle_url('/my/courses.php');
$mycoursesnode->action = $url;
$mycoursesnode->text = get_string('courses');
$mycoursesnode->text = get_string('mycourses');
}
$this->remove_no_link_items();

View file

@ -78,6 +78,12 @@ $THEME->layouts = [
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My courses page.
'mycourses' => array(
'file' => 'columns2.php',
'regions' => array('content'),
'defaultregion' => 'content',
),
// My dashboard page.
'mydashboard' => array(
'file' => 'columns2.php',

View file

@ -49,6 +49,7 @@ $string['rawscss_desc'] = 'Use this field to provide SCSS or CSS code which will
$string['rawscsspre'] = 'Raw initial SCSS';
$string['rawscsspre_desc'] = 'In this field you can provide initialising SCSS code, it will be injected before everything else. Most of the time you will use this setting to define variables.';
$string['region-side-pre'] = 'Right';
$string['region-content'] = 'Content';
$string['showfooter'] = 'Show footer';
$string['privacy:metadata:preference:draweropennav'] = 'The user\'s preference for hiding or showing the drawer menu navigation.';
$string['privacy:drawernavclosed'] = 'The current preference for the navigation drawer is closed.';

View file

@ -2875,3 +2875,13 @@ body.dragging {
}
}
}
.page-mycourses {
#region-main {
padding: 0;
}
#region-main,
.block_myoverview {
border: 0;
}
}

View file

@ -12211,6 +12211,13 @@ body.dragging .dragging {
.collapse-list .collapse-list-item-content .collapse-list-item {
padding-left: calc(1rem * 3); }
.page-mycourses #region-main {
padding: 0; }
.page-mycourses #region-main,
.page-mycourses .block_myoverview {
border: 0; }
.icon {
font-size: 16px;
width: 16px;

View file

@ -72,6 +72,12 @@ $THEME->layouts = [
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My courses page.
'mycourses' => array(
'file' => 'columns.php',
'regions' => array('content'),
'defaultregion' => 'content',
),
// My dashboard page.
'mydashboard' => array(
'file' => 'columns.php',

View file

@ -12211,6 +12211,13 @@ body.dragging .dragging {
.collapse-list .collapse-list-item-content .collapse-list-item {
padding-left: calc(1rem * 3); }
.page-mycourses #region-main {
padding: 0; }
.page-mycourses #region-main,
.page-mycourses .block_myoverview {
border: 0; }
.icon {
font-size: 16px;
width: 16px;

View file

@ -43,7 +43,8 @@ class behat_theme_classic_behat_course extends behat_course {
public function i_navigate_to_course_participants() {
$coursestr = behat_context_helper::escape(get_string('courses'));
$mycoursestr = behat_context_helper::escape(get_string('mycourses'));
$xpath = "//div[contains(@class,'block')]//li[p/*[string(.)=$coursestr or string(.)=$mycoursestr]]";
$xpath = "//div[contains(@class,'block')]//li[contains(@class,'contains_branch')]" .
"[p/*[string(.)=$coursestr or string(.)=$mycoursestr]]";
$this->execute('behat_general::i_click_on_in_the', [get_string('participants'), 'link', $xpath, 'xpath_element']);
}