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.
274 lines
11 KiB
274 lines
11 KiB
{% extends 'base.html' %}
|
|
{% load static %}
|
|
{# Displays country form and file form in modal window #}
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
|
|
<script src="{% static 'tiny_mce/tiny_mce.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>
|
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
{# Uses multilang.html template for translated fields #}
|
|
<form method="post" class="form-horizontal" enctype="multipart/form-data" name="form1" id="form1"> {% csrf_token %}
|
|
<fieldset>
|
|
<legend><i class="icon-edit"></i>{% if obj_id %} Изменить {% else %} Добавить {% endif %}страну</legend>
|
|
|
|
<div class="box span8">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> Основная информация</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
{# Hidden input uses for comparing with TmpFile objects #}
|
|
{{ form.key }}
|
|
{# Hidden input uses in clean method for checking url #}
|
|
{{ form.country_id }}
|
|
|
|
{# name #}
|
|
{% with field='name' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# description #}
|
|
{% with field='description' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
|
|
<div class="control-group {% if form.logo.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.logo.label }}:</label>
|
|
<div class="controls">{{ form.logo }}
|
|
<span class="help-inline">{{ form.logo.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# capital #}
|
|
<div class="control-group {% if form.capital.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.capital.label }}:</label>
|
|
<div class="controls">{{ form.capital}}
|
|
<span class="help-inline">{{ form.capital.errors }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
{# language #}
|
|
<div class="control-group {% if form.language.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.language.label }}:</label>
|
|
<div class="controls">
|
|
{{ form.language }}
|
|
<span class="help-inline">{{ form.language.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# population #}
|
|
<div class="control-group {% if form.population.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.population.label }}:</label>
|
|
<div class="controls">
|
|
<div class="input-prepend input-append">
|
|
{{ form.population }}<span class="add-on">млн</span>
|
|
</div><span class="help-inline">{{ form.population.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# teritory #}
|
|
<div class="control-group {% if form.teritory.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.teritory.label }}:</label>
|
|
<div class="controls">
|
|
<div class="input-prepend input-append">
|
|
{{ form.teritory }}<span class="add-on">км<sup>2</sup></span>
|
|
</div>
|
|
<span class="help-inline">{{ form.teritory.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# timezone #}
|
|
<div class="control-group {% if form.timezone.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.timezone.label }}:</label>
|
|
<div class="controls">{{ form.timezone }}
|
|
<span class="help-inline">{{ form.timezone.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# phone code #}
|
|
<div class="control-group {% if form.phone_code.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.phone_code.label }}:</label>
|
|
<div class="controls">{{ form.phone_code }}
|
|
<span class="help-inline">{{ form.phone_code.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# currency #}
|
|
<div class="control-group {% if form.currency.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.currency.label }}:</label>
|
|
<div class="controls">{{ form.currency }}
|
|
<span class="help-inline">{{ form.currency.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# big cities #}
|
|
<div class="control-group {% if form.big_cities.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.big_cities.label }}:</label>
|
|
<div class="controls">{{ form.big_cities }}
|
|
<span class="help-inline">{{ form.big_cities.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# transport #}
|
|
{% with field='transport' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<a name="file"></a>
|
|
<div class="box span8" id="file">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> Файлы</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
{# button that shows modal window with file form #}
|
|
<a href="#myModal" id="file_add" role="button" class="btn btn-info" data-toggle="modal">Добавить файл</a>
|
|
{# 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>
|
|
{% for file in files %}
|
|
|
|
<tr>
|
|
<td>{{ file.id }}</td>
|
|
<td><img src="{{ file.file_path.url }}"></td>
|
|
<td>{{ file.file_name }}</td>
|
|
<td>{{ file.purpose }}</td>
|
|
<td>
|
|
<button class="btn btn-danger delete_file" value="{{ file.id }}">
|
|
<i class="icon-trash icon-white"></i> Удалить
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box span8">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i> Визовая информация</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
{# rules #}
|
|
{% with field='rules' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# time delivery #}
|
|
<div class="control-group {% if form.time_delivery.errors %}error{% endif %}">
|
|
<label class="control-label">{{ form.time_delivery.label }}:</label>
|
|
<div class="controls">
|
|
<div class="input-prepend input-append">
|
|
{{ form.time_delivery }}<span class="add-on">дней</span>
|
|
</div>
|
|
<span class="help-inline">{{ form.time_delivery.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# documents #}
|
|
{% with field='documents' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# consulate #}
|
|
{% with field='consulate' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box span8">
|
|
<div class="box-header well">
|
|
<h2><i class="icon-pencil"></i>Мета данные</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
{# keywords #}
|
|
{% with field='keywords' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# title #}
|
|
{% with field='title' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# descriptions #}
|
|
{% with field='descriptions' form=form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="controls">
|
|
<input class="btn btn-large btn-primary" type="submit" value="Добавить">
|
|
<input class="btn btn-large" type="reset" value="Отмена">
|
|
</div>
|
|
|
|
</fieldset>
|
|
</form>
|
|
|
|
{# modal window #}
|
|
<div class="modal hide fade" id="myModal" >
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="close">×</button>
|
|
<h3>Добавить файл</h3>
|
|
</div>
|
|
|
|
<div id="form_body">
|
|
<div class="modal-body">
|
|
<form method="post" class="form-horizontal" enctype="multipart/form-data" name="file_form" id="file_form" > {% csrf_token %}
|
|
|
|
{# hidden inputs uses for comparing with Country form key#}
|
|
{{ file_form.key }}
|
|
{{ file_form.model }}
|
|
<input type="hidden" id="obj_id" value="{{ obj_id }}">
|
|
{# file_path #}
|
|
<div class="control-group{% if file_form.file_path.errors %}error{% endif %}">
|
|
<label class="control-label"><b>{{ file_form.file_path.label }}:</b></label>
|
|
<div class="controls">{{ file_form.file_path }}
|
|
<span class="help-inline">{{ file_form.file_path.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# file purpose #}
|
|
<div class="control-group{% if file_form.purpose.errors %}error{% endif %}">
|
|
<label class="control-label"><b>{{ file_form.purpose.label }}:</b></label>
|
|
<div class="controls">{{ file_form.purpose }}
|
|
<span class="help-inline">{{ file_form.purpose.errors }}</span>
|
|
</div>
|
|
</div>
|
|
{# file_name #}
|
|
{% with field='file_name' form=file_form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
{# file_description #}
|
|
{% with field='description' form=file_form languages=languages %}
|
|
{% include 'c_admin/forms/multilang.html' %}
|
|
{% endwith %}
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<div class="controls">
|
|
<input class="btn btn-primary" type="submit" value="Добавить">
|
|
<input type="reset" class="btn" value="Отменить" data-dismiss="modal">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|