@using JXCMS.CMS.Movie.Entity
@model JXCMS.CMS.Movie.Entity.ClassifyEntity

@{
    Layout = "_DialogLayout";
}

<form id="modify_classify" action="@Url.Action("ModifyClassify")" method="post">
    <input type="hidden" id="id" name="id" value="@Model.Id"/>
    <div class="form-group">
        <label for="name" class="control-label">分类名称：</label>
        <input type="text" class="form-control" id="name" name="name" value="@Model.Name">
    </div>
    <div class="form-group">
        <label for="alias" class="control-label">别名：</label>
        <input type="text" class="form-control" id="alias" name="alias" value="@Model.Alias">
    </div>
    <div class="form-group">
        <label for="parentId" class="control-label">父级分类：</label>
        <select class="form-control" id="parentId" name="parentId">
            <option value="0">无</option>
            @foreach (ClassifyEntity classify in ViewBag.classifyEntities)
            {
                @:<option value="@classify.Id" @(Model.ParentId == classify.Id ? "selected" : "")>@classify.Name</option>
            }
        </select>
    </div>
</form>

@section dialogScript
{
    <script type="text/javascript">
          $('#commit').click(function() {
              var name = $("#name").val();
              if (name === ""){
                  lightyear.notify('分类名称不能为空', 'danger', 100);
                  return;
              }
              $('#modify_classify').submit();
          })
          </script>
}
