{{ header }}{{ column_left }}
<div id="content">
	<div class="page-header">
		<div class="container-fluid">
			<div class="pull-right">
				<button type="submit" form="form-setting" 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 %}
		<script>
			usNotify('warning', '{{ error_warning }}');
		</script>
		{% endif %}
		{% if success %}
	    <script>
			usNotify('success', '{{ success }}');
		</script>
	    {% endif %}
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>
			</div>
			<div class="panel-body">
				<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-setting" class="form-horizontal">
					<ul class="nav nav-tabs">
						<li class="active"><a href="#setting-tab" data-toggle="tab">{{ tab_setting }}</a></li>
						<li><a href="#data-tab" data-toggle="tab">{{ tab_data }}</a></li>
					</ul>
					<div class="tab-content">
						<div class="tab-pane active" id="setting-tab">
							<div class="form-group">
								<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
								<div class="col-sm-10">
									<div class="toggle-group">
										<input type="checkbox" name="oct_sreview_setting_status" {% if oct_sreview_setting_status %}checked="checked"{% endif %} id="oct_sreview_setting_status" tabindex="1">
										<label for="oct_sreview_setting_status"></label>
										<div class="onoffswitch pull-left" aria-hidden="true">
											<div class="onoffswitch-label">
												<div class="onoffswitch-inner"></div>
												<div class="onoffswitch-switch"></div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div id="all_settings" {% if oct_sreview_setting_status is not defined or (oct_sreview_setting_status is defined and not oct_sreview_setting_status) %}style="display:none"{% endif %}>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="input-review_admin_email">{{ entry_review_admin_email }}</label>
									<div class="col-sm-10">
										<select name="oct_sreview_setting_data[review_admin_email]" id="input-review_admin_email" class="form-control">
											{% if oct_sreview_setting_data.review_admin_email %}
											<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 id="email_to" {% if oct_sreview_setting_data.review_admin_email is defined and not oct_sreview_setting_data.review_admin_email %}style="display:none" {% endif %}>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="input-review_email_to">{{ entry_review_email_to }}</label>
									<div class="col-sm-10">
										<input type="text" name="oct_sreview_setting_data[review_email_to]" value="{{ oct_sreview_setting_data.review_email_to is defined ? oct_sreview_setting_data.review_email_to : config_email }}" id="input-review_email_to" placeholder="{{ entry_review_email_to }}" class="form-control" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="input-review_moderation">{{ entry_review_moderation }}</label>
									<div class="col-sm-10">
										<select name="oct_sreview_setting_data[review_moderation]" id="input-review_moderation" class="form-control">
											{% if oct_sreview_setting_data.review_moderation %}
											<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>
					</div>
					<div class="tab-pane" id="data-tab">
						<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">
									<label class="col-sm-2 control-label">{{ text_seo_title }}</label>
									<div class="col-sm-10">
										<input type="text" name="oct_sreview_setting_data[language][{{ language.language_id }}][seo_title]" value="{{ oct_sreview_setting_data.language[language.language_id] is defined ? oct_sreview_setting_data.language[language.language_id].seo_title : '' }}" class="form-control" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">{{ text_seo_h1 }}</label>
									<div class="col-sm-10">
										<input type="text" name="oct_sreview_setting_data[language][{{ language.language_id }}][seo_h1]" value="{{ oct_sreview_setting_data.language[language.language_id] is defined ? oct_sreview_setting_data.language[language.language_id].seo_h1 : '' }}" class="form-control" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">{{ text_seo_meta_description }}</label>
									<div class="col-sm-10">
										<textarea name="oct_sreview_setting_data[language][{{ language.language_id }}][seo_meta_description]" class="form-control">{{ oct_sreview_setting_data.language[language.language_id] is defined ? oct_sreview_setting_data.language[language.language_id].seo_meta_description : '' }}</textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">{{ text_seo_meta_keywords }}</label>
									<div class="col-sm-10">
										<textarea name="oct_sreview_setting_data[language][{{ language.language_id }}][seo_meta_keywords]" class="form-control">{{ oct_sreview_setting_data.language[language.language_id] is defined ? oct_sreview_setting_data.language[language.language_id].seo_meta_keywords : '' }}</textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">{{ text_seo_description }}</label>
									<div class="col-sm-10">
										<textarea id="seo_description{{ language.language_id }}" data-toggle="summernote" data-lang="{{ summernote }}"  name="oct_sreview_setting_data[language][{{ language.language_id }}][seo_description]" class="form-control summernote">{{ oct_sreview_setting_data.language[language.language_id] is defined ? oct_sreview_setting_data.language[language.language_id].seo_description : '' }}</textarea>
									</div>
								</div>
							</div>
							{% endfor %}
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	$('#language a:first').tab('show');

	$('#oct_sreview_setting_status').change(function() {
		var $input = $(this);

		if ($input.is(":checked")) {
			$("#all_settings").slideDown('slow');
		} else {
			$("#all_settings").slideUp('slow');
		}
	});

	$(function() {
		$('select#input-review_admin_email').change(function() {
			var v = $(this).val();

			if (v == 1) {
				$("#email_to").slideDown('slow');
			} else {
				$("#email_to").slideUp('slow');
			}
		});
	});
</script>
{{ footer }}