<div class="mod_minilesson_credsmanager">
    <!-- If API user then show a link + js to poke creds in -->
    {{#apiuser}}<a href="#" class="cloudpoodll_poke_creds">{{#str}}fillcredentials, mod_minilesson{{/str}}</a>{{/apiuser}}
    <!-- if no API user then the user sees a link to a page which will allow them to take a free trial -->
    {{^apiuser}}
        <a href="https://poodll.com/try-poodll" target="_blank">{{#str}}freetrial, mod_minilesson{{/str}} [&#x2197;]</a>
        <!-- a href="{{{apppath}}}/fetchcbpage.php" target="_blank">{{#str}}freetrial, mod_minilesson{{/str}} [&#x2197;]</a -->
    {{/apiuser}}
</div>
{{^element.frozen}}
    {{#js}}
        require(['jquery'],function($) {
            //set up fetch from elsewhere
            $(".mod_minilesson_credsmanager .cloudpoodll_poke_creds").on("click", function() {
                event.preventDefault();
                var apiuser = document.getElementById('id_s_mod_minilesson_apiuser');
                var apisecret = document.getElementById('id_s_mod_minilesson_apisecret');
                apiuser.value='{{{apiuser}}}';
                apisecret.value='{{{apisecret}}}';
            });
        });
    {{/js}}
{{/element.frozen}}