Merge branch 'MDL-85511-main' of https://github.com/lucaboesch/moodle

This commit is contained in:
Huong Nguyen
2025-10-21 09:44:36 +07:00
3 changed files with 20 additions and 1 deletions
@@ -154,11 +154,17 @@ class manage_categories_action_bar implements \renderable {
* - renderedcontent Rendered content to be displayed in line with the tertiary nav
*/
public function export_for_template(\renderer_base $output): array {
return [
$data = [
'urlselect' => $this->get_dropdown($output),
'categoryselect' => $this->get_category_select($output),
'search' => $this->get_search_form(),
'heading' => $this->heading,
];
if ($this->searchvalue !== '') {
$backbutton = new \single_button(new moodle_url('/course/management.php'), get_string('back'), 'get');
$data['backbutton'] = $backbutton->export_for_template($output);
}
return $data;
}
}
@@ -78,6 +78,12 @@
"helpicon":false,
"attributes":[]
},
"backbutton": {
"url": "https://moodle.local/course/management.php",
"icon": "",
"title": "Back",
"classes": "btn btn-secondary"
},
"search": {
"action": "https://moodle.local/admin/search.php",
"extraclasses": "my-2",
@@ -109,6 +115,11 @@
{{> core/url_select }}
</div>
{{/categoryselect}}
{{#backbutton}}
<div class="navitem">
{{> core/single_button }}
</div>
{{/backbutton}}
{{#search}}
<div class="navitem ms-auto">
{{> core/search_input }}
@@ -20,12 +20,14 @@ Feature: Courses can be searched for and moved in bulk.
Scenario: Search courses finds correct results
Given I log in as "admin"
And I go to the courses management page
And I should not see "Back" in the "region-main" "region"
When I set the field "Search" to "Biology"
And I press "Search"
Then I should see "Biology Y1"
And I should see "Biology Y2"
And I should not see "English Y1"
And I should not see "English Y2"
And I should see "Back" in the "region-main" "region"
Scenario: Search courses displays contact names
Given the following "users" exist: