{{!
    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 mod_booking/col_availableplaces

    Classes required for JS:
    * none

    Example context (json):
    {
        "maxanswers" : {
            "booked" : "3",
            "maxanswers": "5"
        }
    }
}}
{{#showmanageresponses}}
<a href="{{{manageresponsesurl}}}" style="text-decoration: none;">
{{/showmanageresponses}}

{{! Booking places }}
{{#maxanswers}}
    <span class="col-ap-availableplaces {{#bookingplacesclass}}{{.}}{{/bookingplacesclass}}">
        {{^showbookingplacesinfotext}}
            {{#fullybooked}}
                <span class="text-danger font-weight-bold">{{booked}}</span>
            {{/fullybooked}}
            {{^fullybooked}}
                <span class="text-success font-weight-bold">{{booked}}</span>
            {{/fullybooked}}
                / {{maxanswers}}
        {{/showbookingplacesinfotext}}
        {{#showbookingplacesinfotext}}
            {{bookingplacesinfotext}}
        {{/showbookingplacesinfotext}}
    </span>
{{/maxanswers}}
{{^maxanswers}}
    <span class="text-success font-weight-bold">{{booked}}</span>
            / {{#str}} unlimitedplaces, mod_booking {{/str}}
{{/maxanswers}}

{{! Waiting list places }}
{{#maxoverbooking}}
    <span class="col-ap-waitingplacesavailable {{#waitinglistplacesclass}}{{.}}{{/waitinglistplacesclass}}">
        {{^showwaitinglistplacesinfotext}}
            ({{#str}} waitinglist, mod_booking {{/str}}: {{waiting}}/{{maxoverbooking}})
        {{/showwaitinglistplacesinfotext}}
        {{#showwaitinglistplacesinfotext}}
            {{waitinglistplacesinfotext}}
        {{/showwaitinglistplacesinfotext}}
    </span>
{{/maxoverbooking}}
{{^maxoverbooking}}
    {{#freeonwaitinglist}}
        <span class="col-ap-waitingplacesavailable {{#waitinglistplacesclass}}{{.}}{{/waitinglistplacesclass}}">
        {{^showwaitinglistplacesinfotext}}
                ({{#str}} waitinglist, mod_booking {{/str}}: {{waiting}}/{{#str}} unlimitedplaces, mod_booking {{/str}})
        {{/showwaitinglistplacesinfotext}}
        {{#showwaitinglistplacesinfotext}}
            {{waitinglistplacesinfotext}}
        {{/showwaitinglistplacesinfotext}}
        </span>
    {{/freeonwaitinglist}}
{{/maxoverbooking}}

{{#showmanageresponses}}
</a>
{{/showmanageresponses}}