Merge branch 'MDL-69054-master' of git://github.com/sarjona/moodle

This commit is contained in:
Andrew Nicols 2020-08-20 07:28:19 +08:00
commit 0fe7780c2f
3 changed files with 3 additions and 9 deletions

View File

@ -67,11 +67,6 @@ class external_backpacks_page implements \renderable {
foreach ($this->backpacks as $backpack) {
$exporter = new backpack_exporter($backpack);
$backpack = $exporter->export($output);
if ($backpack->apiversion == OPEN_BADGES_V2 || $backpack->apiversion == OPEN_BADGES_V2P1) {
$backpack->canedit = true;
} else {
$backpack->canedit = false;
}
$backpack->cantest = ($backpack->apiversion == OPEN_BADGES_V2);
$backpack->iscurrent = ($backpack->id == $CFG->badges_site_backpack);

View File

@ -25,7 +25,7 @@
Example context (json):
{
"backpacks": [
{"backpackweburl": "http://localhost/", "sitebackpack": true, "canedit": false, "cantest": true}
{"backpackweburl": "http://localhost/", "sitebackpack": true, "cantest": true}
]
}
}}
@ -50,9 +50,7 @@
<td> {{{backpackweburl}}} </td>
<td> {{#sitebackpack}}Yes{{/sitebackpack}} </td>
<td>
{{#canedit}}
<a href="{{baseurl}}?id={{id}}&action=edit">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
{{/canedit}}
{{^iscurrent}}
<a href="{{baseurl}}?id={{id}}&action=delete" role="button" data-action="deletebackpack">
{{#pix}}t/delete, core,{{#str}}delete{{/str}}{{/pix}}

View File

@ -107,7 +107,8 @@ Feature: Backpack badges
And I set the field "backpackweburl" to "http://backpackweburl.cat"
And I press "Save changes"
Then I should see "http://backpackweburl.cat"
And "Delete" "button" should exist
And "Delete" "icon" should exist in the "http://backpackweburl.cat" "table_row"
And "Edit settings" "icon" should exist in the "http://backpackweburl.cat" "table_row"
@javascript
Scenario: Remove a site backpack