<!--投稿-->
{% extends themePublicPath %} {% block content %}
{% plugin name="webuploader" %}
{% endplugin %}
<style>
.edui-default .edui-editor-breadcrumb span {
display: inline-block;
}
</style>
<article>
<div class="page whitebg container">
{% include "./public/userNav.html" %}
<div class="page-box">
<div class="row user-contents-post" ms-controller="user-post">
<div class="pannel-container clearfix">
<form name="postForm" ms-validate="@validate">
<div class="col-md-12">
<div class="col-md-8 left-frame">
<div class="main-form">
<div class="form-group">
<label for="">{{__('lc_documentCate')}}</label>
<div class="select-group">
<select id="selectCategory" class="form-control"
onchange="selectCateOnChange(this)">
<option value="0" selected>{{__('lc_please_select_documentCate')}}
</option>
{% if navigation.length > 0 %} {% for item in navigation %}
{% if item.parentId == '0' %} {%if item.type == '1'%}
<option value="{{item._id}}">{{item.name}}</option>
{% endif %} {% endif %} {% endfor %} {% endif %}
</select>
<select class="form-control" id="selectChildCates"
onchange="childCateOnChange(this)">
<option value="0" selected>{{__('lc_please_select_childCate')}}</option>
</select>
</div>
</div>
<div class="form-group">
<label for="">{{__('lc_documentTitle')}}</label>
<input type="text" class="form-control" name="title" ms-duplex="@title"
placeholder="{{__('lc_please_documentTitle')}}"
ms-rules="{required:true, minlength:5,maxlength:50 }"
data-required-message="{{__('lc_please_documentTitle_null_tips')}}"
data-message="{{__('validate_ranglengthandnormal',[__('lc_please_documentTitle'),5,50])}}">
</div>
</div>
</div>
<div class="col-md-4 right-frame">
<div class="right-form">
<button type="submit" class="btn btn-primary sub-content"
id="saveContent">{{__('lc_commitUserConent')}}</button>
<a href="javascript:void(0)" ms-on-click="saveDraft"
class="btn btn-default sub-content">{{__('label_content_save_draft')}}</a>
<div class="form-group thumbImg">
<label for="">{{__('lc_small_images')}}</label>
<div class="uploader-demo">
<!--用来存放item-->
<div id="fileList" class="uploader-list"></div>
<div id="filePicker">选择图片</div>
<i class="fa fa-trash-o trashIco" aria-hidden="true"></i>
</div>
</div>
<div class="form-group tag-list">
<label for="">{{__('lc_content_tag')}}</label>
<select id="selectTags" class="form-control" onchange="selectTagOnChange(this)">
<option value="0" selected>{{__('lc_select_documentTag')}}</option>
{% hottags pageSize=50 %}
{% for item in hottags %}
<option value="{{item._id}}">{{item.name}}</option>
{% endfor %}
</select>
</div>
<div class="form-group wordFile">
<label for="">{{__('lc_upload_word')}}</label>
<input type="file" id="wordFileList" name="wordFileList"
onchange="handleWordFile()"></input>
</div>
</div>
</div>
<div class="clear blank"></div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="">{{__('lc_documentDis')}}</label>
<input type="text" class="form-control" name="discription" ms-duplex="@discription"
placeholder="{{__('lc_pleace_documentDis')}}"
ms-rules="{required:true, minlength:5,maxlength:300 }"
data-required-message="{{__('lc_pleace_documentDis_null_tips')}}"
data-message="{{__('validate_ranglengthandnormal',[__('lc_documentDis'),5,300])}}">
</div>
<div class="form-group">
<label for="">{{__('lc_contentDetails')}}</label>
<!-- 加载编辑器的容器 -->
<script id="container" name="content" type="text/plain"></script>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</article>
{% plugin name="ueditor" %}
{% endplugin %}
<script>
var currentCate = [];
var selectTips = "{{__('lc_please_select_childCate')}}";
function fillChildCateOptions(typeId, cb) {
getAjaxData('/api/contentCategory/getCurrentCategoriesById?typeId=' + typeId + '&userId=' + $(
'#userId')
.val(),
function (
result) {
if (result.status == 200 && result.data) {
var childCates = result.data.cates;
var childHtml = '<option value="0" selected>' + selectTips + '</option>';
for (const cateItem of childCates) {
if (cateItem._id != typeId) {
childHtml += '<option value="' + cateItem._id + '">' + cateItem.name + '</option>';
}
}
$('#selectChildCates').html(childHtml);
}
cb && cb();
})
}
function selectTagOnChange(obj) {
postArticelVM.tags = obj.value;
}
function childCateOnChange(obj) {
currentCate.push(obj.value);
if (currentCate.length == 2) {
postArticelVM.categories = currentCate;
}
}
function selectCateOnChange(obj)