<%@ page import="com.lightinit.hsdataplatform.dictionary.DicResourceCatelogType" %>
<%@ page import="com.lightinit.hsdataplatform.dictionary.DicResourceState" %>
<%@ page import="com.lightinit.hsdataplatform.dictionary.DicNotificationState" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<jsp:include page="../../../common/admin/modal_content_pre.jsp"><jsp:param name="modal_title" value="新增"/></jsp:include>
<form id="formAdd" action="<%=basePath%>/admin/notification_mgr/add.action" method="post">
    <input type="hidden" name="id" value="${outputModel.id}"/>
    <input type="hidden" name="notiState"/>
    <div class="form-group">
        <label for="notiTitle" class="col-md-3 col-sm-3 control-label"><span style="color: red;">*</span>通知标题：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="notiTitle" name="notiTitle" class="form-control" value="${outputModel.notiTitle}"/>
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="notiContent" class="col-md-3 col-sm-3 control-label"><span style="color: red;">*</span>通知内容：</label>
        <div class="col-md-7 col-sm-7">
            <textarea  id="notiContent" name="notiContent" class="form-control" style="margin: 0px -3.47222px 0px 0px; width: 263px; height: 217px;">${outputModel.notiContent}</textarea>
            <span class="help-block"></span>
        </div>
    </div>
</form>
<jsp:include page="../../../common/admin/modal_content_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/modal_footer_pre.jsp"></jsp:include>
<button type="button" id="btnSave" class="btn btn-primary"><i class="fa fa-check"></i>发送</button>
<button type="button" id="btnSaveDraft" class="btn btn-warning"><i class="fa fa-exclamation"></i>暂存</button>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>取消</button>
<jsp:include page="../../../common/admin/modal_footer_post.jsp"></jsp:include>
<script type="text/javascript">
    $("#btnSave").click(function() {
        $("input[name=notiState]").val("${DicNotificationState.sended}");
        $('#formAdd').ajaxSubmitCloseRefresh();
    });

    $("#btnSaveDraft").click(function() {
        $("input[name=notiState]").val("${DicNotificationState.waiting}");
        $('#formAdd').ajaxSubmitCloseRefresh();
    });

    $(".input-group.date").datetimepicker({
        format: "YYYY-MM-DD",
        locale: "zh-cn"
    });

    $("#formAdd").validate({
        rules: {
            resourceName: "required",
            resourceSummary: "required",
            dataItem: "required",
            belongTo: "required",
            catelogType: "required",
            dataTag: "required",
        }
    });
</script>