@page
@model EditMainModel
@{
    ViewData["Title"] = "Urejanje";
}

@section Styles
{
    <link rel="stylesheet" href="~/lib/summernote/summernote-bs4.css" asp-append-version="true"/>
    <link rel="stylesheet" href="~/css/editor/editor-main.css" asp-append-version="true"/>
}
<div class="fab-container-add">
    <div class="button iconbutton btn-success" onclick="addNewNote()">
        <i class="far fa-sticky-note fa-2x"></i>
    </div>
</div>

<div class="fab-container-save">
    <div class="button iconbutton btn-primary" onclick="saveNotes();">
        <i class="far fa-save fa-2x"></i>
    </div>
</div>

<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body div-main-body">
                <div class="div-pages">
                    <div class="div-board" onclick="openModalSelectBoard();">
                        <h5>Oglasna deska ni izbrana</h5>
                        <small><i class="fas fa-mouse-pointer"></i>&nbsp;Spremni oglasno desko</small>
                    </div>
                    <div class="div-page add-page" onclick="openModalBoardAddNewPage();">
                        <i class="fas fa-plus fa-2x"></i>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body div-main-body">
                <input class="input-hidden" id="inpSelectedBoardPageId" />
                <div id="divPlaceholder">

                </div>
            </div>
        </div>

    </div>
</div>

<div id="divModalSelectBoard" class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Izberi oglasno desko</h5>
                <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <table class="table">
                    <thead>
                    <tr>
                        <th>Naziv</th>
                    </tr>
                    </thead>
                    <tbody id="tbodyModalSelectBoard">

                    </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div id="divModalAddEditPage" class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 id="titleModalAddEditPage" class="modal-title">List</h5>
                <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <input class="input-hidden" id="inpModalAddEditPageId" />
                <div class="form-group">
                    <label class="control-label">Ime</label>
                    <input id="inpModalAddEditPageName" type="text" class="form-control"/>
                </div>
                <div class="form-group">
                    <label class="control-label">Trajanje</label>
                    <input id="inpModalAddEditPageDuration" type="number" class="form-control"/>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="boardAddNewPageSave();">Shrani</button>
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div id="divModalEditNote" class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Urejanje zapiska</h5>
                <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <input id="inpModalEditNoteIdNote" class="input-hidden"/>
                <label class="control-label">Vsebina:</label>
                <div id="divModalEditNoteSummernote"></div>
                <label class="control-label">Barva:</label>
                <div class="div-note-edit-color">
                    <div class="note-color-white active"></div>
                    <div class="note-color-yellow"></div>
                    <div class="note-color-orange"></div>
                    <div class="note-color-light-green"></div>
                    <div class="note-color-blue"></div>
                    <div class="note-color-purple"></div>
                    <div class="note-color-grey"></div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="saveModalEditNote();">Save changes</button>
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

@Html.AntiForgeryToken()

@section Scripts 
{
    <script src="~/lib/summernote/summernote-bs4.js" asp-append-version="true"></script>
    <script src="~/lib/html-to-image/dist/html-to-image.js" asp-append-version="true"></script>
    <script src="~/js/editor/note.js" asp-append-version="true"></script>
    <script src="~/js/editor/edit-main.js" asp-append-version="true"></script>
}
