@model MVC121.Areas.Administrator.Models.Comment

@{
    ViewBag.Title = "ویرایش دیدگاه";
    Layout = "~/Areas/Administrator/Views/Shared/_Layout.cshtml";
}

<hr />

<img src="~/Areas/Administrator/img/comment_s.png" alt="category" />

<h2>ویرایش دیدگاه</h2>


@using (Html.BeginForm("Edit", "Comments", FormMethod.Post, new { enctype = "multipart/form-data", id = "myUploadForm" }))
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>@Model.Name</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.ID)

        <div class="form-group">
            @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.URL, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.URL, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.URL, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Comments, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Comments, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Comments, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PublishTime, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PublishTime, new { htmlAttributes = new { @class = "form-control", ID = "txtDate" } })
                @Html.ValidationMessageFor(model => model.PublishTime, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PostID, "نام مطلب", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("PostID", null, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.PostID, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button class="btn btn-primary">ویرایش دیدگاه</button>
            </div>
        </div>
        </div>
}

<div>
    @Html.ActionLink("بازگشت به صفحه مدیریت دیگاه", "Index")
</div>

@section styles{
    <link href="~/Content/jquery-ui-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Theme/redmond/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />

}

@section scripts{

<script src="@Url.Content("~/Scripts/AutoNumeric/jquery-price.js")"></script>
<script src="@Url.Content("~/Scripts/TagsInput/bootstrap-tagsinput.min.js")"></script>
<script>
    $(function () {
        $("#Keyword").keypress(function (event) {
            if (event.keyCode == 13) {
                event.preventDefault();
            }
        }).tagsinput();
    });

    $("#myUploadForm").ajaxForm();
</script>

<script src="~/Scripts/tinymce/tiny_mce.js" type="text/javascript"></script>

<script src="~/Scripts/tinymce/tinymce.min.js" type="text/javascript"></script>

<script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        theme: "modern",
        plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
        ],
        toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar2: "print preview media | forecolor backcolor emoticons",
        image_advtab: true,
        templates: [
            { title: 'Test template 1', content: 'Test 1' },
            { title: 'Test template 2', content: 'Test 2' }
        ]
    });
</script>



    <script src="~/Scripts/jquery-ui-datetimepicker.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#txtDate").datetimepicker({
                showButtonPanel: true,
                changeMonth: true,
                changeYear: true
            });
        });
    </script>
}




