{{ header }}
{{ column_left }}
<div id="content">
	<div class="page-header">
		<div class="container-fluid">
			<div class="pull-right">
				<button type="submit" form="form-blog-category" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
				<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a>
			</div>
			<h1>{{ heading_title }}</h1>
			<ul class="breadcrumb">
				{% for breadcrumb in breadcrumbs %}
					<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
				{% endfor %}
			</ul>
		</div>
	</div>
	<div class="container-fluid">
		{% if error_warning %}
			<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
				<button type="button" class="close" data-dismiss="alert">&times;</button>
			</div>
		{% endif %}
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
			</div>
			<div class="panel-body">
				<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-blog-category" class="form-horizontal">
					<ul class="nav nav-tabs">
						<li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
						<li><a href="#tab-data" data-toggle="tab">{{ tab_data }}</a></li>
					</ul>
					<div class="tab-content">
						<div class="tab-pane active" id="tab-general">
							<ul class="nav nav-tabs" id="language">
								{% for language in languages %}
									<li>
										<a href="#language{{ language.language_id }}" data-toggle="tab"><img src="language/{{ language.code }}/{{ language.code }}.png" title="{{ language.name }}" /> {{ language.name }}</a>
									</li>
								{% endfor %}
							</ul>
							<div class="tab-content">
								{% for language in languages %}
									<div class="tab-pane" id="language{{ language.language_id }}">
										<div class="form-group required">
											<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_name }}</label>
											<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
												<input type="text" name="category_description[{{ language.language_id }}][name]" value="{{ category_description[language.language_id] ? category_description[language.language_id].name : ''}} " class="form-control" />
												{% if error_name.language.language_id %}
													<span class="text-danger">{{ error_name.language.language_id }}</span>
												{% endif %}
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_meta_description }}</label>
											<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
												<textarea name="category_description[{{ language.language_id }}][meta_description]" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].meta_description : ''}} </textarea>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_meta_keyword }}</label>
											<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
												<textarea name="category_description[{{ language.language_id }}][meta_keyword]" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].meta_keyword : '' }}</textarea>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_description }}</label>
											<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
												<textarea name="category_description[{{ language.language_id }}][description]" id="description{{ language.language_id }}" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].description : '' }}</textarea>
											</div>
										</div>
									</div>
								{% endfor %}
							</div>
						</div>
						<div class="tab-pane" id="tab-data">
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_parent }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<select name="parent_id" class="form-control">
										<option value="0">{{ text_none }}</option>
										{% for category in categories %}
											{% if category.simple_blog_category_id == parent_id %}
												<option value="{{ category.simple_blog_category_id }}" selected="selected">{{ category.name }}</option>
											{% else %}
												<option value="{{ category.simple_blog_category_id }}">{{ category.name }}</option>
											{% endif %}
										{% endfor %}
									</select>
								</div>
							</div>
							<div class="form-group required">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">
									<span data-toggle="tooltip" title="{{ help_keyword }}">{{ entry_keyword }}</span>
								</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<input type="text" name="keyword" value="{{ keyword }}" class="form-control" />
									{% if error_seo_keyword %}
										<span class="text-danger">{{ error_seo_keyword }}</span>
									{% endif %}
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_store }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<div class="well well-sm" style="height: 150px; overflow: auto; margin-bottom:0;">
										<div class="checkbox">
											<label>
												{% if 0 in category_store %}
													<input type="checkbox" name="category_store[]" value="0" checked="checked" />
													{{ text_default}}
												{% else %}
													<input type="checkbox" name="category_store[]" value="0" />
													{{ text_default }}
												{% endif %}
											</label>
										</div>
										{% for store in stores %}
											<div class="checkbox">
												<label>
													{% if category_store in store.store_id %}
														<input type="checkbox" name="category_store[]" value="{{ store.store_id}}" checked="checked" />
														{{ store.name }}
													{% else %}
														<input type="checkbox" name="category_store[]" value="{{ store.store_id }}" />
														{{ store.name }}
													{% endif %}
												</label>
											</div>
										{% endfor %}
									</div>
									<a onclick="$(this).parent().find(':checkbox').prop('checked', true);">{{ text_select_all }}</a> / <a onclick="$(this).parent().find(':checkbox').prop('checked', false);">{{ text_unselect_all }}</a>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_image }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<a href="" id="thumb-image" data-toggle="image" class="img-thumbnail">
										<img src="{{ thumb }}" alt="" title="" data-placeholder="{{ no_image }}" />
									</a>
									<input type="hidden" name="image" value="{{ image }}" id="input-image" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">
									<span data-toggle="tooltip" title="{{ help_top }}">{{ entry_top }}</span>
								</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<div class="checkbox-inline">
										{% if top %}
											<input type="checkbox" name="top" value="1" checked="checked" />
										{% else %}
											<input type="checkbox" name="top" value="1" />
										{% endif %}
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">
									<span data-toggle="tooltip" title="{{ help_column }}">{{ entry_column }}</span>
								</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<input type="text" name="blog_category_column" value="{{ blog_category_column }}" class="form-control" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_article_limit }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<input type="text" name="column" value="{{ column }}" class="form-control" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_sort_order }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<input type="text" name="sort_order" value="{{ sort_order }}" class="form-control" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 col-md-2 col-sm-2 col-xs-12 control-label">{{ entry_status }}</label>
								<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
									<select name="status" class="form-control">
										{% if status %}
											<option value="1" selected="selected">{{ text_enabled }}</option>
											<option value="0">{{ text_disabled }}</option>
										{% else %}
											<option value="1">{{ text_enabled }}</option>
											<option value="0" selected="selected">{{ text_disabled }}</option>
										{% endif %}
									</select>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="view/javascript/summernote/summernote.js"></script>
<link href="view/javascript/summernote/summernote.css" rel="stylesheet" />
<script type="text/javascript" src="view/javascript/summernote/summernote-image-attributes.js"></script>
<script type="text/javascript" src="view/javascript/summernote/opencart.js"></script>
<script type="text/javascript">
	{% for language in languages %}
	$('#description{{language.language_id}}').summernote({height: 300});
	{% endfor %}
	$('#language a:first').tab('show');
	$('#option a:first').tab('show');
</script>
{{ footer }}