remotes/origin/1203
Nazar Kotyuk 12 years ago
parent e80b795beb
commit cd8e7f9029
  1. 1
      core/views.py
  2. 1
      exposition/views.py
  3. 7
      functions/custom_views.py
  4. BIN
      media/imgs/cl-logo-3.png
  5. 1
      media/import/.~lock.expositions_ru.xlsx#
  6. 1
      media/import/.~lock.places_en.xlsx#
  7. 1
      media/import/.~lock.places_en123.xlsx#
  8. 1
      media/import/.~lock.places_ru.xlsx#
  9. 19
      settings/templatetags/template_filters.py
  10. 11
      templates/client/includes/show_date_block.html

@ -79,6 +79,7 @@ class PlaceListView(ListView):
template_name = 'place_catalog_test.html'
model = 'places'
search_form = PlaceSearchForm
order = 'data_begin'
def get_params(self):
model_names = {'places': _(u'Места')}

@ -50,6 +50,7 @@ class ExpositionView(ExpoListView):
model = Exposition
template_name = 'event_catalog.html'
search_form = ExpositionSearchForm
order = 'data_begin'
def get_context_data(self, **kwargs):
context = super(ExpositionView, self).get_context_data(**kwargs)

@ -226,6 +226,7 @@ class ExpoListView(ExpoMixin, ListView):
params = None
single_page = False
search_form = None
order = None
def get_queryset(self):
query = self.model.objects.all()
@ -284,8 +285,10 @@ class ExpoListView(ExpoMixin, ListView):
self.params = params
return query.order_by('data_begin')
if self.order:
return query.order_by(self.order)
else:
return query
def get_context_data(self, **kwargs):
context = super(ExpoListView, self).get_context_data(**kwargs)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

@ -0,0 +1 @@
kotzilla ,kotzilla,kotzilla-Satellite-L300,27.05.2014 19:59,file:///home/kotzilla/.config/libreoffice/3;

@ -1 +0,0 @@
kotzilla ,kotzilla,kotzilla-Satellite-L300,27.05.2014 17:23,file:///home/kotzilla/.config/libreoffice/3;

@ -1 +0,0 @@
kotzilla ,kotzilla,kotzilla-Satellite-L300,27.05.2014 17:23,file:///home/kotzilla/.config/libreoffice/3;

@ -0,0 +1 @@
kotzilla ,kotzilla,kotzilla-Satellite-L300,27.05.2014 19:16,file:///home/kotzilla/.config/libreoffice/3;

@ -99,4 +99,21 @@ def in_calendar(event, user):
if event in calendar.get_events():
return True
return False
return False
from datetime import datetime, timedelta
from django import template
from django.utils.timesince import timesince
@register.filter
def timesince_exp(value, date=None):
"""
return timesince(<value>) if value is more than <days> old. Return value otherwise
"""
delta = timedelta(days=28)
d = date -value
if d>delta:
return True
return False

@ -1,17 +1,22 @@
{% load i18n %}
{% load template_filters %}
{% if obj.data_begin|timesince_exp:obj.data_end %}
{% if obj.data_begin|timesince:obj.data_end > "4 week" %}
{{ obj.data_begin|date:"F" }}
{% else %}
{% if obj.data_begin|timesince:obj.data_end < "1 day" %}
{{ obj.data_begin }}
{% else %}
{% if obj.data_end %}
{% trans 'с' %} {{ obj.data_begin|date:"j" }} {% trans 'по' %} {{ obj.data_end }}
{% trans 'с' %}{% ifnotequal obj.data_begin|date:"F" obj.data_end|date:"F" %} {{ obj.data_begin|date:"j F" }}{% else %} {{ obj.data_begin|date:"j" }}{% endifnotequal %} {% trans 'по' %} {{ obj.data_end }}
{% else %}
{{ obj.data_begin }}
{% endif %}
{% endif %}
{% endif %}
{% endif %}

Loading…
Cancel
Save