from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext as _, string_concat
from migdal import api
from migdal.models import Category
from migdal.settings import TYPES_DICT
def item_description(self, item):
return item.lead
+ image = item.image.url if item.image else "/static/img/square-logo.png"
+ return string_concat("<img src='%s'/>" % image, item.lead)
+
+ def item_pubdate(self, item):
+ return item.date
{% load common_tags migdal_tags share %}
-{% block "titleextra" %}{{ entry.title }} ::{% endblock %}
+{% block "titleextra" %}{{ entry.title }} :: {% endblock %}
{% block "ogtitle" %}{{ entry.title }}{% endblock %}
{% block "ogtype" %}article{% endblock %}
{% block "ogdescription"%}{{ entry.lead|striptags|truncatewords:10 }}{% endblock %}
-{% load i18n %}
+{% load i18n thumbnail %}
<li class="promobox-item{% if counter == 1 %} active{% endif %}"
style="
{% if counter != 1 %}display: none;{% endif %}
{% if object.image %}
- background: url('{{ object.image.url }}');
+ background: url('{% thumbnail object.image "700x1000" as thumb %}{{ thumb.url }}{% empty %}{{ object.image.url }}{% endthumbnail %}');
background-size:100%;
background-position: 50% 50%;
{% else %}
def textile_restricted_pl(text):
return TextilePL(restricted=True, lite=True,
- noimage=True, auto_link=True).textile(
+ noimage=True, auto_link=False).textile(
text, rel='nofollow')
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
-USE_TZ = False
+USE_TZ = True
FORMAT_MODULE_PATH = "prawokultury.formats"
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'pagination.middleware.PaginationMiddleware',
+ 'realip_middleware.SetRemoteAddrFromXRealIP',
)
--- /dev/null
+class SetRemoteAddrFromXRealIP(object):
+ """Sets REMOTE_ADDR from the X-Real-IP header, as set by Nginx."""
+ def process_request(self, request):
+ try:
+ request.META['REMOTE_ADDR'] = request.META['HTTP_X_REAL_IP']
+ except KeyError:
+ return None