remotes/origin/stage6
Alexander Burdeinyi 9 years ago
parent 0fcf4755a6
commit 61998a1f89
  1. 8
      emencia/django/newsletter/templates/newsletter/AutomaticEmail_v2.html
  2. 12
      functions/model_mixin.py

@ -150,7 +150,7 @@
<tr>
<td style="color: #3399cc; font-size: 17px; padding: 3px 0px 3px 0px;">
<img src="cid:calendar" alt="">
{{ obj.get_dates }}, {{ obj.get_event_place_name }}
{{ obj.get_dates_v2 }}, {{ obj.get_event_place_name }}
</td>
</tr>
@ -220,7 +220,7 @@
<tr>
<td style="color: #3399cc; font-size: 14px; padding-bottom: 7px;">
<img src="cid:calendar" alt="" style="display: inline-block; margin-top: -2px; vertical-align: middle; margin-right: 4px;">
{{ obj.get_dates }}
{{ obj.get_dates_v2 }}
</td>
</tr>
@ -324,7 +324,7 @@
<tr>
<td style="color: #3399cc; font-size: 14px; padding-bottom: 3px;">
<img src="cid:calendar" alt="" style="display: inline-block; margin-top: -2px; vertical-align: middle; margin-right: 4px;">
{{ obj.get_dates }}
{{ obj.get_dates_v2 }}
</td>
</tr>
@ -399,7 +399,7 @@
<tr>
<td style="color: #3399cc; font-size: 13px; line-height: 14px; padding-bottom: 5px;">
<img src="cid:calendar" alt="" style="display: inline-block; vertical-align: middle; margin-top: -2px; margin-right: 4px;">
{{ obj.get_dates }}
{{ obj.get_dates_v2 }}
</td>
</tr>
<tr>

@ -46,7 +46,9 @@ class ExpoMixin(object):
return photos
def get_dates(data_begin, data_end):
def get_dates(data_begin, data_end, v2=False):
_v1 = _(u'c {start} по {end}')
_v2 = _(u'{start}-{end}')
lang = get_language()
if data_end and data_begin:
delta = data_end - data_begin
@ -73,7 +75,9 @@ def get_dates(data_begin, data_end):
end = u'{month} {day}'.format(
month=data_end.strftime('%B'),
day=data_end.day)
return _(u'c {start} по {end}').format(start=start, end=end)
if not v2:
return _v1.format(start=start, end=end)
return _v2.format(start=start, end=end)
if lang == 'ru':
return ru_strftime("%d %B %Y", date=data_begin, inflected=True)
return data_begin
@ -171,6 +175,10 @@ class EventMixin(object):
def get_dates(self):
return get_dates(self.data_begin, self.data_end)
@property
def get_dates_v2(self):
return get_dates(self.data_begin, self.data_end, v2=True)
@property
def get_place_name(self):
tr = get_cached_translation(self.place)

Loading…
Cancel
Save