Remove bugs

remotes/origin/1203
Kotiuk Nazarii 11 years ago
parent 19adfff168
commit f9dc583cb4
  1. 8
      exposition/views.py
  2. 9
      import_xls/import_forms.py
  3. 13
      import_xls/utils.py
  4. 6
      templates/admin/base.html
  5. 36
      templates/admin/conference/conference_list.html
  6. 6
      templates/admin/exposition/exposition.html
  7. 1
      templates/admin/import templates/log.html
  8. 1
      templates/admin/includes/admin_nav.html
  9. 2
      templates/client/blank.html
  10. 15
      templates/client/includes/conference/conference_object.html
  11. 14
      templates/client/includes/exposition/exposition_object.html

@ -294,7 +294,7 @@ MONTHES = settings.MONTHES
class ExpoCatalog(MetadataMixin, ListView):
model = Exposition
paginate_by = settings.CLIENT_PAGINATION
template_name = 'exposition/catalog.html'
template_name = 'client/exposition/catalog.html'
search_form = ExpositionSearchForm
filter_object = None
year = None
@ -445,6 +445,12 @@ class ExpoTagCatalog(ExpoCatalog):
self.filter_object = tag
return qs
def get_context_data(self, **kwargs):
context = super(ExpoTagCatalog, self).get_context_data(**kwargs)
tag = self.kwargs['tag']
context['theme_for_filter'] = tag.theme
return context
class ExpoVisitors(MetadataMixin, ListView):
paginate_by = settings.CLIENT_PAGINATION

@ -288,13 +288,13 @@ class ImportEventForm(ImportForm):
if row[0] != '':
# in first column id
try:
obj = self.model.objects.language(lang).get(id=int(row[0]))
obj = model.objects.language(lang).get(id=int(row[0]))
except ValueError:
obj = self.model()
obj = model()
obj.translate(lang)
except self.model.DoesNotExist:
obj = self.model(id= int(row[0]))
except model.DoesNotExist:
obj = model(id= int(row[0]))
obj.translate(lang)
else:
# if id blank - its a new event
@ -359,6 +359,7 @@ class ImportEventForm(ImportForm):
except Exception:
setattr(obj, 'place_alt', cell)
if not obj.url:
a = obj.name
obj.url = translit_with_separator(obj.name)
obj.is_published = True
try:

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
import urllib2
import time, xlrd
import os
from PIL import Image
from django.conf import settings
from django.utils import translation
from hvad.utils import get_translation_aware_manager
@ -134,6 +136,7 @@ def to_periodic(value):
def to_audience(value, model=Exposition):
if value:
translation.activate('ru')
l = value.split(', ')
if l:
new_list = []
@ -190,9 +193,9 @@ def save_logo(obj, path):
return None
try:
response = urllib2.urlopen(url, timeout=15)
response = urllib2.urlopen(url, timeout=5)
except:
return None
return u'Превышено время ожидания'
with open(download_to,'wb') as f:
try:
@ -202,6 +205,12 @@ def save_logo(obj, path):
# can be timeout
return u'Превышено время ожидания'
try:
# check if image
im=Image.open(download_to)
except IOError:
os.remove(download_to)
return u'Неправильный формат логотипа'
obj.logo = logo_path + alt_name
try:
obj.save()

