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

This commit is contained in:
Mihail Geshoski
2025-09-10 17:44:24 +08:00
5 changed files with 43 additions and 7 deletions
@@ -69,7 +69,9 @@ class manage_badge_action_bar extends base_action_bar {
$elements['button'] = new single_button(new moodle_url('/badges/index.php', $params), get_string('back'), 'get');
$badgenav = $this->generate_badge_navigation();
if ($badgenav) {
$elements['urlselect'] = new url_select($badgenav, $this->page->url->out(false), null);
$badgenavselect = new url_select($badgenav, $this->page->url->out(false), null);
$badgenavselect->set_label(get_string('badgesnavigation', 'badges'), ['class' => 'visually-hidden']);
$elements['urlselect'] = $badgenavselect;
}
foreach ($elements as $key => $element) {
$elements[$key] = $element->export_for_template($output);
+16 -6
View File
@@ -195,12 +195,22 @@ class core_badges_renderer extends plugin_renderer_base {
$display .= $this->heading(get_string('issuerdetails', 'badges'), 3);
$dl = array();
$dl[get_string('issuername', 'badges')] = $badge->issuername;
$dl[get_string('contact', 'badges')] = html_writer::tag('a', $badge->issuercontact, array('href' => 'mailto:' . $badge->issuercontact));
$dl[get_string('issuerurl', 'badges')] = html_writer::tag(
'a',
$badge->issuerurl,
['href' => $badge->issuerurl, 'target' => '_blank'],
);
$dl[get_string('contact', 'badges')] = '';
if (trim($badge->issuercontact)) {
$dl[get_string('contact', 'badges')] = html_writer::tag(
'a',
$badge->issuercontact,
['href' => 'mailto:' . $badge->issuercontact],
);
}
$dl[get_string('issuerurl', 'badges')] = '';
if (trim($badge->issuerurl)) {
$dl[get_string('issuerurl', 'badges')] = html_writer::tag(
'a',
$badge->issuerurl,
['href' => $badge->issuerurl, 'target' => '_blank'],
);
}
$display .= $this->definition_list($dl);
// Issuance details if any.
+21
View File
@@ -0,0 +1,21 @@
@core @core_badges
Feature: Badge overview
In order to view a badge's information
As an user with the capability to view badges
I need to access the badge overview page
Background:
Given the following config values are set as admin:
| badges_defaultissuername | Test Badge Site |
@javascript @accessibility @_file_upload
Scenario: Test accessibility of badge overview page
Given I log in as "admin"
And I navigate to "Badges > Add a new badge" in site administration
And I set the following fields to these values:
| Name | Cool badge |
| Description | Badge for cool people |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
When I select "Overview" from the "Badges navigation" singleselect
Then the "region-main" "region" should meet accessibility standards with "best-practice" extra tests
+2
View File
@@ -23,6 +23,7 @@ Feature: Display badges
And I log in as "admin"
And I navigate to "Badges > Manage badges" in site administration
@accessibility
Scenario: Display badge without expired date
# Enable the badge.
Given I press "Enable access" action in the "Testing system badge" report row
@@ -43,6 +44,7 @@ Feature: Display badges
And I follow "More details"
And I should see "Catalan"
And I should see "1.1"
And the page should meet accessibility standards with "best-practice" extra tests
Scenario: Display badge with ALL criteria
# Add another criterion and enable the badge.
+1
View File
@@ -145,6 +145,7 @@ $string['backpackapiurl'] = 'Backpack API URL';
$string['backpackweburl'] = 'Backpack URL';
$string['backpackprovider'] = 'Backpack provider';
$string['badges'] = 'Badges';
$string['badgesnavigation'] = 'Badges navigation';
$string['badgedetails'] = 'Badge details';
$string['badgeimage'] = 'Image';
$string['badgeimageinfo'] = 'For best results, upload a square image with a minimum size of 300 x 300 pixels.';