<h2>Pending Offers</h2>
<% if $PendingOffers %>
    <table class="table-show table-show-header hidden-xs">
        <thead>
        <tr>
            <th>Show Name</th>
            <th>Performer Name</th>
            <th>
                Status
                <div class="table-tooltip">
                    <div class="table-tooltip-label">?</div>
                    <div class="table-tooltip-content">
                        <p>If you are happy with the venue offer, please click the tick button below. If there is a reason why this venue offer is unsuitable, please click the cross button and give your reasons why.</p>
                        <p>If your offer is ‘pending’ it means you have accepted an offer but are waiting for your season to be confirmed by the Comedy Festival administration team.</p>
                    </div>
                </div>
            </th>
        </tr>
        </thead>
    </table>
    <% loop $PendingOffers %>
    <table class="table-show hidden-xs">
        <tr class="table-show-toggler accordion-toggler" data-accordion-toggle="accordion-$Pos">
            <td><span class="charcoal">$ShowPageTitle</span></td>
            <td>$ShowPagePerformers</td>
            <td>
                $FrontEndStatus
                <div class="icon">
                    $SVG('plus-circle').Size('28','28')
                    <div class="sr-only">Toggle</div>
                </div>
            </td>
        </tr>
    </table>
    <table class="table-show visible-xs">
        <tr class="table-show-toggler accordion-toggler" data-accordion-toggle="accordion-m-$Pos">
            <td>
                <span class="charcoal">$ShowPageTitle</span><br/>
                $ShowPagePerformers<br/>
                $FrontEndStatus
                <div class="icon">
                    $SVG('plus-circle').Size('28','28')
                    <div class="sr-only">Toggle</div>
                </div>
            </td>
        </tr>
    </table>
    <table class="table-show table-show-content accordion-content hidden-xs" id="accordion-$Pos">
        <tr>
            <th>Location</th>
            <th>Venue</th>
            <th>Date</th>
            <th>Time</th>
        </tr>
        <% loop $Sessions %>
            <tr>
                <td><span>$getDraftOrLiveVenue.City.Location.Title</span></td>
                <td>$getDraftOrLiveVenue.Title</td>
                <td>$StartTime.FormatPHP('D d F Y')</td>
                <td>$StartTime.FormatPHP('g:ia')</td>
            </tr>
        <% end_loop %>
        <% if $Status == 'Offered' %>
            <tr class="table-show-actions">
                <td colspan="2">Please accept or decline your show offer</td>
                <td class="text-right" colspan="2">
                    <% if $Top.OfferResponseForm($ID) %>
                        <% with $Top.OfferResponseForm($ID) %>
                            <form $AttributesHTML>
                                <div class="btn-group">
                                    $fields.dataFieldByName('OfferID')
                                    <button name="action_doAccept" class="btn btn-green btn-sm" id="OfferResponseForm_OfferResponseForm_action_doAccept">Accept</button>
                                    <span class="btn btn-pink btn-sm lg-modal" data-modal="#pending-offer-$Up.ID">Decline</span>
                                    $fields.dataFieldByName('SecurityID')
                                </div>
                                <div class="modal-wrap dashboard-offer-modal" id="pending-offer-$Up.ID" aria-hidden="true">
                                    <div class="modal">
                                        <div class="modal-content">
                                            <h2>Decline Offer</h2>
                                            <p>You have choosen to decline this offer. Please provide a reason for why you declined so we can do our best to provide you with a more suitable offer.</p>
                                            <div class="form-group">
                                                $fields.dataFieldByName('Message')
                                                <%--<textarea name="Message" class="form-control" placeholder="Reason for declining this offer" required></textarea>--%>
                                            </div>
                                            <div class="form-submit">
                                                <%--<button class="btn btn-yellow btn-block">Decline offer</button>--%>
                                                <button name="action_doDecline" class="btn btn-yellow btn-block" id="OfferResponseForm_OfferResponseForm_action_doDecline">Decline</button>
                                            </div>
                                            <div class="modal-close">
                                                $SVG('modal-close').Size('21','21')
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        <% end_with %>
                    <% end_if %>
                </td>
            </tr>
        <% end_if %>
    </table>
    <table class="table-show table-show-content accordion-content" id="accordion-m-$Pos">
        <% loop $Sessions %>
            <tr>
                <td>
                    <span>$getDraftOrLiveVenue.City.Location.Title</span><br/>
                    $getDraftOrLiveVenue.Title<br/>
                    $StartTime.FormatPHP('D d F Y')<br/>
                    $StartTime.FormatPHP('g:ia')
                </td>
            </tr>
        <% end_loop %>
        <% if $Status == 'Offered' %>
            <tr class="table-show-actions">
                <td>
                    Please accept or decline your show offer
                    <% if $Top.OfferResponseForm($ID) %>
                        <% with $Top.OfferResponseForm($ID) %>
                            <form $AttributesHTML>
                                <div class="btn-group">
                                    $fields.dataFieldByName('OfferID')
                                    <button name="action_doAccept" class="btn btn-green btn-sm" id="OfferResponseForm_OfferResponseForm_action_doAccept">Accept</button>
                                    <button name="action_doDecline" class="btn btn-pink btn-sm lg-modal" id="OfferResponseForm_OfferResponseForm_action_doDecline" data-modal="#pending-offer-m-$Pos">Decline</button>
                                    $fields.dataFieldByName('SecurityID')
                                </div>
                                <div class="modal-wrap dashboard-offer-modal" id="pending-offer-m-$Pos" aria-hidden="true">
                                    <div class="modal">
                                        <div class="modal-content">
                                            <h2>Decline Offer</h2>
                                            <p>You have choosen to decline this offer. Please provide a reason for why you declined so we can do our best to provide you with a more suitable offer.</p>
                                            <div class="form-group">
                                                $fields.dataFieldByName('Message')
                                            </div>
                                            <div class="form-submit">
                                                <button name="action_doDecline" class="btn btn-yellow btn-block" id="OfferResponseForm_OfferResponseForm_action_doDecline">Decline</button>
                                            </div>
                                            <div class="modal-close">
                                                $SVG('modal-close').Size('21','21')
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        <% end_with %>
                    <% end_if %>
                </td>
            </tr>
        <% end_if %>
    </table>
<% end_loop %>
<% else %>
    <p>You do not have any pending offers.</p>
<% end_if %>