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.
 
 
 
 
 
 

82 lines
3.6 KiB

{% load static %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-pencil"></i>Фотогалерея</h2>
</div>
<div class="box-content">
{% if object %}
<a class="btn btn-success" href="#photopopup" data-toggle="modal"><i class="icon-plus-sign icon-white"></i> Фото</a>
<a href="{{ object.photogallery.admin_url }}" role="button" class="btn btn-info" data-toggle="modal">Просмотреть галерею</a><br><br>
{% else %}
<p>Фото можна добавлять только после введения основных даных</p>
{% endif %}
{% with photos=object.photogallery.photos.all %}
<div class="clearfix">
{% for photo in photos %}
<div class="photo" style="float: left;margin-right: 15px;">
<div class="hover">
<a href="{{ photo.get_delete_url }}" class="btn-small btn-danger delete-photo">удалить</a>
</div>
<div>
<a href="/admin/photogallery/photo/{{ photo.slug }}/">
<img src="{{ photo.get_admin_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
</a>
</div>
</div>
{% endfor %}
</div>
{% endwith %}
{# <form method="post" class="form-horizontal" id="photo_form" enctype="multipart/form-data" action="{{ object.upload_photo_url }}">#}
{# {% csrf_token %}#}
{# <div class="control-group{% if form.image.errors %}error{% endif %}">#}
{# <label class="control-label">{{ form.image.label }}:</label>#}
{# <div class="controls">#}
{# {{ form.image }}#}
{# <span class="help-inline">{{ form.image.errors }}</span>#}
{# </div>#}
{# </div>#}
{# <div class="control-group{% if form.sort.errors %}error{% endif %}">#}
{# <label class="control-label">{{ form.sort.label }}:</label>#}
{# <div class="controls">{{ form.sort }}#}
{# <span class="help-inline">{{ form.sort.errors }}</span>#}
{# </div>#}
{# </div>#}
{# {% with field='caption' form=form languages=languages %}#}
{# {% include 'c_admin/forms/multilang.html' %}#}
{# {% endwith %}#}
{##}
{# {% with field='title' form=form languages=languages %}#}
{# {% include 'c_admin/forms/multilang.html' %}#}
{# {% endwith %}#}
{##}
{# <div class="controls">#}
{# <input class="btn btn-primary" type="submit" value="Добавить">#}
{# </div>#}
{# </form>#}
<div class="file_upload_container"
data-upload-url="{{ object.upload_photo_url }}"
data-get-url="{{ object.upload_photo_url }}"
data-languages="ru|en"
data-fields="title|caption">
<input type="file" name="image" class="file_uploader">
<a href="#" class="btn btn-success upload_loaded_files">Загрузить файлы</a>
</div>
<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>
</div>
</div>