2 This file is part of Moodle - http://moodle.org/
4 Moodle is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 Moodle is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 @template mod_lti/registration_upgrade_choice_page.mustache
20 This template provides the layout to display the upgrade choices
21 available when registering a tool for which there exists at least
22 one other tool with the same domain.
24 Classes required for JS:
27 Data attributes required for JS:
30 Context variables required for this template:
31 * startregurlenc: the URL provided by the tool to start the registration, url encoded
32 * tools: the list of tools matching the domain
34 Example context (json):
36 "startregurlenc":"https%3A%2F%2Fmytool.example%2Fregister",
40 "name": "This is My LTI 1.1 tool",
41 "baseurl": "https://mytool.example",
49 <p>{{#str}}dynreg_update_text, mod_lti {{/str}}</p>
50 <div class="alert alert-warning" role="alert">
51 {{#str}}dynreg_update_warn_dupdomain, mod_lti {{/str}}
53 <table class="table table-striped">
55 <th>{{#str}}dynreg_update_name, mod_lti {{/str}}</th>
56 <th>{{#str}}dynreg_update_url, mod_lti {{/str}}</th>
57 <th>{{#str}}dynreg_update_version, mod_lti {{/str}}</th>
64 <td>{{ltiversion}}</td>
65 <td><button data-href="startltiadvregistration.php?url={{startregurlenc}}&type={{id}}" class="btn btn-outline-primary">
66 <span class="btn-loader">{{> mod_lti/loader }}</span>
67 {{#str}}dynreg_update_btn_update, mod_lti {{/str}}
74 {{#str}}dynreg_update_notools, mod_lti {{/str}}
77 <button data-href="startltiadvregistration.php?url={{startregurlenc}}&type=0" class="btn btn-primary">
78 <span class="btn-loader">{{> mod_lti/loader }}</span>
79 {{#str}}dynreg_update_btn_new, mod_lti {{/str}}
82 <form method="POST" id="startregform">
83 <input type="hidden" name="sesskey" value="{{sesskey}}"/>
87 document.querySelectorAll("button").forEach(e=>e.setAttribute("disabled", true));
88 e.target.querySelector("span.btn-loader").style.display="inline";
89 let form = document.getElementById("startregform");
90 form.action = e.target.getAttribute("data-href");
93 document.querySelectorAll("button").forEach(b=>b.onclick=disableAndGo);