You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
6.3 KiB
134 lines
6.3 KiB
{% extends 'base.html' %}
|
|
{% load static %}
|
|
{# Displays article form #}
|
|
|
|
{% block scripts %}
|
|
|
|
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
|
|
{# selects #}
|
|
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/>
|
|
<script src="{% static 'js/select/select2.js' %}"></script>
|
|
<script src="{% static 'custom_js/make_select.js' %}"></script>
|
|
{# ajax #}
|
|
<script src="{% static 'custom_js/file_post_ajax.js' %}"></script>
|
|
<script src="{% static 'custom_js/select_tag.js' %}"></script>
|
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
<form method="post" class="form-horizontal" name="form2" id="form2"enctype="multipart/form-data"> {% csrf_token %}
|
|
<fieldset>
|
|
<legend><i class="icon-edit"></i>{% if article %} Изменить {% else %} Добавить {% endif %}статью{% if article %}(<a href="{{ article.get_permanent_url }}" target="_blank">на сайте</a>){% endif %}</legend>
|
|
|
|
<div class="box span8">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> Основная информация</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
|
|
{# main_title #}
|
|
{% include 'admin/forms/multilang.html' with field='main_title' form=form languages=languages %}
|
|
|
|
{# theme #}
|
|
<div class="control-group {% if form.theme.errors %}error{% endif %}">
|
|
<label class="control-label"><b>{{ form.theme.label }}:</b></label>
|
|
<div class="controls">
|
|
{{ form.theme }}
|
|
<span class="help-inline">{{ form.theme.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# tag #}
|
|
<div class="control-group {% if form.tag.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.tag.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.tag }}
|
|
<span class="help-inline">{{ form.tag.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# exposition #}
|
|
{% if form.exposition %}
|
|
<div class="control-group {% if form.exposition.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.exposition.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.exposition }}
|
|
<span class="help-inline">{{ form.exposition.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{# conference #}
|
|
{% if form.conference%}
|
|
<div class="control-group {% if form.conference.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.conference.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.conference }}
|
|
<span class="help-inline">{{ form.conference.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{# logo #}
|
|
<div class="control-group {% if form.logo.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.logo.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.logo }}
|
|
{% if article.logo %}
|
|
|
|
<img src="{{ article.logo.url }}">
|
|
{% endif %}
|
|
<span class="help-inline">{{ form.logo.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# preview #}
|
|
{% include 'admin/forms/multilang.html' with field='preview' form=form languages=languages %}
|
|
{# description #}
|
|
{% include 'admin/forms/multilang.html' with field='description' form=form languages=languages %}
|
|
{# keywords #}
|
|
{% include 'admin/forms/multilang.html' with field='keywords' form=form languages=languages %}
|
|
{# title #}
|
|
{% include 'admin/forms/multilang.html' with field='title' form=form languages=languages %}
|
|
{# descriptions #}
|
|
{% include 'admin/forms/multilang.html' with field='descriptions' form=form languages=languages %}
|
|
</div>
|
|
|
|
</div>
|
|
<div class="box span8" id="file">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> Файлы</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
{% if article %}
|
|
{# button that shows modal window with file form #}
|
|
<a href="#myModal" id="file_add" role="button" class="btn btn-info" data-toggle="modal">Добавить файл</a>
|
|
{% else %}
|
|
<p>Файлы можно добавлять только после введения основных данных</p>
|
|
{% endif %}
|
|
{# this div shows list of files and refreshes when new file added #}
|
|
<div id="file_list">
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>Файл</td>
|
|
<td>Имя</td>
|
|
<td>Назначение</td>
|
|
<td></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% include 'file_list.html' with files=files %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="controls">
|
|
|
|
<input class="btn btn-large btn-primary" type="submit" value="{% if article %}Изменить{% else %}Добавить{% endif %}">
|
|
<input class="btn btn-large" type="reset" value="Отмена">
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
|
|
{% include 'admin/includes/file_form.html' with file_form=file_form object=article %}
|
|
{% endblock %} |