@page
@model ZpcBulletinBoard.Pages.BoardsLinks.IndexModel

@{
    ViewData["Title"] = "Oglasne deske - Povezave";
    Layout = "~/Pages/Layouts/_Layout.cshtml";
}

@section Styles
{
    <link rel="stylesheet" href="~/css/boards-links/index.css" asp-append-version="true" />
}

<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
    <span>
        <span class="text-muted font-weight-light">
            <i>Oglasne deske</i>
            /</span> Povezave
    </span>
</h4>

<div class="card">
    <div class="header">
        <div class="div-content">
            <div class="div-content-boards">
                <input id="inpSearchBoard" class="form-control form-control-sm" placeholder="Iskanje oglasnik desk..." />
            </div>
            <div class="div-content-pages">
                <input id="inpSearchPage" class="form-control form-control-sm" placeholder="Iskanje strani..." />
            </div>
        </div>
    </div>
    <div class="div-content main-content">
        <div class="div-content-boards boards-content">
@*             @foreach (var board in Model.Boards)
            {
                <div class="div-board">
                    <h5>@board.Name</h5>
                </div>
                <div class="div-pages" ondrop="dropPage(event, this)" ondragover="allowDropPage(event, this)" data-idboard="@board.IdBulletinBoard">
                    
                </div>
                <hr/>
            } *@
        </div>
        <div class="div-content-pages">
            <div class="div-available-pages">
                @foreach (var tmpPage in Model.Pages)
                {
                    <div class="div-page available-page" draggable="true" ondragstart="dragPage(event, this)" data-id="@tmpPage.IdBulletinBoardPage">
                        @if ((int)tmpPage.Type == 3)
                        {
                            <div class='img-link'><i class="fas fa-link fa-5x"></i></div>
                        }
                        else
                        {
                            <img class="img-thumbnail rounded" src="/bulletin-board-images/pages/@tmpPage.Image" onerror="this.src='/img/imgNotExists.jpg'" alt="page image" />

                        }
                        <small>@tmpPage.Name</small>
                        <div class="tools">
                            @* <a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless"><i class="fas fa-reply"></i></a> *@
                            <a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless" onclick="addPageToAllBoards(this)"><i class="fas fa-reply-all"></i></a>
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
</div>

@Html.AntiForgeryToken()

@section Scripts {
    <script src="~/js/boards-links/index.js" asp-append-version="true"></script>
}