|
{layout name="layout" /}
<nav class="breadcrumb">
<i class="Hui-iconfont"></i>
<a href="{:url('index/index')}"> 首页</a>
<span class="c-gray en">></span>
<a href="{:url('article/index')}">文章管理</a>
<span class="c-gray en">></span>
<a href="{:url('article/index', ['cid'=>$category_info.id])}">{$category_info.name}</a>
<span class="c-gray en">></span>
<a href="javascprit:;">{$data.id ? '修改' : '新增'}</a>
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
title="刷新">
<i class="Hui-iconfont"></i>
</a>
</nav>
<div class="Hui-article">
<article class="cl pd-20">
<form action="{:url('save?cid='.$cid.'&id='.$data['id'])}" method="post" class="form form-horizontal" id="form-admin-article">
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>标题:</label>
<div class="formControls col-xs-8 col-sm-6">
<input type="text" class="input-text" value="{$data.title}" placeholder="请填写标题" id="title" name="title">
</div>
<div class="col-3"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
作者: </label>
<div class="formControls col-xs-4 col-sm-2">
<input type="text" class="input-text" value="{$data.writer}" placeholder="作者" id="writer" name="writer">
</div>
<label class="form-label col-xs-4 col-sm-2" >
信息来源:</label>
<div class="formControls col-xs-4 col-sm-2">
<input type="text" class="input-text" value="{$data.source}" placeholder="信息来源" id="source" name="source">
</div>
<div class="col-3"> </div>
</div>
<div class="row cl">
<div class="col-3"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
标题图:</label>
<div class="formControls col-xs-6 col-sm-4">
<div style="width: 200px;height: 200px;">
<a href="javascript:void(0);" onclick="addTitlePic()" >
<img id="view-img" src="{$data.title_pic ? $data.title_pic : '/static/admin/images/upload_picture.png'}" alt="标题图" title="{$data.title_pic ? '更换' : '添加'}标题图" style="max-width: 200px;max-height: 200px;">
</a>
</div>
<input type="text" class="input-text" value="{$data.title_pic}" name="title_pic" id="title_pic" style="display: none;">
</div>
<label class="form-label col-xs-2 col-sm-2">
<a class="btn btn-success radius" href="javascript:addTitlePic();">{$data.title_pic ? '更换' : '添加'}标题图</a></label>
<div class="col-3"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
关键词:</label>
<div class="formControls col-xs-8 col-sm-6">
<input type="text" class="input-text" value="{$data.keywords}" placeholder="关键词" id="source" name="keywords">
<span class="c-red">多个关键词用英文','分割</span>
</div>
<div class="col-3"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">内容简介:</label>
<div class="formControls col-xs-8 col-sm-6">
<textarea name="summary" id="summary" cols="" rows="" class="textarea" placeholder="说点什么...最多输入500个字符" datatype="*10-100" dragonfly="true"
onKeyUp="textarealength(this,500)">{$data.summary}</textarea>
<p class="textarea-numberbar">
<em class="textarea-length">0</em>/500</p>
</div>
<div class="col-3"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
文章正文:</label>
</div>
<div class="row cl">
<label class="form-label col-xs-1 col-sm-1"></label>
<div class="formControls col-xs-11 col-sm-10">
<script id="editor" type="text/plain" style="width:100%;height:400px;">{$data.content ? $data.content : '此处输入文章正文...'}</script>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
点击量:</label>
<div class="formControls col-xs-8 col-sm-6">
<input type="number" class="input-text" value="{$data.clicks}" id="clicks" name="clicks" style="width: 200px;">
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<button type="submit" class="btn btn-success radius" id="admin-powers-save" name="">确 定</button>
<button type="button" class="btn btn-default radius" onclick="window.history.back();" style="margin-left:20px;">取 消</button>
</div>
</div>
</form>
</article>
</div>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function () {
//实例化编辑器
var ue = UE.getEditor('editor');
})
$("#form-admin-article").submit(function () {
if (isNull($("#title").val())) {
layer.msg('标题不可为空', {
icon: 5,
time: 1000
});
return false;
}
var summary = $("#summary").val();
if (getblen(summary) > 200) {
layer.msg('内容简介过长', {
icon: 5,
time: 1000
});
return false;
}
})
//添加标题图
function addTitlePic() {
layer.open({
type: 2,
area: ['700px', '500px'],
fix: false, //不固定
maxmin: true,
shade: 0.4,
title: '添加缩略图',
content: '{:url("uploadimg")}'
});
}
</script>
|