% rebase('webpage_base.tpl')

<div class="mt-3">
    <div class="row">
        <div class="col-auto me-auto pt-3">
            <p id="timing-container">Loading...</p>
        </div>
        <div class="col-auto">
            <p class="d-inline-flex gap-1">
                <button id="filters-button" type="button" class="btn btn-outline-primary" data-bs-toggle="button" onclick="toggleFiltersPanel();"><i class="fa-solid fa-filter"></i> Filters</button>
                <button id="display-button" type="button" class="btn btn-outline-primary" data-bs-toggle="button" onclick="toggleDisplayPanel();"><i class="fa-solid fa-desktop"></i> Display</button>
            </p>
        </div>
    </div>

    <div id="filters-area" class="appearing-panel card mb-3">
        <div class="card-header text-white bg-primary">
            <div class="row">
                <div class="col-auto me-auto">
                    Filters
                </div>
                <div class="col-auto d-inline-flex">
                    <button id="close-filters-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeFiltersPanel();"></button>
                </div>
            </div>

        </div>
        <div class="card-body">
            <div class="row row-cols-1 row-cols-md-3 g-4">
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">DX Continent</h5>
                            <p id="dx-continent-options" class="card-text spothole-card-text"></p>
                        </div>
                    </div>
                </div>
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">Sources</h5>
                            <p id="source-options" class="card-text spothole-card-text"></p>
                        </div>
                    </div>
                </div>
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">Duration Limit <i class='fa-solid fa-circle-question' title='Some users create long-duration alerts for the period they will be generally in and around xOTA references, when they are not indending to be on the air most of the time. Use this control to restrict the maximum duration of spots that the software will display, and exclude any with a long duration, to avoid these filling up the list. By default, we allow DXpeditions to be displayed even if they are longer than this limit, because on a DXpedition the operators typically ARE on the air most of the time.'></i></h5>
                            <p class="card-text spothole-card-text">
                                Hide any alerts lasting more than:<br/>
                                <select id="max-duration" class="storeable-select form-select" onclick="filtersUpdated();" style="width: 8em; display: inline-block;">
                                    <option value="10800">3 hours</option>
                                    <option value="43200">12 hours</option>
                                    <option value="86400" selected>24 hours</option>
                                    <option value="604800">1 week</option>
                                    <option value="2419200">4 weeks</option>
                                    <option value="9999999999">No limit</option>
                                </select>
                            </p>
                            <p class='card-text spothole-card-text' style='line-height: 1.5em !important;'>
                                <input class="form-check-input storeable-checkbox" type="checkbox" value="" onclick="filtersUpdated();" id="dxpeditions_skip_max_duration_check" checked><label class="form-check-label ms-2" for="dxpeditions_skip_max_duration_check">Allow DXpeditions that are longer</label>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="display-area" class="appearing-panel card mb-3">
        <div class="card-header text-white bg-primary">
            <div class="row">
                <div class="col-auto me-auto">
                    Display
                </div>
                <div class="col-auto d-inline-flex">
                    <button id="close-display-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeDisplayPanel();"></button>
                </div>
            </div>

        </div>
        <div class="card-body">
            <div id="display-container" class="row row-cols-1 row-cols-md-3 g-4">
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">Time Zone</h5>
                            <p class="card-text spothole-card-text"> Use
                                <select id="timeZone" class="storeable-select form-select ms-2 me-2 d-inline-block" oninput="timeZoneUpdated();" style="width: 8em; display: inline-block;">
                                    <option value="UTC" selected>UTC</option>
                                    <option value="local">Local time</option>
                                </select>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">Number of Alerts</h5>
                            <p class="card-text spothole-card-text">Show up to
                                <select id="alerts-to-fetch" class="storeable-select form-select ms-2" oninput="filtersUpdated();"  style="width: 5em;display: inline-block;">
                                    <option value="25">25</option>
                                    <option value="50">50</option>
                                    <option value="100" selected>100</option>
                                    <option value="200">200</option>
                                    <option value="500">500</option>
                                </select>
                                alerts
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">Table Data</h5>
                            <div class="form-group">
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowStartTime" value="tableShowStartTime" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowStartTime">Start Time</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowEndTime" value="tableShowEndTime" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowEndTime">End Time</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowDX" value="tableShowDX" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowDX">DX</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowFreqsModes" value="tableShowFreqsModes" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowFreqsModes">Frequencies & Modes</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowComment" value="tableShowComment" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowComment">Comment</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowSource" value="tableShowSource" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowSource">Source</label>
                                </div>
                                <div class="form-check form-check-inline">
                                  <input class="form-check-input storeable-checkbox" type="checkbox" id="tableShowRef" value="tableShowRef" oninput="columnsUpdated();" checked>
                                  <label class="form-check-label" for="tableShowRef">Ref.</label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="table-container"></div>

</div>

<script src="/js/common.js"></script>
<script src="/js/alerts.js"></script>
<script>$(document).ready(function() { $("#nav-link-alerts").addClass("active"); }); <!-- highlight active page in nav --></script>