@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = "_BackEnd";
}
@section Script {
    <script src="~/backend/assets/vendor/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="~/backend/assets/vendor/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="~/backend/assets/vendor/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
    <script src="~/backend/assets/vendor/summernote/summernote-bs4.min.js"></script>
    <script src="~/backend/assets/javascript/pages/dataTables.bootstrap.js"></script>
    <script src="~/backend/assets/javascript/custom/newslist.js" asp-append-version="true"></script>

}

<!-- .page-inner -->
<div class="page-inner">
    <!-- .page-title-bar -->
    <header class="page-title-bar">
        <!-- .breadcrumb -->
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item active">
                    <a href="#"><i class="breadcrumb-icon fa fa-angle-left mr-2"></i>最新消息</a>
                </li>
            </ol>
        </nav><!-- /.breadcrumb -->
        <!-- title -->
        <h1 class="page-title"> 最新消息清單 </h1>
        <p class="text-muted">  </p><!-- /title -->
    </header><!-- /.page-title-bar -->
    <!-- .page-section -->
    <div class="page-section">
        <button type="button" id="newsNewModal" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
        <!-- .card -->
        <div class="card card-fluid">
            <!-- .card-body -->
            <div class="card-body">
                <!-- .table -->
                <table id="dt-responsive" class="table dt-responsive nowrap w-100">
                    <thead>
                        <tr>
                            <th> 主圖片 </th>
                            <th> 發布日期 </th>
                            <th> 標題 </th>                       
                            <th>  </th>
                        </tr>
                    </thead>

                </table><!-- /.table -->
            </div><!-- /.card-body -->
        </div><!-- /.card -->
    </div><!-- /.page-section -->
</div><!-- /.page-inner -->


<!-- .modal -->
<form id="clientNewForm" name="clientNewForm">
    <div class="modal fade" id="clientNewModal" tabindex="-1" role="dialog" aria-labelledby="clientNewModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientNewModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">Client name</span> <input id="modelTitle" type="text" class="form-control form-control-lg" placeholder="最新消息資料維護" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="method" />
                    <input type="hidden" id="news_uid" />
                    <!-- .form-row -->
                    <div class="form-row">


                        <div class="col-md-12" id="user_name_div">
                            <div class="form-group">
                                <label for="news_title">主標題</label> 
                                <textarea maxlength="50" id="news_title" class="form-control"></textarea>
                            </div>
                        </div>
                        <div class="col-md-12" id="user_name_div">
                            <div class="form-group">
                                <label for="news_subtitle">副標題</label> <input type="text" maxlength="50" id="news_subtitle" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="card-body">
                                <!-- .media -->
                                <div class="media">
                                    <div class="user-avatar user-avatar-xxl fileinput-button">
                                        <div class="fileinput-button-label"> Change photo </div><img src="~/BackEnd/assets/images/avatars/unknown-profile.jpg" alt=""> <input id="fileupload-avatar" type="file" name="avatar">
                                    </div>
                                    <div class="media-body pl-3">
                                        <h3 class="card-title"> 主圖片 </h3>
                                        <p class="card-text"> 點擊圖片可更換照片. </p>
                                        <p class="card-text text-muted"> 最大容許檔案大小為 5MB. </p>
                                    </div>
                                </div><!-- /.media -->
                            </div>
                        </div>
                        <!-- .form-group -->
                        <div class="form-group">
                            <label class="control-label" for="flatpickr01">日期</label> <input id="news_date" type="text" class="form-control" data-toggle="flatpickr" data-date-format="Y.m.d">
                        </div><!-- /.form-group -->
                        <div class="col-md-12">
                            <div class="form-group">
                                <label for="news_tags">HashTag</label> <select type="text" id="news_tags" class="form-control"></select>
                            </div>
                        </div>
                        <div class="col-md-12" id="user_id_div">
                            <div class="form-group">
                                <label for="news_title">內容</label>
                                <!-- .card -->
                                <div class="card card-fluid">
                                    <!-- #summernote-basic -->
                                    <div id="summernote" data-placeholder="最新消息內容..." data-height="200"></div><!-- /#summernote-basic -->
                                </div><!-- /.card -->
                            </div>
                        </div>
                        
              
                        <div class="col-md-12">
                            <!-- .card-body -->
                            <div class="card-body">
                                <h2 class="card-title">  </h2><!-- .table-responsive -->
                                <div class="table-responsive">
                                    <table class="table table-hover" style="min-width: 678px" id="media_table">
                                        <thead>
                                            <tr>
                                                <th style="width: 30%;"> 圖片 </th>
                                                <th> 說明文字</th>
                                                <th style="width: 20%;"></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td class="align-middle">
                                                    <div class="user-avatar user-avatar-xxl">
                                                        <img src="" />
                                                    </div>
                                                </td>
                                                <td class="align-middle"> zamy_ding </td>
                                                <td class="align-middle text-right">
                                                    <button type="button" data-uid="" data-method="" class="btn btn-sm btn-icon btn-secondary" data-toggle="modal" data-target="#clientContactEditModal"><i class="fa fa-pencil-alt"></i> <span class="sr-only">Edit</span></button> <button type="button" class="btn btn-sm btn-icon btn-secondary"><i class="far fa-trash-alt"></i> <span class="sr-only">Remove</span></button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div><!-- /.table-responsive -->
                            </div><!-- /.card-body -->
                            <!-- .card-footer -->
                            <div class="card-footer">
                                <a href="javascript: void();" id="socialNewBtn" class="card-footer-item"><i class="fa fa-plus-circle mr-1"></i> 新增輪播圖片</a>
                            </div><!-- /.card-footer -->
                        </div>
                        
                    </div><!-- /.form-row -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="newsSaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!-- .modal -->
<form id="clientSocialEditForm" name="clientSocialEditForm">
    <div class="modal fade" id="socialItemModal" tabindex="-1" role="dialog" aria-labelledby="socialModalLabel" data-backdrop="static" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="socialModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">輪播圖片</span> <input id="option_name" type="text" class="form-control form-control-lg" value="" placeholder="輪播圖片" readonly="readonly " required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="photo_method" />
                    <input type="hidden" id="photo_uid" />
                    <input type="hidden" id="news_uid" />
                    <div class="form-group">
                        <div class="card-body">
                            <!-- .media -->
                            <div class="media">
                                <div class="user-avatar user-avatar-xxl fileinput-button">
                                    <div class="fileinput-button-label"> Change photo </div><img src="~/BackEnd/assets/images/avatars/unknown-profile.jpg" alt=""> <input id="fileupload-subPhoto" type="file" accept="image/*" name="subPhoto">
                                </div>
                                <div class="media-body pl-3">
                                    <h3 class="card-title"> 輪播圖片 </h3>
                                    <p class="card-text"> 點擊圖片可更換照片. </p>
                                    <p class="card-text text-muted"> 最大容許檔案大小為 5MB. </p>
                                </div>
                            </div><!-- /.media -->
                        </div>
                    </div>

                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="photo_title" class="form-control" value="" placeholder="圖片說明" maxlength="50" required=""> <label for="photo_title">圖片說明</label>
                        </div>
                    </div><!-- /.form-group -->
                    

                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="optionItemDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->