diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-09-20 19:28:15 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-09-20 19:28:15 +0200 |
commit | 087919acf3e4945313034715f045c686ae3c543b (patch) | |
tree | bd0534ceb43c0e606e81906f988b26eb61a24243 | |
parent | 2340a338584c53d2cc07590c0a3ebc541306bdb5 (diff) | |
download | Chimère-087919acf3e4945313034715f045c686ae3c543b.tar.bz2 Chimère-087919acf3e4945313034715f045c686ae3c543b.zip |
Fix feeds templates. Add more informations on feeds.
-rw-r--r-- | chimere/feeds.py | 22 | ||||
-rw-r--r-- | chimere/templates/chimere/feeds/rss_descr.html | 11 |
2 files changed, 18 insertions, 15 deletions
diff --git a/chimere/feeds.py b/chimere/feeds.py index 057fe5e..c4ee7a5 100644 --- a/chimere/feeds.py +++ b/chimere/feeds.py @@ -40,7 +40,7 @@ class BaseFeed(Feed): cat = 0 if item.categories.all() and item.categories.all()[0]: cat = item.categories.all()[0].pk - return reverse('chimere:index') + '?zoom=16&lat=%d&lon=%d&'\ + return reverse('chimere:index') + '?zoom=16&lat=%f&lon=%f&'\ 'current_feature=%d&checked_categories=%d' % (coord.y, coord.x, item.id, cat) @@ -57,8 +57,8 @@ class LatestPOIsByCategory(BaseFeed): ''' Last Points of interests by category in Feeds ''' - title_template = "rss_title.html" - description_template = "rss_descr.html" + title_template = "chimere/feeds/rss_title.html" + description_template = "chimere/feeds/rss_descr.html" def get_object(self, request, category_id, area_name=''): return get_object_or_404(Category, id=category_id) @@ -92,8 +92,8 @@ class LatestPOIsBySubCategory(BaseFeed): ''' Last Points of interests by SubCategory in Feeds ''' - title_template = "rss_title.html" - description_template = "rss_descr.html" + title_template = "chimere/feeds/rss_title.html" + description_template = "chimere/feeds/rss_descr.html" def get_object(self, request, category_id, area_name=''): return get_object_or_404(SubCategory, id=category_id) @@ -117,8 +117,8 @@ class LatestPOIs(BaseFeed): ''' Last Points of interests ''' - title_template = "rss_title.html" - description_template = "rss_descr.html" + title_template = "chimere/feeds/rss_title.html" + description_template = "chimere/feeds/rss_descr.html" def title(self): return settings.PROJECT_NAME + u" - " + _(u"Last points of interest") @@ -138,8 +138,8 @@ class LatestPOIsByZone(BaseFeed): ''' Last Points of interests by zone by coordinates ''' - title_template = "rss_title.html" - description_template = "rss_descr.html" + title_template = "chimere/feeds/rss_title.html" + description_template = "chimere/feeds/rss_descr.html" upper_left_lat = 0 upper_left_lon = 0 lower_right_lat = 0 @@ -200,8 +200,8 @@ class LatestPOIsByZoneID(BaseFeed): ''' Last Points of interests by zone by id ''' - title_template = "rss_title.html" - description_template = "rss_descr.html" + title_template = "chimere/feeds/rss_title.html" + description_template = "chimere/feeds/rss_descr.html" def get_object(self, request, area_id, area_name=''): return get_object_or_404(Area, id=area_id) diff --git a/chimere/templates/chimere/feeds/rss_descr.html b/chimere/templates/chimere/feeds/rss_descr.html index 4f75ac6..48f72df 100644 --- a/chimere/templates/chimere/feeds/rss_descr.html +++ b/chimere/templates/chimere/feeds/rss_descr.html @@ -1,8 +1,11 @@ {% load i18n %} {% load sanitize %} <div id='detail_content'> -{% if obj.picture %}<img src='{{obj.picture.url}}' alt="{{obj.name}}"/>{%endif%} -<div>{% for property in obj.getProperties %} -<p id='{{property.propertymodel.getNamedId}}'>{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4"|safe }}</p> -{% endfor %}</div> +{% for picture in obj.pictures.all %}<a href='{{picture.picture.url}}'><img src='{{picture.thumbnailfile.url}}' alt="{{picture.name}}"/></a>{% endfor %} +<ul> +{% if obj.description %}<li class='description'><strong>{% trans "Description:" %}</strong> {{ obj.description|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4"|safe }}</li>{% endif %} +{% for property in obj.getProperties %} +{% if property.value %}<li id='{{property.propertymodel.getNamedId}}'><strong>{{property.propertymodel.name}}{% trans ":"%}</strong> {{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4"|safe }}</li>{% endif %} +{% endfor %} +</ul> </div> |