mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-73697 core_courseformat: fix weeks format this week badge
This commit is contained in:
parent
4f9a539600
commit
d7df919a2c
4 changed files with 28 additions and 3 deletions
|
@ -138,6 +138,7 @@ class section implements renderable, templatable {
|
||||||
'summary' => $summary->export_for_template($output),
|
'summary' => $summary->export_for_template($output),
|
||||||
'availability' => $availability->export_for_template($output),
|
'availability' => $availability->export_for_template($output),
|
||||||
'restrictionlock' => !empty($thissection->availableinfo),
|
'restrictionlock' => !empty($thissection->availableinfo),
|
||||||
|
'highlightedlabel' => $format->get_section_highlighted_name(),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Check if it is a stealth sections (orphaned).
|
// Check if it is a stealth sections (orphaned).
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
"controlmenu": "[tools menu]",
|
"controlmenu": "[tools menu]",
|
||||||
"header": {
|
"header": {
|
||||||
"name": "Section title",
|
"name": "Section title",
|
||||||
|
"title": "<a href=\"http://moodle/course/view.php?id=5#section-0\">Section title</a>",
|
||||||
"url": "#",
|
"url": "#",
|
||||||
"ishidden": true
|
"ishidden": true
|
||||||
},
|
},
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
},
|
},
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"module": "forum",
|
"module": "forum",
|
||||||
|
"anchor": "activity-3",
|
||||||
"extraclasses": "newmessages"
|
"extraclasses": "newmessages"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -49,6 +51,7 @@
|
||||||
"hasname": "true"
|
"hasname": "true"
|
||||||
},
|
},
|
||||||
"id": 4,
|
"id": 4,
|
||||||
|
"anchor": "activity-4",
|
||||||
"module": "assign",
|
"module": "assign",
|
||||||
"extraclasses": ""
|
"extraclasses": ""
|
||||||
}
|
}
|
||||||
|
@ -76,7 +79,8 @@
|
||||||
"contentcollapsed": false,
|
"contentcollapsed": false,
|
||||||
"insertafter": true,
|
"insertafter": true,
|
||||||
"numsections": 42,
|
"numsections": 42,
|
||||||
"sitehome": false
|
"sitehome": false,
|
||||||
|
"highlightedlabel" : "Highlighted"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
<li id="section-{{num}}"
|
<li id="section-{{num}}"
|
||||||
|
|
|
@ -25,11 +25,12 @@
|
||||||
{
|
{
|
||||||
"highlighted" : "1",
|
"highlighted" : "1",
|
||||||
"hiddenfromstudents" : "1",
|
"hiddenfromstudents" : "1",
|
||||||
"notavailable" : "0"
|
"notavailable" : "0",
|
||||||
|
"highlightedlabel" : "Highlighted"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{{#highlighted}}
|
{{#highlighted}}
|
||||||
<span class="badge badge-pill badge-primary order-1" data-type="highlighted">{{#str}}highlighted{{/str}}</span>
|
<span class="badge badge-pill badge-primary order-1" data-type="highlighted">{{ highlightedlabel }}</span>
|
||||||
{{/highlighted}}
|
{{/highlighted}}
|
||||||
{{#hiddenfromstudents}}
|
{{#hiddenfromstudents}}
|
||||||
<span class="badge badge-pill badge-warning order-2" data-type="hiddenfromstudents">{{#str}}hiddenfromstudents{{/str}}</span>
|
<span class="badge badge-pill badge-warning order-2" data-type="hiddenfromstudents">{{#str}}hiddenfromstudents{{/str}}</span>
|
||||||
|
|
19
course/format/weeks/tests/behat/current_week.feature
Normal file
19
course/format/weeks/tests/behat/current_week.feature
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
@format @format_weeks
|
||||||
|
Feature: The current week should be highlighted in the course.
|
||||||
|
In order to know which is the current week
|
||||||
|
As a user
|
||||||
|
I need to see the current week highlighted
|
||||||
|
|
||||||
|
Scenario: Highlight first week
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | format | coursedisplay | numsections | startdate |
|
||||||
|
| Course 1 | C1 | weeks | 0 | 5 | ##today## |
|
||||||
|
When I am on the "C1" "Course" page logged in as "admin"
|
||||||
|
Then I should see "This week" in the "#section-1" "css_element"
|
||||||
|
|
||||||
|
Scenario: Highlight next week
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | format | coursedisplay | numsections | startdate |
|
||||||
|
| Course 1 | C1 | weeks | 0 | 5 | ##monday last week## |
|
||||||
|
When I am on the "C1" "Course" page logged in as "admin"
|
||||||
|
Then I should see "This week" in the "#section-2" "css_element"
|
Loading…
Add table
Add a link
Reference in a new issue