article_edit.html 5.44 KB
<% 
DIRECTIVE SAFE_OUTPUT_OPEN;
var headContent = {
	include("/pages/template/head.html"){}
%>
<% include("/pages/includes/my97.html"){} %>

<script type="text/javascript">
	var oper = {
		save:function(id){
			if(!validForm()) {
				return false;
			}
			id = id || '0';
			var url = 'admin/article/save/'+id;
			form1.action = url;
			form1.submit();
			return true;
		}	
	};
</script>

<%
};
var bodyContent = {
%>
<form name="form1" action="" method="post" class="form-horizontal"
		enctype="multipart/form-data" role="form">
	<input type="hidden" name="model.id" value="${model.id}" />
	<table class="table">
		<% // 列表头部 %>
			<tr>
				<td width="15%">栏目</td>
				<td width="33%">
					<select name="model.folder_id" class="form-control" valid="vselect" validname="栏目">
					${selectFolder }
					</select>
				</td>
				<td width="15%">名称</td>
				<td width="33%">
						<input class="form-control" type="text" name="model.title" value="${model.title}" 
						valid="vtext" validname="名称" />
				</td>
			</tr>
			<tr>
				<td>发布者</td>
				<td>
					<% if(model.id!0 > 0) { %>
						<input class="form-control" type="text" name="model.publish_user" value="${model.publish_user}"  />
					<% } else { %>
						<input class="form-control" type="text" name="model.publish_user" value="${session.session_user.realname!session.session_user.username }"  />
					<% } %>
				</td>
				<td>发布时间</td>
				<td>
						<input class="form-control" type="text" name="model.publish_time" 
						value="${model.publish_time!flyfox.getNow()}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
				</td>
			</tr>
			<tr>
				<td>排序</td>
				<td>
						<input class="form-control" type="text" name="model.sort" value="${model.sort!'10'}" 
						valid="vnum_y" validname="排序" />
				</td>
				<td>状态</td>
				<td>
					<label class="radio-inline">
					  <input type="radio" name="model.status" id="" value="2"  ${model.status=='2'?"checked":"" } > 隐藏
					</label>
					<label class="radio-inline">
					  <input type="radio" name="model.status" id="" value="1"  ${model.status!='2'?"checked":"" } > 显示
					</label>
				</td>
			</tr>
			<tr>
				<td>是否评论</td>
				<td>
					<label class="radio-inline">
					  <input type="radio" name="model.is_comment" id="" value="1"  ${model.is_comment!=2?"checked":"" } > 是
					</label>
					<label class="radio-inline">
					  <input type="radio" name="model.is_comment" id="" value="2"  ${model.is_comment==2?"checked":"" } > 否
					</label>
				</td>
				<td>是否推荐</td>
				<td>
					<label class="radio-inline">
					  <input type="radio" name="model.is_recommend" id="" value="1"  ${model.is_recommend==1?"checked":"" } > 是
					</label>
					<label class="radio-inline">
					  <input type="radio" name="model.is_recommend" id="" value="2"  ${model.is_recommend!=1?"checked":"" } > 否
					</label>
				</td>
			</tr>
			<tr>
				<td>开始时间</td>
				<td>
						<input class="form-control" type="text" name="model.start_time" 
						value="${model.start_time}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  />
				</td>
				<td>结束时间</td>
				<td>
						<input class="form-control" type="text" name="model.end_time" 
						value="${model.end_time}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  />
				</td>
			</tr>
			<tr>
				<td>类型</td>
				<td>
					<select name="model.type" class="form-control" >
					${flyfox.dictSelect('articleType' , model.type!'11')  }
					</select>
				</td>
				<td>跳转地址</td>
				<td>
					<input type="text" class="form-control" name="model.jump_url" 
						value="${model.jump_url}" placeholder="跳转地址,设置直接跳转" />
				</td>
			</tr>
			<tr>
				<td>图片
					<% if(!strutil.isEmpty(model.image_url)||!strutil.isEmpty(model.image_net_url)){ %>
						<a href="${flyfox.getImage(model)}" target="_blank" style="text-decoration:none;">
							<img alt="图片" title="点击浏览" src="${flyfox.getImage(model)}" width="40" height="40">
						</a>
					<% } %></td>
				<td>
					<input type="file" accept="image/*" class="form-control" name="model.image_url" />
				</td>
				<td colspan="2">
					<input type="text" class="form-control" name="model.image_net_url" 
						value="${model.image_net_url}" placeholder="网络图片url" />
				</td>
			</tr>
			<tr>
				<td>附件</td>
				<td>
					<input type="file" accept="*/*" class="form-control" name="model.file_url" />
				</td>
				<td colspan="2">
					<!-- 删除标记 -->
					<input type="hidden" id="file_url_flag" class="form-control" name="file_url_flag" />
					<% if(!strutil.isEmpty(model.file_url)){ %>
					<div id="file_url_show" >
						<a href="${flyfox.getFile(model,'file_url')}" target="_blank" style="text-decoration:none;">
							${model.file_name}
						</a>
						<a href="javascript:void(0);"  
						onclick="$('#file_url_show').hide();$('#file_url_flag').val('1');"
						style="color: red;">删除</a>
					</div>
					<% } %>
				</td>
			</tr>
	</table>
	
	<div style="height: 50px;clear: both;">&nbsp;</div>
	<nav class="navbar navbar-default navbar-fixed-bottom">
	  <div class="container" style="padding: 5px 0px 5px 0px;text-align: center;">
		<button class="btn btn-primary" onclick="oper.save(${model.id!'0'});return false;">保 存</button>
		<button class="btn btn-default" onclick="closeIframe();return false;">关 闭</button>
	  </div>
	</nav>
</form>
<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
DIRECTIVE SAFE_OUTPUT_CLOSE;
<%} %>