<form>
    <div class="row">
        <div class="col">
            <div class="form-group">
                <div class="custom-control custom-checkbox my-1 mr-sm-2">
                    <input type="checkbox"
                           name="filter-include-previous"
                           data-id="filter-include-previous"
                           id="filter-include-previous"
                           <%= ( filter.previous ) ? 'checked="checked"' : '' %>
                           class="custom-control-input" />
                    <label class="custom-control-label"
                           for="filter-include-previous"><%= _lc( 'INCLUDE_PREVIOUS_APPOINTMENTS' ) %></label>
                </div>
            </div>
            <% var cgs; %>
            <% for ( var gi = 0; gi < groups.length; gi++ ) {   %>

                <% cgs = groups[ gi ].getCourseCategories(); %>

                <strong><%= _lc( 'APPOINTMENT_CATEGORIES_OF_GROUP', [ groups[ gi ].getName() ] ) %></strong>

                <% for ( var cgsi = 0; cgsi < cgs.length; cgsi++ )  {   %>

                    <div class="form-group">
                        <div class="custom-control custom-checkbox my-1 mr-sm-2">
                            <input type="checkbox"
                                   data-type="appointment-category"
                                   name="selected-course-categories[]"
                                   value="<%= cgs[ cgsi ].id %>"
                                   id="<%= cgs[ cgsi ].id %>"
                                   <%= -1 === filter.disallowedCategoryIds.indexOf( cgs[ cgsi ].id ) ? 'checked="checked"' : '' %>
                                   class="custom-control-input" />
                            <label class="custom-control-label"
                                   for="<%= cgs[ cgsi ].id %>"
                                   ><%= cgs[ cgsi ].name %></label>
                        </div>
                    </div>

                <% }    %>

            <% }    %>
        </div>
    </div>
</form>