<!-- Preload JS/CSS for plugins -->
{{ preloadRAW }}
<!-- /end preload -->
<div class="comments-area" style=" margin-bottom: 30px;">
	<div class="row mb-2">
		<div class="col-sm-6 d-none d-md-block ">
			<h3>
				{{ lang['static_title'] }}</h3>
		</div>
		<!-- /.col -->
		<div class="col-sm-6">
			<ol class="breadcrumb float-sm-right">
				<li class="breadcrumb-item">
					<a href="{{ php_self }}">
						<i class="fa fa-home"></i>
					</a>
				</li>
				<li class="breadcrumb-item">
					<a href="{{ php_self }}?mod=static">{{ lang['static_title'] }}</a>
				</li>
				<li class="breadcrumb-item active" aria-current="page">
					{% if (flags.editMode) %}
						{{ data.title }}
					{% else %}
						{{ lang['static_title_add'] }}
					{% endif %}
				</li>

			</ol>
		</div>
		<!-- /.col -->
	</div>
	<!-- /.row -->
</div>
<div class="comments-area">
	<form name="form" id="postForm" method="post" action="{{ php_self }}?mod=static" target="_self">
		<input type="hidden" name="token" value="{{ token }}"/>
		{% if (flags.editMode) %}
			<input type="hidden" name="action" value="edit"/>
			<input type="hidden" name="id" value="{{ data.id }}"/>
		{% else %}
			<input type="hidden" name="action" value="add"/>
		{% endif %}
		<table border="0" cellspacing="1" cellpadding="0" width="98%">
			<tr>
				<td>
					<!-- MAIN CONTENT -->
					<div id="maincontent" class="card mb-4">
				<div class="card-body">
					<div class="form-row mb-3">
						<label class="col-lg-3 col-form-label">{{ lang['title'] }}</label>
						<div class="col-lg-9">
							{% if (flags.isPublished) %}
								<div class="input-group">
									<input type="text" name="title" value="{{ data.title }}" class="form-control" />
									<div class="input-group-append">
										<span class="input-group-text">
											<a href="{{ data.url }}" target="_blank">
												<i class="fa fa-external-link"></i>
											</a>
										</span>
									</div>
								</div>
							{% else %}
								<input type="text" name="title" value="{{ data.title }}" class="form-control" />
							{% endif %}
						</div>
					</div>

					<div class="form-row mb-3">
						<label class="col-lg-3 col-form-label">{{ lang['alt_name'] }}</label>
						<div class="col-lg-9">
							<input type="text" name="alt_name" value="{{ data.alt_name }}" class="form-control" />
						</div>
					</div>

					{% if (flags.isPublished) %}
						<div class="form-row mb-3">
							<label class="col-lg-3 col-form-label">{{ lang['url_static_page'] }}</label>
							<div class="col-lg-9">
								<input type="text" value="{{ data.url }}" class="form-control" readonly />
							</div>
						</div>
					{% endif %}

					{% if not(flags.disableTagsSmilies) %}
						{{ quicktags }}
						<!-- SMILES -->
						<div id="modal-smiles" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="smiles-modal-label" aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<h5 id="smiles-modal-label" class="modal-title">Вставить смайл</h5>
										<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
									</div>
									<div class="modal-body">
										{{ smilies }}
									</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Cancel</button>
									</div>
								</div>
							</div>
						</div>
					{% endif %}

					<div class="mb-3">
						<textarea id="content" name="content" class="{{ editorClassName ? editorClassName : 'form-control' }}" rows="10">{{ data.content }}</textarea>
					</div>

					{% if (flags.meta) %}
						<div class="form-row mb-3">
							<label class="col-lg-3 col-form-label">{{ lang['description'] }}</label>
							<div class="col-lg-9">
								<textarea name="description" cols="80" class="form-control">{{ data.description }}</textarea>
							</div>
						</div>

						<div class="form-row mb-3">
							<label class="col-lg-3 col-form-label">{{ lang['keywords'] }}</label>
							<div class="col-lg-9">
								<textarea name="keywords" cols="80" class="form-control">{{ data.keywords }}</textarea>
							</div>
						</div>
					{% endif %}
				</div>
			</div>

				</td>
			</tr>
		</table>


		<!-- Right edit column -->
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td>
					<span class="f15">{{ lang['editor.configuration'] }}</span>
				</td>
			</tr>
			<tr>
				<td>
					<div class="list">
							<label class="col-form-label d-block">
						{% if (not flags.canPublish) or (not flags.canUnpublish) %}
							<input type="checkbox" name="flag_published" value="1" {{ data.flag_published ? 'checked' : '' }} disabled />
						{% else %}
							<input type="checkbox" name="flag_published" value="1" {{ data.flag_published ? 'checked' : '' }} />
						{% endif %}
						{{ lang['approve'] }}
					</label>

					<label class="col-form-label d-block">
						<input type="checkbox" name="flag_html" value="1" {{ data.flag_html ? 'checked' : '' }} />
						{{ lang['flag_html'] }}
					</label>

					<label class="col-form-label d-block">
						<input type="checkbox" name="flag_raw" value="1" {{ data.flag_raw ? 'checked' : '' }} />
						{{ lang['flag_raw'] }}
					</label>
					</div>

				</td>
			</tr>

			<tr>
				<td>
					<span class="f15">{{ lang['editor.template'] }}</span>
				</td>
			</tr>
			<tr>
				<td>
					<div class="list">
						<select name="template" class="custom-select">
							{% for t in templateList %}
								<option value="{{ t }}" {{ data.template == t ? 'selected' : '' }}>{{ t }}</option>
							{% endfor %}
						</select>
            <br/><br/>
						<label class="col-form-label d-block">
						<input type="checkbox" name="flag_template_main" value="1" {{ data.flag_template_main ? 'checked' : '' }} /> {{ lang['flag_main'] }}
					</label>

					</div>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>
<br/>
<table id="edit" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
	<td width="100%" class="contentEdit" align="center" valign="top">
		{% if (flags.editMode) %}
					{% if (flags.canModify) %}
						<div class="col-md-6 mb-4">
							<button type="button" class="btn btn-outline-danger" onclick="confirmit('{{ php_self }}?mod=static&token={{ token }}&action=do_mass_delete&selected[]={{ data.id }}', '{{ lang['sure_del'] }}')">
								<span class="d-xl-none"><i class="fa fa-trash"></i></span>
								<span class="d-none d-xl-block">{{ lang['delete'] }}</span>
							</button>
						</div>

						<div class="col-md-6 mb-4 text-right">
							<button type="submit" class="btn btn-outline-success">
								<span class="d-xl-none"><i class="fa fa-floppy-o"></i></span>
								<span class="d-none d-xl-block">{{ lang['do_editnews'] }}</span>
							</button>
						</div>
					{% endif %}
				{% else %}
					{% if (flags.canAdd) %}
					<div class="col-md-6 mb-4 text-right">
						<button type="submit" class="btn btn-outline-success">
							<span class="d-xl-none"><i class="fa fa-floppy-o"></i></span>
							<span class="d-none d-xl-block">{{ lang['addstatic'] }}</span>
						</button>
					</div>
					{% endif %}
				{% endif %}
	</td>
</tr>
</table>
</form>
</div>

<form id="DATA_tmp_storage" name="DATA_tmp_storage" action="">
<input type="hidden" name="area" value=""/>
</form>
<script type="text/javascript">var currentInputAreaID = 'content';</script>
