@using PantheonRA.WebApi.Contracts.Enums

@{ 
    var _isMobile = Request.Browser.IsMobileDevice;
}

<div class="row document-head @(_isMobile ? "hidden" : string.Empty)">

    @* SearchTerm *@
    <div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
        <div class="form-group">
            <label class="control-label">@Loc.SearchFilter</label>
            <input class="form-control search-input" name="Keywords" type="text" placeholder="@Loc.Search" autocomplete="off">
        </div>
    </div>

    @* Document type *@
    <div class="col-md-2 col-sm-4 col-xs-6">
        <div class="form-group">
            <a class="control-label text-default sortField" data-sort-column="AcDocType">
                <i class="far hidden"></i>@Loc.DocumentType
            </a>
            <select id="DocTypes" name="DocTypes" class="form-control selectpicker localStorageFilter" data-live-search="true" multiple="multiple" title="@Loc.All">
                @foreach (var item in ViewBag.DocumentTypes)
                {
                    <option value="@item.Id">@item.Value</option>
                }
            </select>
        </div>
    </div>

    @* WorkOrder status *@
    <div class="col-xs-2 hidden">
        <div class="form-group">
            <a class="control-label text-default sortField" data-sort-column="AcStatusMF">
                <i class="far hidden"></i>@Loc.WorkOrderStatus
            </a>
            <select id="Status" name="Status" class="form-control selectpicker" multiple="multiple" title="@Loc.All">
                @foreach (var item in ViewBag.StatusLookup)
                {
                    if (!String.IsNullOrEmpty(item.Id))
                    {
                        <option value="@item.Id">
                            @item.Name
                        </option>
                    }
                }
            </select>

        </div>
    </div>

    @* Ident *@
    <div class="col-md-2 col-sm-4 col-xs-6" hidden>
        <div class="form-group">
            <label class="control-label">@Loc.Ident</label>
            <select id="idents" name="Ident" class="form-control selectpicker localStorageFilter" data-live-search="true" multiple="multiple" title="@Loc.All">
                @foreach (var item in ViewBag.Idents)
                {
                    if (!String.IsNullOrEmpty(item.SetOfItem))
                    {
                        <option value="@item.SetOfItem">
                            @(item.SetOfItem + " - " + item.Name)
                        </option>
                    }
                }
            </select>
        </div>
    </div>

    @* Date from *@
    <div class="col-sm-2 col-xs-3 dateFilter">
        <div class="form-group">
            <a class="control-label text-default sortField" data-sort-column="AdDate">
                <i class="far hidden"></i>@Loc.DateFrom
            </a>
            <div class="input-group">
                <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                <input class="form-control datepicker localStorageFilter" id="dDateFrom" type="text"
                       value="@DateTime.Now.Date.AddMonths(-1).ToString(Loc.DateFormat)">
            </div>
        </div>
    </div>

    @* Date to *@
    <div class="col-sm-2 col-xs-3 dateFilter">
        <div class="form-group">
            <a class="control-label text-default sortField" data-sort-column="AdDate">
                <i class="far hidden"></i>@Loc.DateTo
            </a>
            <div class="input-group">
                <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                <input class="form-control datepicker localStorageFilter" id="dDateTo" type="text"
                       value="@DateTime.Now.Date.ToString(Loc.DateFormat)">
            </div>
        </div>
    </div>

    @* Data from daily plan *@
    <div class="col-lg-2 col-sm-4 col-xs-6 @(!PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.PRODUCTION))">
        <div class="col-xs-10">
            <div class="form-group">
                <label class="control-label">@Loc.DataFromDailyPlan</label>
                <div class="hw-switch-m-l m-t-3">
                    <input type="checkbox" class="js-switch timeRecordsSwitch" id="data-from-daily-plan" />
                </div>
            </div>
        </div>
        <div class="col-xs-2" style="height: 65px; border-left: 1px solid #ddd;padding:15px 0;">
            <a id="clear" role="button" class="btn text-default" title="@Loc.Clear">
                <i class="fas fa-broom fa-lg"></i>
            </a>
        </div>
    </div>

</div>