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): class ExpoCatalog(MetadataMixin, ListView):
model = Exposition model = Exposition
paginate_by = settings.CLIENT_PAGINATION paginate_by = settings.CLIENT_PAGINATION
template_name = 'exposition/catalog.html' template_name = 'client/exposition/catalog.html'
search_form = ExpositionSearchForm search_form = ExpositionSearchForm
filter_object = None filter_object = None
year = None year = None
@ -445,6 +445,12 @@ class ExpoTagCatalog(ExpoCatalog):
self.filter_object = tag self.filter_object = tag
return qs 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): class ExpoVisitors(MetadataMixin, ListView):
paginate_by = settings.CLIENT_PAGINATION paginate_by = settings.CLIENT_PAGINATION

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

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

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

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

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

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

@ -12,6 +12,7 @@
<li class="divider"></li> <li class="divider"></li>
<li><a href="/admin/import-event">Импорт</a></li> <li><a href="/admin/import-event">Импорт</a></li>
<li><a href="/admin/export-event">Экспорт</a></li> <li><a href="/admin/export-event">Экспорт</a></li>
<li><a href="/admin/import/log/">Архив логов</a></li>
</ul> </ul>
</li> </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]--> <!--if IE 8><script src="js/selectivizr-min.js"></script><![endif]-->
<head> <head>
{% include 'includes/meta.html' %} {% 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="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" /> <link rel="shortcut icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />

@ -165,15 +165,12 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if event.place_alt %} {% if not event.place %}
{% if not event.place %} <dt>{% trans 'Место проведения' %}:</dt>
<dt>{% trans 'Место проведения' %}:</dt> <dd>
<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 %}
{{ event.place_alt }} </dd>
</dd> {% endif %}
{% endif %}
{% endif %}
{% if event.web_page %} {% if event.web_page %}
<dt>{% trans 'Веб-сайт' %}:</dt> <dt>{% trans 'Веб-сайт' %}:</dt>
<dd> <dd>

@ -169,15 +169,13 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if exposition.place_alt %} {% if not exposition.place %}
{% if not exposition.place %} <dt>{% trans 'Место проведения' %}:</dt>
<dt>{% trans 'Место проведения' %}:</dt> <dd>
<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 %}
{{ exposition.place_alt }} </dd>
</dd> {% endif %}
{% endif %}
{% endif %}
{% if exposition.web_page %} {% if exposition.web_page %}
<dt>{% trans 'Веб-сайт' %}:</dt> <dt>{% trans 'Веб-сайт' %}:</dt>
<dd> <dd>

Loading…
Cancel
Save