diff --git a/badges/classes/output/external_backpacks_page.php b/badges/classes/output/external_backpacks_page.php index 28da925df37..32c38db0a54 100644 --- a/badges/classes/output/external_backpacks_page.php +++ b/badges/classes/output/external_backpacks_page.php @@ -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); diff --git a/badges/templates/external_backpacks_page.mustache b/badges/templates/external_backpacks_page.mustache index 0f9df010051..bfdcc5ec06c 100644 --- a/badges/templates/external_backpacks_page.mustache +++ b/badges/templates/external_backpacks_page.mustache @@ -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 @@ {{{backpackweburl}}} {{#sitebackpack}}Yes{{/sitebackpack}} - {{#canedit}} {{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}} - {{/canedit}} {{^iscurrent}} {{#pix}}t/delete, core,{{#str}}delete{{/str}}{{/pix}} diff --git a/badges/tests/behat/backpack.feature b/badges/tests/behat/backpack.feature index 67376f0f345..ea02aa70986 100644 --- a/badges/tests/behat/backpack.feature +++ b/badges/tests/behat/backpack.feature @@ -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