<section class="dashboard-page">
    <div class="container">
        <div class="row">
            <div class="col-sm-3 hidden-xs">
                <% include Dashboard_SideNav %>
            </div>
            <div class="col-sm-9">
                <div class="dashboard-page-content">
                    <article>
                        <h1>Application form.</h1>
                        $ApplicationContent
                    </article>
                    <% if $ApplicationRequests %>
                    <div class="applications-table table-show-container">
                        <h2>Current Applications</h2>
                        <table class="hidden-xs">
                            <thead>
                            <tr>
                                <th>Comedian name</th>
                                <th>Show name</th>
                                <th>Submitted</th>
                                <th>Status</th>
                                <th>&nbsp;</th>
                            </tr>
                            </thead>
                            <tbody>
                                <% loop $ApplicationRequests %>
                                    <tr>
                                        <td><span class="charcoal">$FormattedPerformers</span></td>
                                        <td>$ShowTitle</td>
                                        <td>$Created.FormatPHP('d/m/Y')</td>
                                        <td>$FrontEndStatus</td>
                                        <td>
                                        <% if $Status == 'Draft' %>
                                            <a class="uppercase" href="$Top.Link('application_form')?applicationID={$ID}"><strong>OPEN</strong></a>
                                        <% end_if %>
                                        </td>
                                    </tr>
                                <% end_loop %>
                            </tbody>
                        </table>
                        <table class="visible-xs">
                            <tbody>
                                <% loop $ApplicationRequests %>
                                <tr>
                                    <td>
                                        <span class="charcoal">$ShowTitle</span><br/>
                                        $FormattedPerformers<br/>
                                        <span class="charcoal">$Created.FormatPHP('d/m/Y')</span>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <div class="cell-left-right">
                                            <div class="cell-left">
                                                Status
                                            </div>
                                            <div class="cell-right">
                                                $FrontEndStatus
                                            <% if $Status == 'Draft' %>
                                                <a class="uppercase" href="$Top.Link('application_form')?applicationID={$ID}"><strong>OPEN</strong></a>
                                            </div>
                                        </div>
                                    <% end_if %>
                                    </th>
                                </tr>
                                <% end_loop %>
                            </tbody>
                        </table>
                    </div>
                    <% end_if %>
                    <% if $SiteConfig.ShowApplications == 1 %>
                    <div class="btn-group">
                        <%-- TODO UnComment when requested by the AM --%>
                        <a class="btn btn-yellow" href="{$Link('application_form')}">New application</a>
                        <% if $ApplicationRequests %>
                        <div class="btn btn-grey reveal-btn" data-reveal="previous-applications">Show previous applications</div>
                        <% end_if %>
                    </div>
                    <% end_if %>
                    <% if $ApplicationRequests %>
                    <div class="applications-table table-show-container reveal-content" id="previous-applications">
                        <h2>Previous Applications</h2>
                        <table class="hidden-xs">
                            <thead>
                            <tr>
                                <th>Comedian name</th>
                                <th>Show name</th>
                                <th>Submitted</th>
                                <th>Status</th>
                                <th>&nbsp;</th>
                            </tr>
                            </thead>
                            <tbody>
                            <% loop $ApplicationRequests %>
                                <tr>
                                    <td><span class="charcoal">$FormattedPerformers</span></td>
                                    <td>$ShowTitle</td>
                                    <td>$Created.FormatPHP('d/m/Y')</td>
                                    <td>$FrontEndStatus</td>
                                    <td>
                                        <% if $Status == 'Draft' %>
                                            <a class="uppercase" href="$Top.Link('application_form')?applicationID={$ID}"><strong>OPEN</strong></a>
                                        <% end_if %>
                                    </td>
                                </tr>
                            <% end_loop %>
                            </tbody>
                        </table>
                        <table class="visible-xs">
                            <tbody>
                                <% loop $ApplicationRequests %>
                                <tr>
                                    <td>
                                        <span class="charcoal">$ShowTitle</span><br/>
                                        $FormattedPerformers<br/>
                                        <span class="charcoal">$Created.FormatPHP('d/m/Y')</span>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <div class="cell-left-right">
                                            <div class="cell-left">
                                                $FrontEndStatus
                                            </div>
                                            <div class="cell-right">
                                                <% if $Status == 'Draft' %>
                                                    <a class="uppercase" href="$Top.Link('application_form')?applicationID={$ID}"><strong>OPEN</strong></a>
                                                <% end_if %>
                                            </div>
                                        </div>
                                    </th>
                                </tr>
                                <% end_loop %>
                            </tbody>
                        </table>
                    </div>
                    <% end_if %>
                </div>
            </div>
        </div>
    </div>
</section>
