Merge branch 'MDL-85511-500' of https://github.com/lucaboesch/moodle into MOODLE_500_STABLE

This commit is contained in:
Huong Nguyen
2025-10-21 09:44:49 +07:00
3 changed files with 21 additions and 2 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,8 +115,13 @@
{{> core/url_select }}
</div>
{{/categoryselect}}
{{#search}}
{{#backbutton}}
<div class="navitem">
{{> core/single_button }}
</div>
{{/backbutton}}
{{#search}}
<div class="navitem ms-auto">
{{> core/search_input }}
</div>
{{/search}}
+2
View File
@@ -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: