<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
				<li><a href="#tab1" class="default-tab current">Edit Feature</a></li>
				<li><a href="admin/feature/list/" class="">Topic list</a></li>
				<li><a href="#tab2">Add Feature</a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div class="tab-content default-tab" id="tab1">
				<form id="_save_form" action="admin/feature/save_ajax/feature_id-<?php echo $this->feature['id']; ?>" method="post">
					<p>
						<label>Feature title:</label>
						<input type="text" value="<?php echo $this->feature['title']; ?>" class="text-input medium-input" name="title">
					</p>
					<p>
						<label>Alias:</label>
						<?php echo get_js_url('/'); ?>feature/ <input type="text" name="url_token" class="text-input" style="width:120px;" value="<?php echo $this->feature['url_token']; ?>">
					</p>
					<p>
						<label>Feature description:</label>
						<input id="description" type="text" value="<?php echo $this->feature['description']; ?>" class="text-input medium-input" name="description">
					</p>
					<p>
						<label>Special icon (Guidelines: 900x240px):</label>
						<?php if($this->feature['icon']){ ?>
					<div style="width:900px; height:240px;background:url(<?php echo get_feature_pic_url('max', $this->feature['icon']); ?>) no-repeat;"></div>
					<?php } ?>
					Modify icon:
					<input name="icon" class="upload-input" type="file" style="margin-top:10px;">
					<br />
					<small>(Supported picture format: jpg,jpeg,gif,png)</small>
					</p>
					</label>
					</p>
					<p>
						<label>Customized page layout(CSS):</label>
						<textarea id="css" rows="3" cols="100" name="css"><?php echo $this->feature['css']; ?></textarea>
						<br />
						<small> No need to write &lt;style&gt;Tags </small>
					</p>
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_save_form'), _form_process);" value="Save" />
					</p>
					</label>
					</p>
				</form>
			</div>
			<div class="tab-content" id="tab2" style="display: none;">
				<h3>Add Feature</h3>
				<form id="_add_form" action="admin/feature/save_ajax/" method="post">
					<p>
						<label>Feature title:</label>
						<input type="text" value="" class="text-input medium-input" name="title">
					</p>
					<p>
						<label>Alias:</label>
						<?php echo get_js_url('/'); ?>feature/ <input type="text" name="url_token" class="text-input" style="width:120px;" value="<?php echo $this->feature['url_token']; ?>">
					</p>
					<p>
						<label>Feature description:</label>
						<input id="description" type="text" value="" class="text-input medium-input" name="description">
					</p>
					<p>
						<label>Special icon :</label>
						<input name="icon" class="upload-input" type="file">
						<br />
						<small>(Supported picture format: jpg,jpeg,gif,png)</small> </p>
					<p>
						<label>Customized page layout(CSS):</label>
						<textarea id="description" rows="3" cols="100" name="description"><?php echo $this->feature['css']; ?></textarea>
						<br />
						<small> No need to write &lt;style&gt;Tags </small>
					</p>
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_add_form'), _form_process);" value="Add a new topic" />
					</p>
					</label>
					</p>
				</form>
			</div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>