@ -31,9 +31,9 @@
<link href="{% static 'css/uploadify.css' %}" rel='stylesheet'>
{# The fav icon #}
<link rel="shortcut icon" href="img/favicon.ico">
{# datetimepicker #}
<link href="{% static 'js/datetimepicker/css/datetimepicker.css' %}" rel="stylesheet"/>
<script src="{% static 'js/datetimepicker/js/bootstrap-datetimepicker.js' %}"></script>
{# datetimepicker #}
<link href="{% static 'js/datetimepicker/css/datetimepicker.css' %}" rel="stylesheet"/>
<script src="{% static 'js/datetimepicker/js/bootstrap-datetimepicker.js' %}"></script>
<script src="{% static 'custom_js/main.js' %}"></script>
{% block scripts %}

@ -7,6 +7,17 @@
{% endblock %}
{% block styles %}
td a{
float:left;
margin: 0 10px 10px 0
}
{% endblock %}
{% block body %}
<div class="box span8">
@ -32,6 +43,7 @@
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Название</th>
<th>Дата начала</th>
<th>&nbsp;</th>
@ -41,31 +53,29 @@
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td>
<td style="width: 200px; height:100px;">
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/conference/switch/{{ item.url }}/off">
Отключить
</a>
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/conference/switch/{{ item.url }}/on">
Включить
</a>
<a class="btn-small btn-info" href="/admin/conference/{{ item.url|lower }}">
Изменить
</a>
<a class="btn-small btn-inverse" target="_blank" href="{{ item.get_permanent_url }}">
на сайте
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/conference/{{ item.url|lower }}">
Изменить
<a class="btn-small btn-danger" href="/admin/conference/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/conference/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>

@ -22,12 +22,6 @@
{# selects #}
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/>
<script src="{% static 'js/select/select2.js' %}"></script>
{# datepicker #}
<link href="{% static 'js/datepicker/css/datepicker.css' %}" rel="stylesheet"/>
<script src="{% static 'js/datepicker/js/bootstrap-datepicker.js' %}"></script>
<script src="{% static 'custom_js/formset_add.js' %}"></script>

@ -38,7 +38,6 @@ Displays lists of all cities in the table
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/city/add"><i class="icon-plus-sign icon-white"></i> Добавить город</a>
</div>
{% include 'admin/includes/admin_pagination.html' with page_obj=objects %}

@ -12,6 +12,7 @@
<li class="divider"></li>
<li><a href="/admin/import-event">Импорт</a></li>
<li><a href="/admin/export-event">Экспорт</a></li>
<li><a href="/admin/import/log/">Архив логов</a></li>
</ul>
</li>

@ -22,6 +22,8 @@ This template include basic anf main styles and js files,
<!--if IE 8><script src="js/selectivizr-min.js"></script><![endif]-->
<head>
{% include 'includes/meta.html' %}
<meta name="cmsmagazine" content="ca270688603566278c9006a1511705b1" />
<meta name="ktoprodvinul" content="7bf9e596b7b6707a" />
<link rel="icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />
<link rel="shortcut icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />

@ -165,15 +165,12 @@
{% endif %}
{% endif %}
{% if event.place_alt %}
{% if not event.place %}
<dt>{% trans 'Место проведения' %}:</dt>
<dd>
{{ event.place_alt }}
</dd>
{% endif %}
{% endif %}
{% if not event.place %}
<dt>{% trans 'Место проведения' %}:</dt>
<dd>
<a href="{{ event.get_catalog_url }}country/{{ event.country.url }}/">{{ event.country.name }}</a> , <a href="{{ event.get_catalog_url }}city/{{ event.city.url }}/">{{ event.city.name }}</a>{% if event.place_alt %} , {{ event.place_alt }}{% endif %}
</dd>
{% endif %}
{% if event.web_page %}
<dt>{% trans 'Веб-сайт' %}:</dt>
<dd>

@ -169,15 +169,13 @@
{% endif %}
{% endif %}
{% if exposition.place_alt %}
{% if not exposition.place %}
<dt>{% trans 'Место проведения' %}:</dt>
<dd>
{{ exposition.place_alt }}
</dd>
{% endif %}
{% if not exposition.place %}
<dt>{% trans 'Место проведения' %}:</dt>
<dd>
<a href="{{ exposition.get_catalog_url }}country/{{ exposition.country.url }}/">{{ exposition.country.name }}</a> , <a href="{{ exposition.get_catalog_url }}city/{{ exposition.city.url }}/">{{ exposition.city.name }}</a>{% if exposition.place_alt %} , {{ exposition.place_alt }}{% endif %}
</dd>
{% endif %}
{% endif %}
{% if exposition.web_page %}
<dt>{% trans 'Веб-сайт' %}:</dt>
<dd>

Loading…
Cancel
Save