<%include ./common.html %>
<div class="panel-content">
    <form method="post" action="/notify/<% if (messageData._id === undefined) { %>add<% }else{ %>modify/<%= messageData._id.toString() %><% } %>" enctype="application/x-www-form-urlencoded">
        <div class="panel-title">
            <div class="title-main">
                <h2><% if (messageData._id === undefined) { %>新建通知<% }else{ %>修改通知<% } %>
                    <% if (messageData._id === undefined) { %>
                    <!--新建通知-->
                    <a href="javascript:void(0);" class="btn btn-default btn-sm pull-right" id="save">保存</a>
                    <% }else{ %>
                    <!--编辑通知-->
                    <a href="javascript:void(0);" class="btn btn-primary btn-sm pull-right" id="save">确定修改</a>
                    <a href="/notify/delete/<%= messageData._id.toString() %>" class="btn btn-default btn-sm pull-right"><span class="text-danger">删除</span></a>
                    <% if (messageData.last_update !== undefined && messageData.last_update !== '') {%>
                    <span class="pull-right"><h6 class="text-muted">最近保存 <%= messageData.last_update %><br><%= moment(messageData.update_time).format('YYYY-MM-DD HH:mm:ss') %></h6></span>
                    <% } %>
                    <% } %>
                </h2>
            </div>
        </div>
        <div class="content-wrap">
            <div class="c-body">
                <form>
                    <div class="form-group">
                        <label for="title">通知类型</label>
                        <div class="radio">
                            <label>
                                <input type="radio" name="message_type" value="1" <% if(messageData.message_type === 1) {%>checked="checked"<% } %>> 用户通知
                            </label>
                            <label>
                                <input type="radio" name="message_type" value="2" <% if(messageData.message_type === 2) {%>checked="checked"<% } %>> 内部通知
                            </label>
                        </div>
                    </div>
                    <div class="form-group has-feedback">
                        <label for="title">标题</label>
                        <input type="text" class="form-control" name="title" id="title" placeholder="输入通知标题" value="<%= messageData.title %>">
                        <span class="form-control-feedback" aria-hidden="true">0/20</span>
                    </div>
                    <div class="form-group">
                        <label for="content">正文</label>
                        <textarea name="content" id="content"><%= messageData.content %></textarea>
                    </div>
                </form>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="/web/users/js/message.js"></script>
<script type="text/javascript" src="/lib/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/lib/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    let ue = UE.getEditor('content');

</script>