{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template tool_mobile/subscribe_alert

    Subscription-related alert notification for the Mobile tool.

    The purpose of this template is to render an alert with an
    optional action button (for example, to register the site or
    complete subscription details).

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
    * message A cleaned string (use clean_text()) to display.
    * extraclasses Additional classes to apply to the notification (for example "mt-4").
    * buttonstr Text for the optional action button.
    * buttonurl URL for the optional action button.
    * extrabuttonclasses Additional classes for the button element.
    * icon Optional boolean/section to indicate if the leading info icon should be displayed.
    * insettings Optional boolean. When true, the alert is wrapped in form-item markup for use in admin settings pages.

    Example context (json):
    {
        "message": "Your site is not registered in Moodle Apps Portal.",
        "extraclasses": "mt-4",
        "buttonstr": "View plans",
        "buttonurl": "https://apps.moodle.com",
        "extrabuttonclasses": "",
        "icon": true,
        "insettings": true
    }
}}
{{#insettings}}
<div class="form-item row">
    <div class="form-label col-sm-3 text-sm-end">
    </div>
    <div class="form-setting col-sm-9">
{{/insettings}}
<div class="alert alert-warning {{extraclasses}} {{^insettings}}mt-4{{/insettings}}">
    <div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between">
    <div class="d-flex align-items-center mb-3 mb-md-0">
    {{#icon}}
    <span>
    {{#pix}}{{icon}}, {{component}}{{/pix}}
    </span>
    {{/icon}}
    <span>
        {{{ message }}}
    </span>
    </div>
    {{#buttonurl}}
        <a href="{{buttonurl}}"
        class="btn button-register fw-normal flex-shrink-0 bg-warning {{extrabuttonclasses}}">{{buttonstr}}</a>
    {{/buttonurl}}
    </div>
</div>
{{#insettings}}
    </div>
</div>
{{/insettings}}