from organization.core.models import *
from mezzanine.blog.models import BlogPost
from mezzanine.generic.models import ThreadedComment, Keyword
+from mezzanine.conf import settings
class KeywordAdmin(BaseTranslationModelAdmin):
def get_fieldsets(self, request, obj = None):
res = super(BaseTranslationOrderedModelAdmin, self).get_fieldsets(request, obj)
- for field in reversed(self.first_fields):
+ fields = reversed(self.first_fields)
+ if settings.USE_MODELTRANSLATION:
+ lang = settings.LANGUAGE_CODE
+ lang_fields = []
+ for field in fields:
+ lang_fields.append(field + '_' + lang)
+ fields = lang_fields
+ for field in fields:
for trans_field in res[0][1]['fields']:
if field in trans_field:
index = res[0][1]['fields'].index(trans_field)
"generic": "migrations.generic",
}
-MODELTRANSLATION_TRANSLATION_FILES = (
- 'organization.core.translation',
- 'organization.festival.translation',
- 'organization.magazine.translation'
-)
TEMPLATES = [{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
{{ event.start|date:"l j F" }}
<!-- Start date with hour -->
{% if event.start|date:"H:i" != "00:00" %}
- {% trans "from" %}
+ {% trans "at" %}
{{ event.start|date:"H\hi" }}
{% comment %}
{% if event.end|date:"H:i" != "00:00" %}
{% for period in event.periods.all %}
{% trans "From" %} {{ period.date_from|date:"j H:i" }} {% trans "to" %} {{ period.date_to|date:"j F H:i" }}
{% endfor %}
-
+
<!-- Start and end date are completely different -->
{% else %}
{% load i18n mezzanine_tags event_tags %}
<div class="page__meta-date">
- {% include 'agenda/includes/event_date.html' %}
+ <a href="{{ event.get_absolute_url }}">
+ {% include 'agenda/includes/event_date.html' %}
+ </a>
</div>
<div class="page__meta-separator"></div>
--- /dev/null
+{% load organization_tags mezzanine_tags %}
+{% if list %}
+ <div class="white-bg pb2">
+ <hr class="mt0" />
+ <div class="container">
+ <div class="row">
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2" data-summary-content>
+ <h2 class="dotted">{{ list.title }}</h2>
+ {% if list.description %}
+ <p>{{ list.description }}</p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+
+ <div class="container-fluid">
+ <div class="row tac">
+ {% for product_inline in list.products.all %}
+ {% with product_inline.product as product %}
+ <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
+ <div class="article-box article-box--person" >
+ {% if product.images.all %}
+ <div class="article-box__header">
+ <a href="{{ product.get_absolute_url }}" title="{{ product.title }}">
+ <figure class="article-box__image">
+ <img class="lazyload" src="{{ MEDIA_URL }}{% thumbnail product.images.all.0 427 500 top=0.5 %}" alt="product"/>
+ </figure>
+ </a>
+ </div>
+ {% endif %}
+ <div class="article-box__content tal">
+ <a href="{{ product.get_absolute_url }}" title="{{ product.title }}"><h3 class="article-box__title">{{ product.title }}</h3></a>
+ {% if product.description %}
+ <div class="article-box__desc">{{ product.description|richtext_filters|safe|truncatechars_html:255 }}</div>
+ {% elif product.content %}
+ <div class="article-box__desc">{{ product.content|richtext_filters|safe|truncatechars_html:255 }}</div>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ {% endwith %}
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+{% endif %}