<style>
#extra ul, #extra li { list-style: none; margin:0;padding:0; }
#btnAddParam {padding:3px 5px;line-height: 200%;}
#extra {border:solid 1px #e4e4e4;}
#extra .header{line-height: 200%; font-weight: bold; }
#extra .header>span, #extra #fieldset>li>span {display: inline-block; padding: 3px 5px; }
#extra .lbl-field {width:20%;}
#extra .lbl-title {width:40%;}
#extra .lbl-type {width:12%;}
#extra .lbl-status {width:10%;}
#extra .lbl-operate {width:10%;}
#extra ul li, #btnAddParam {border-top:solid 1px #E4E4E4;}
#extra span {border-right:solid 1px #E4E4E4;}
#extra span:last-child{border-right: none 0px;}
.tab-pane { padding-top:10px; }
 .item {margin:5px 0;}
 #one h2 { float:left;}
 #one .floatright { float:right; margin-right:4px;margin-top:20px}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
	<div class="container">
		<div class="item">
        <h2>{$row.title}{:__('Name')} <span class="small">({$row.name})</span> </h2>
		<div class="margin" style="margin-left:0;">
            <div class="alert alert-dismissable bg-info">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <strong class="text-danger">重要提示：</strong><strong class="text-primary">添加</strong> 或 <strong class="text-primary">删除</strong> 字段后，需要点击＂保存及应用＂才会生效!
            </div>
        </div></div>
	
		<input type="hidden" name="ids" value="{$row.id}" />
		<div id="extra">
			<div class="header">
				<span class="lbl-field">{:__('field')}</span>
				<span class="lbl-title">{:__('fieldname')}</span>
				<span class="lbl-type">{:__('type')}</span>
				<span class="lbl-status">{:__('status')}</span>
				<span class="lbl-operate">{:__('operate')}</span>
			</div>
		    <ul id="fieldset">
		    	{notempty name="$row.extra"}
		    	{foreach $row.extra as $index=>$vo}
		    	<li id="p{$index}" data-field="{$vo.field}"
		    		{foreach $vo as $key=>$field}
		    			data-{$key}="{$field}" 
		    		{/foreach}
		    		>
		    		
				  <span class="lbl-field">{$vo.field}</span>
				  <span class="lbl-title">{$vo.fieldname}</span>
				  <span class="lbl-type">{:__($vo.type)}</span>
				  <span class="lbl-status">
				  	<a class="btn-change text-success" data-field="{$vo.field}" data-ids="{$row.id}" title="{:__($vo.status)}">
				  		<i class="fa fa-toggle-{eq name="$vo.status" value="hidden"}off{else/}on{/eq} fa-2x"></i>
				  	</a>
				  </span>
				  <span class="lbl-operate">
				    <a href="javascript:;" title="{:__('Edit field')}" class="btn btn-xs btn-success btn-param" data-fieldid="p{$index}" data-fieldset=""><i class="fa fa-pencil"></i></a>
				    <a href="javascript:;" title="{:__('Del')}" class="btn btn-xs btn-danger btn-delparam"><i class="fa fa-trash"></i></a>
				  </span>
				</li>
		    	{/foreach}
		    	{/notempty}
			    <div id="btnAddParam"><a href="javascript:;" class="btn-param" title="{:__('add field')}">
					<i class="fa fa-plus"></i> {:__('add field')}
				</a>
				</div>
		    </ul>
		</div>
	</div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed btn-submit disabled">{:__('Save & Apply')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script id="fieldTpl" type="text/html">
<li id="<%=fieldid%>" <%=datapart%>>
  <span class="lbl-field"><%=field%></span>
  <span class="lbl-title"><%=title%></span>
  <span class="lbl-type"><%=type%></span>
  <span class="lbl-status"><%=status%></span>
  <span class="lbl-operate">
    <a href="javascript:;" title="{:__('Edit field')}" class="btn btn-xs btn-success btn-param" data-fieldid="<%=fieldid%>" data-fieldset="<%=fieldset%>"><i class="fa fa-pencil"></i></a>
    <a href="javascript:;" title="{:__('Del')}" class="btn btn-xs btn-danger btn-delparam"><i class="fa fa-trash"></i></a>
  </span>
</li>
</script>
