fnp
/
prawokultury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4e8ded7
)
some fixes
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 1 Oct 2012 14:40:22 +0000
(16:40 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 1 Oct 2012 15:03:03 +0000
(17:03 +0200)
migdal/feeds.py
patch
|
blob
|
history
migdal/templates/migdal/entry/entry_detail.html
patch
|
blob
|
history
migdal/templates/migdal/entry/entry_promobox.html
patch
|
blob
|
history
prawokultury/helpers.py
patch
|
blob
|
history
prawokultury/settings.d/30-locale.conf
patch
|
blob
|
history
prawokultury/settings.d/40-middleware.conf
patch
|
blob
|
history
realip_middleware.py
[new file with mode: 0755]
patch
|
blob
diff --git
a/migdal/feeds.py
b/migdal/feeds.py
index
9e01f19
..
8203735
100644
(file)
--- a/
migdal/feeds.py
+++ b/
migdal/feeds.py
@@
-5,7
+5,7
@@
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
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
from migdal import api
from migdal.models import Category
from migdal.settings import TYPES_DICT
@@
-49,3
+49,8
@@
class EntriesFeed(Feed):
def item_description(self, item):
return item.lead
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
diff --git
a/migdal/templates/migdal/entry/entry_detail.html
b/migdal/templates/migdal/entry/entry_detail.html
index
ef842b8
..
5827d08
100755
(executable)
--- a/
migdal/templates/migdal/entry/entry_detail.html
+++ b/
migdal/templates/migdal/entry/entry_detail.html
@@
-3,7
+3,7
@@
{% load common_tags migdal_tags share %}
{% 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 %}
{% block "ogtitle" %}{{ entry.title }}{% endblock %}
{% block "ogtype" %}article{% endblock %}
{% block "ogdescription"%}{{ entry.lead|striptags|truncatewords:10 }}{% endblock %}
diff --git
a/migdal/templates/migdal/entry/entry_promobox.html
b/migdal/templates/migdal/entry/entry_promobox.html
index
b1b0449
..
f68b487
100755
(executable)
--- a/
migdal/templates/migdal/entry/entry_promobox.html
+++ b/
migdal/templates/migdal/entry/entry_promobox.html
@@
-1,11
+1,11
@@
-{% load i18n %}
+{% load i18n
thumbnail
%}
<li class="promobox-item{% if counter == 1 %} active{% endif %}"
style="
{% if counter != 1 %}display: none;{% endif %}
{% if object.image %}
<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 %}
background-size:100%;
background-position: 50% 50%;
{% else %}
diff --git
a/prawokultury/helpers.py
b/prawokultury/helpers.py
index
bc11990
..
5877e0b
100644
(file)
--- a/
prawokultury/helpers.py
+++ b/
prawokultury/helpers.py
@@
-19,7
+19,7
@@
def textile_pl(text):
def textile_restricted_pl(text):
return TextilePL(restricted=True, lite=True,
def textile_restricted_pl(text):
return TextilePL(restricted=True, lite=True,
- noimage=True, auto_link=
Tru
e).textile(
+ noimage=True, auto_link=
Fals
e).textile(
text, rel='nofollow')
text, rel='nofollow')
diff --git
a/prawokultury/settings.d/30-locale.conf
b/prawokultury/settings.d/30-locale.conf
index
f716b1f
..
cafb273
100755
(executable)
--- a/
prawokultury/settings.d/30-locale.conf
+++ b/
prawokultury/settings.d/30-locale.conf
@@
-31,6
+31,6
@@
USE_I18N = True
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
-USE_TZ =
Fals
e
+USE_TZ =
Tru
e
FORMAT_MODULE_PATH = "prawokultury.formats"
FORMAT_MODULE_PATH = "prawokultury.formats"
diff --git
a/prawokultury/settings.d/40-middleware.conf
b/prawokultury/settings.d/40-middleware.conf
index
55ff33a
..
eedc50e
100755
(executable)
--- a/
prawokultury/settings.d/40-middleware.conf
+++ b/
prawokultury/settings.d/40-middleware.conf
@@
-11,4
+11,5
@@
MIDDLEWARE_CLASSES = (
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'pagination.middleware.PaginationMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'pagination.middleware.PaginationMiddleware',
+ 'realip_middleware.SetRemoteAddrFromXRealIP',
)
)
diff --git a/realip_middleware.py
b/realip_middleware.py
new file mode 100755
(executable)
index 0000000..
9f97b7f
--- /dev/null
+++ b/
realip_middleware.py
@@ -0,0
+1,7
@@
+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