Merge branch 'MDL-60494-stray_img_end-39' of https://github.com/leonstr/moodle into...
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 8 Jul 2020 01:24:05 +0000 (09:24 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 8 Jul 2020 01:24:05 +0000 (09:24 +0800)
mod/lti/templates/tool_card.mustache

index 56b2dbc..8676816 100644 (file)
     * none
 
     Context variables required for this template:
+    * id
     * hascapabilitygroups
     * state
     ** pending|configured|rejected|unknown
     ** text
     * courseid
     * urls
-    ** course
+    ** course - optional, required if courseid > 0
     ** icon
+    ** edit
     ** publickeyset
     ** accesstoken
     ** authrequest
     * deploymentid
     * instancecount
 
+    Example context (json):
+    {
+        "id": 1,
+        "name": "Example Tool",
+        "description": "This is an example tool",
+        "platformid": "https:\/\/moodle.example.com",
+        "courseid": 0,
+        "hascapabilitygroups": false,
+        "state": {
+            "text": "Active",
+            "pending": false,
+            "configured": true,
+            "rejected": false,
+            "unknown": false
+        },
+        "urls": {
+            "icon": "https://www.example.com/icon1.png",
+            "edit": "https://www.example.com/mod/lti/typessettings.php",
+            "publickeyset": "https:\/\/moodle.example.com\/mod\/lti\/certs.php",
+            "accesstoken": "https:\/\/moodle.example.com\/mod\/lti\/token.php",
+            "authrequest": "https:\/\/moodle.example.com\/mod\/lti\/auth.php"
+        },
+        "clientid": null,
+        "deploymentid": 1,
+        "instancecount": 0
+    }
+
 }}
 <div class="tool-card" data-type-id="{{id}}" data-uniqid="{{uniqid}}"
     data-modaltitle="{{#str}} tooldetailsmodaltitle, mod_lti {{/str}}"
                     <a class="delete" href="#" title="{{#str}} delete {{/str}}">{{#pix}} t/delete, core, {{#str}} delete {{/str}}{{/pix}}</a>
                 </div>
             </div>
-            <img class="tool-card-icon" src="{{{urls.icon}}}" alt="{{name}}"></img>
+            <img class="tool-card-icon" src="{{{urls.icon}}}" alt="{{name}}">
             <div class="contenteditable-container">
                 <h4 class="name" contenteditable="true">{{name}}</h4>
                 <div class="overlay-container">{{> mod_lti/loader }}</div>