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.
241 lines
10 KiB
241 lines
10 KiB
{% extends 'base.html' %}
|
|
{% load static %}
|
|
{% load i18n %}
|
|
{# 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>
|
|
{# ajax #}
|
|
<script src="{% static 'custom_js/file_post_ajax.js' %}"></script>
|
|
<script src="{% static 'custom_js/select_tag.js' %}"></script>
|
|
|
|
|
|
<link href="{% static 'js/datetimepicker/css/datetimepicker.css' %}" rel="stylesheet"/>
|
|
<script src="{% static 'js/datetimepicker/js/bootstrap-datetimepicker.js' %}"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('#id_publish_date').datetimepicker({
|
|
todayHighlight: true,
|
|
format : 'yyyy-mm-dd',
|
|
minView:2
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="{% static 'jQuery-filer/css/jquery.filer.css' %}">
|
|
<link rel="stylesheet" href="{% static 'jQuery-filer/css/jquery.filer-dragdropbox-theme.css' %}">
|
|
<script src="{% static 'jQuery-filer/js/jquery.filer.js' %}"></script>
|
|
<script src="{% static 'jQuery-filer/js/init.js' %}"></script>
|
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{{ form.errors }}
|
|
<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 %} {% trans "Изменить" %} {% else %} {% trans "Добавить" %} {% endif %}{% trans "статью" %}{% if article %}(<a href="{{ article.get_permanent_url }}" target="_blank">{% trans "на сайте" %}</a>){% endif %}</legend>
|
|
|
|
<div class="box span8">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> {% trans "Основная информация" %}</h2>
|
|
</div>
|
|
|
|
<div class="box-content">
|
|
|
|
{# main_title #}
|
|
{% include 'c_admin/forms/multilang.html' with field='main_title' form=form languages=languages %}
|
|
|
|
<div class="control-group {% if form.publish_date.errors %}error{% endif %}">
|
|
<label class="control-label"><b>{{ form.publish_date.label }}:</b></label>
|
|
<div class="controls">
|
|
{{ form.publish_date }}
|
|
<span class="help-inline">{{ form.publish_date.errors }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
{% if not article %}
|
|
<div class="control-group {% if form.slug.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.slug.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.slug }}
|
|
<span class="help-inline">{{ form.slug.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# 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>
|
|
{# author #}
|
|
<div class="control-group {% if form.author.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.author.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.author }}
|
|
<span class="help-inline">{{ form.author.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# preview #}
|
|
{% include 'c_admin/forms/multilang.html' with field='preview' form=form languages=languages %}
|
|
{# description #}
|
|
{% include 'c_admin/forms/multilang.html' with field='description' form=form languages=languages %}
|
|
{# short description #}
|
|
{% include 'c_admin/forms/multilang.html' with field='short_description' form=form languages=languages %}
|
|
{# keywords #}
|
|
{% include 'c_admin/forms/multilang.html' with field='keywords' form=form languages=languages %}
|
|
{# title #}
|
|
{% include 'c_admin/forms/multilang.html' with field='title' form=form languages=languages %}
|
|
{# descriptions #}
|
|
{% include 'c_admin/forms/multilang.html' with field='descriptions' form=form languages=languages %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% include 'c_admin/includes/filegallery.html' with object=article model='article.Article' %}
|
|
|
|
{% if form.draft %}
|
|
<div class="box span8">
|
|
<div class="control-group {% if form.draft.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.draft.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.draft }}
|
|
<span class="help-inline">{{ form.draft.errors }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<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>
|
|
{% endblock %}
|
|
|
|
|
|
{% block bot_scripts %}
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('#id_exposition').select2({
|
|
placeholder: "Выставка",
|
|
multiple: false,
|
|
width: 'element',
|
|
ajax: {
|
|
|
|
url: "/admin/exposition/search/",
|
|
width: '550px',
|
|
dataType: "json",
|
|
quietMillis: 200,
|
|
|
|
data: function(term, page, theme){
|
|
return {term: term,
|
|
page: page};
|
|
},
|
|
|
|
results: function (data) {
|
|
var results = [];
|
|
$.each(data, function(index, item){
|
|
results.push({
|
|
id: item.id,
|
|
text: item.label
|
|
});
|
|
});
|
|
return {results: results};
|
|
}
|
|
},
|
|
initSelection : function(element, callback) {
|
|
var id= $(element).val();
|
|
var text = $(element).attr('data-init-text');
|
|
callback({id: id, text:text});
|
|
|
|
}
|
|
});
|
|
|
|
$('#id_conference').select2({
|
|
placeholder: "Конференция",
|
|
multiple: false,
|
|
width: 'element',
|
|
ajax: {
|
|
|
|
url: "/admin/conference/search/",
|
|
width: '550px',
|
|
dataType: "json",
|
|
quietMillis: 200,
|
|
|
|
data: function(term, page, theme){
|
|
return {term: term,
|
|
page: page};
|
|
},
|
|
|
|
results: function (data) {
|
|
var results = [];
|
|
$.each(data, function(index, item){
|
|
results.push({
|
|
id: item.id,
|
|
text: item.label
|
|
});
|
|
});
|
|
return {results: results};
|
|
}
|
|
},
|
|
initSelection : function(element, callback) {
|
|
var id= $(element).val();
|
|
var text = $(element).attr('data-init-text');
|
|
callback({id: id, text:text});
|
|
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|