{include file="$template_path/html/header.html"}
{include file="$template_path/js/arc.html"}
<link rel="stylesheet" type="text/css" href="/mbthemes/assets/styles/post.css">
{include file="$template_path/html/jstemplate.html"}
</head>
<body>
<div class="app" id="app">
	{include file="$template_path/html/mobile-nav.html"}
	<!-- content -->
	<div id="content" class="app-content box-shadow-z4" role="main">
		{include file="$template_path/html/pagenav.html"}
		<div class="app-body" id="view">
			<!-- ############ PAGE START-->
			<div class="white b-t">
				<div class="container">
					<div class="row-col">
						<div class="col-sm w-xl w-auto-xs b-r b-l right-bar">
							<div class="box box-bar m-b-0">
								<div class="p-a-md">
									<form id="begin-upload" action="/{$languageURL}" method="get" >
										<div class="form-group">
											<div class="inputs m-t-sm">
												<select class="form-control" id="category" name="category">
													{if $mainCategories}
													{foreach from=$mainCategories item=c}
													<option value="{$c.id}" {if $smarty.get.category == $c.id}selected="selected"{/if}>{$c.name}</option>
													{/foreach}
													{/if}
												</select>
											</div>
										</div>
										<p>
											<a onclick="window.location='/{$languageURL}upload/form/?category=' + document.getElementById('category').options[document.getElementById('category').selectedIndex].value;" class="btn skin b-skin btn-sm">切换</a>
											<a href="/{$languageURL}help/upload/" class="btn btn-link btn-sm" target="_blank">帮助</a>
										</p>
									</form>
								</div>
							</div>
						</div>
						<div class="col-sm">
							<div class="box pos-rlt b-r m-b-0">
								<div class="p-a">



									<form method="post" action="" enctype="multipart/form-data" class="horizontal-form item-form disable-on-submit p-b-sm p-l-sm p-r-sm p-t-sm">
										<div class="blocktit clearfix">
											<h4 class="m-t-none h3-xs"><label for="name">作品标题</label>
												<small class="text-sm text-danger hidden-xs-down">
													不可修改
												</small>
											</h4>
										</div>
										<div class="form-group m-b-0">
											<div class="inputs m-t-sm">
												<input class="form-control" type="text" id="name" name="name" value="{$smarty.post.name|escape}" maxlength="50" disabled>

											</div>
										</div>
										<div class="b-b p-t m-b b-dotted"></div>

										<div class="row">
											<div class="col-xs-6">
												<div class="blocktit clearfix">
													<h4 class="m-t-sm h3-xs"><span class="text-danger m-t-xs">*</span><label for="name">类别</label>
														<small class="text-sm text-muted  hidden-xs-down">
															请选择您作品的所属类别
														</small>
													</h4>
												</div>
												<div class="form-group">
													<div class="inputs m-t-sm">
														<select class="form-control" id="category" name="category">{$categoriesSelect}</select>
													</div>
												</div>
											</div>
										</div>
										<div class="b-b p-t m-b b-dotted"></div>


										<div class="blocktit clearfix">
											<h4 class="m-t-sm h3-xs"><label for="demo_url">演示地址url</label>
												<small class="text-sm text-muted  hidden-xs-down">
													完整的URL地址，比如：http://www.baidu.com
												</small>
											</h4>
										</div>
										<div class="form-group m-t-sm">
											<div class="inputs m-t-sm">
												<input class="form-control" autocomplete="off" id="demo_url" name="demo_url" type="text" value="{$smarty.post.demo_url|escape}" placeholder="www.baidu.com">
											</div>
										</div>

										<div class="b-b p-t m-b b-dotted"></div>
										<div class="blocktit clearfix">
											<h4 class="m-t-sm h3-xs"><label>设置为免费文件？</label></h4>
										</div>
										<div class="form-group m-t-sm">
											<div class="inputs m-t-sm">
												<label class="ui-switch skin m-t-xs m-r">
													<input type="checkbox" name="free_request" value="true" {if $smarty.post.free_request == 'true'}checked="checked"{/if} />
													<i></i>
												</label>
											</div>
										</div>

										<div class="b-b p-t m-b b-dotted"></div>


										<div class="blocktit clearfix">
											<h4 class="m-t-sm h3-xs"><span class="text-danger m-t-xs">*</span>标签
												<small class="text-sm text-muted  hidden-xs-down">
													选取遇到麻烦？
													<a class="text-skin" href="/index.php/help/upload/" target="_blank">
														查看选取指引
													</a>
												</small>
											</h4>
										</div>

										<div class="form-group m-t-sm">
											<div class="inputs m-t-sm tagsinputs m-t-sm">
												<input type="hidden" name="tags" id="tagstxt" />
												<div class="tagtips clearfix" id="tagtips">
													<span class="tageditbtn"></span>
												</div>

												<div class="addtags clearfix m-t" id="addtags">
													<div class="tagiptbg pos-rlt">

														<div class="input-group">
															<input type="text" class="form-control" id="addtagipt" autocomplete="off" placeholder="点击选取标签" style="outline:0">
															<span class="input-group-btn">
																<button class="btn btn-default addtagsbtn" type="button">完成</button>
															</span>
														</div>
														<div class="addtaglist aside-xl dropdown-menu bg-white b-a no-shadow animated fadeIn p-t-md p-b-md" id="addtaglist" style="margin-top:-1px;">
														</div>
													</div>
												</div>
											</div>
											<small class="block text-grays m-t-sm">您最多只能选6个标签</small>
										</div>


										<div class="b-b p-t m-b b-dotted"></div>
										<div class="blocktit clearfix">
											<h4 class="m-t-sm h3-xs"><span class="text-danger m-t-xs">*</span><label for="description">详细的描述</label>
												<small class="text-sm text-muted  hidden-xs-down">
													尽量精炼详实从而有助于用户搜索到你的作品。
												</small>
											</h4>
										</div>
										<div class="form-group">
											<div class="inputs m-t-sm">
												<!--初始化编辑器-->
												<script id="container" name="description" type="text/plain">
                {$smarty.post.description}
             </script>
												<!-- 配置文件 -->
												<script type="text/javascript" src="{$template_data}ueditor/ueditor.config.js"></script>
												<!-- 编辑器源码文件 -->
												<script type="text/javascript" src="{$template_data}ueditor/ueditor.all.js"></script>
												<!-- 实例化编辑器 -->
												<script type="text/javascript">
													var ue = UE.getEditor('container');
												</script>
											</div>
										</div>


										<div id="attribute_fields">
											{if $attributes}
											{foreach from=$attributes item=a}
											<div class="b-b p-t m-b b-dotted"></div>
											<div class="form-group">
												<label for="name" class="h4 m-b">{$a.name}</label>
												<div class="inputs m-t-sm m-t">
													{if $a.type == 'select'}
													<select class="form-control" id="custom_attributes_{$a.id}" name="attributes[{$a.id}]">
														{foreach from=$a.attributes item=ai}
														<option value="{$ai.id}" {if $smarty.post.attributes[$a.id] == $ai.id}selected="selected"{/if}>{$ai.name}</option>
														{/foreach}
													</select>
													{elseif $a.type == 'multiple'}
													<select class="form-control" multiple="multiple" id="custom_attributes_{$a.id}" name="attributes[{$a.id}]">
														{foreach from=$a.attributes item=ai}
														<option value="{$ai.id}" {if $smarty.post.attributes[$a.id] == $ai.id}selected="selected"{/if}>{$ai.name}</option>
														{/foreach}
													</select>
													{elseif $a.type == 'check'}
													{foreach from=$a.attributes item=ai}
													<label class="md-check m-r">
														<input type="checkbox" name="attributes[{$a.id}][{$ai.id}]" value="{$ai.id}" {if isset($smarty.post.attributes[$a.id][$ai.id])}checked="checked"{/if}>
														<i class="skin"></i>
														{$ai.name}
													</label>
													{/foreach}
													{elseif $a.type == 'radio'}
													{foreach from=$a.attributes item=ai}
													<label class="md-check m-r">
														<input type="radio" name="attributes[{$a.id}]" value="{$ai.id}" {if isset($smarty.post.attributes[$a.id]) && $smarty.post.attributes[$a.id] == $ai.id}checked="checked"{/if} />
														<i class="skin"></i>
														{$ai.name}
													</label>
													{/foreach}
													{else}
													<input class="form-control" type="text" name="attributes[{$a.id}]" value="{$smarty.post.attributes[$a.id]}" />
													{/if}
												</div>
											</div>
											{/foreach}
											{/if}

										</div>

										<div class="b-b p-t m-b b-dotted"></div>
										<div class="form-submit">
											<input type="hidden" name="save" value="yes" />
											<button type="submit" class="btn btn-lg skin b-skin btn-block">保存更改</button>
										</div>
									</form>



									{if $inUpdateQueue}
									<div class="editblock infoblock">审核中</div>
									{else}
									<form action="" enctype="multipart/form-data" id="upload-form" method="post" class="m-t-lg horizontal-form item-form disable-on-submit p-x-sm">
										<div class="blocktit clr">
											<h4 class="m-t-sm h3-xs">文件和标签更新（需审核）
												<small class="text-sm text-muted hidden-xs-down">
													上传遇到麻烦？
													<a href="/index.php/help/upload/" target="_blank">
														查看上传指引
													</a>
												</small>
											</h4>
										</div>
										<div id="upload-container">
											<span id="spanButtonPlaceHolder"></span>
											<input id="btnCancel" type="hidden" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
											<br />
											<div class="fieldset flash" id="fsUploadProgress">
												<span class="legend" style="display: none;">队列文件</span>
											</div>
											<div id="divStatus" style="display: none;">0个上传文件</div>
											<br />
											<div id="divFileProgressContainer"></div>
											<div id="thumbnails"></div>
										</div>
										<div id="upload_form_user_files_section" class="clearfix m-t-md">
											<div class="clearfix">
												<div class="form-group col-xs-6 col-sm-6 col-md-4">
													<label>一张缩略图</label>
													<div class="xs-block inputs uploadobjs clr" id="thumbnail_edit">
														<input autocomplete="off" type="hidden" class="hiddenvalue" name="thumbnail" value="{$item.thumbnail}" />
													</div>

													<span class="xs-block m-xs-t-sm inputtips">JPEG格式 尺寸最好修剪至450x310</span>
												</div>
												<div class="form-group col-xs-6 col-sm-6 col-md-4">
													<label>主文件zip包</label>
													<div class="xs-block inputs uploadobjs" id="main_file_edit">
														<input autocomplete="off" type="hidden" class="hiddenvalue" name="main_file" value="{$item.main_file}" />
													</div>
													<span class="xs-block m-xs-t-sm inputtips">.zip格式的压缩包或.txt格式的文本文件(txt文件里包括下载地址比如百度云及提取码)</span>
												</div>

												<div class="form-group col-xs-6 col-sm-6 col-md-4">
													<label>
														封面预览文件
													</label>
													<div class="xs-block inputs uploadobjs" id="first_preview_edit">
														<input autocomplete="off" type="hidden" class="hiddenvalue" name="first_preview" value="{$item.theme_preview}" />
													</div>
													<span class="xs-block m-xs-t-sm inputtips sp">作品页默认展示的预览文件 图片尺寸最好修剪至970x550</span>
												</div>

												<div class="form-group col-xs-6 col-sm-6 col-md-12">
													<label>
														其它预览文件
													</label>
													<div class="inputs uploadobjs clr" id="theme_preview_edit">
														<input autocomplete="off" type="hidden" class="hiddenvalue" name="theme_preview" value="{if $item.preview}{foreach from=$item.preview item=s name=foo}{$s.dir}{if !$smarty.foreach.foo.last},{/if}{/foreach}{/if}" />
													</div>

												</div>
												<p class="clearfix block inputtips sp m-t-sm">允许的格式：.jpg|.png|.gif|.wma|.mp3|.wav|.mp4|.flv|.wmv|.swf</p>

											</div>

											<div class="clearfix alert alert-warning alert-block m-t-sm m-b-sm">
												<button type="button" class="close" data-dismiss="alert">×</button>
												请注意，我们只接受500MB以内大小的文件。
											</div>

										</div>

										<div class="b-b p-t m-b b-dotted"></div>


										<div class="blocktit clearfix">
											<h4 class="m-t-sm h3-xs"><span class="text-danger m-t-xs">*</span><label>更新审核留言</label>
												<small class="header-note hidden-xs">
													不填不予通过。
												</small>
											</h4>
										</div>

										<div class="form-group">
											<div class="inputs">

												<textarea rows="4" name="comments_to_reviewer" id="comments_to_reviewer" class="form-control">{$smarty.post.comments_to_reviewer}</textarea>
												<span class="m-t-sm block">请指明在作品中有使用但非本人原创的文件。</span>
											</div>
										</div>
										<div class="b-b p-t m-b b-dotted"></div>


										<div class="form-submit m-b">
											<input type="hidden" name="upload" value="yes" />
											<button type="submit" class="btn btn-lg skin btn-block">上传</button>
										</div>

									</form>


									{/if}



								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- ############ PAGE END-->
		{include file="$template_path/html/footer.html"}
	</div>
	{include file="$template_path/html/backtop.html"}
	{include file="$template_path/html/mb-settings.html"}
	<!-- ############ LAYOUT END-->
</div>
{literal}
<style>
	.right-bar.fix .box-bar {
		width: 278px;
	}
	.edui-editor{
		width: 100% !important;
	}
	.b-dotted{
		border-bottom-style: dotted;
	}
	.edui-editor-iframeholder{
		width: 100%!important;
	}
</style>
{/literal}
{literal}
<script type="text/javascript">
	seajs.use(["pageui", "modules/objtags"], function(ui, tag){
		tag.tagsInit("#tagstxt", "#tagtips", "#addtags", {/literal}{$item_tags}{literal}, {/literal}{$all_tags}{literal});
		ui.uploadInit("/apps/upload/ajax/swfupload/doUpload.php", "{/literal}{$sessID}{literal}", "edit");
	});
</script>
{/literal}
</body>
</html>