From c97636e729611e16d9ae94cd5c4cf80053a35b98 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 19 Nov 2010 20:15:43 +0100 Subject: Rough integration of templates by Pierre Clarenc and Samuel Renard (refs #65) --- chimere/rss/templates/rss.html | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 chimere/rss/templates/rss.html (limited to 'chimere/rss/templates/rss.html') diff --git a/chimere/rss/templates/rss.html b/chimere/rss/templates/rss.html new file mode 100644 index 0000000..bb656e3 --- /dev/null +++ b/chimere/rss/templates/rss.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block sidebar %} +{% endblock %} + +{% block content %} + +
+{% trans "Subscribe to RSS feed" %} +

* {% trans "indicates a mandatory field" %}

+ +

{{ error_message }}

+ +
+{%if not category_rss_feed %} +
+ + +
+{% endif %} + +{%ifequal category_rss_feed "category" %} +
+ + +
+{% endifequal %} + +{%ifequal category_rss_feed "area" %} +
+ + +
+
+

{% trans "Or select a location for this new site :" %}

+ {{form.area}} +
+{% endifequal %} + + +

+
+ +
+ +{% endblock %} -- cgit v1.2.3 From 3dbeb807a29da66717796bde667528aef423c40f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 20 Nov 2010 01:06:27 +0100 Subject: Make the feeds work (refs #65) --- chimere/main/admin.py | 3 + chimere/main/views.py | 1 - chimere/rss/feeds.py | 211 +++++++++++++++++------------------------ chimere/rss/templates/rss.html | 4 +- chimere/rss/urls.py | 2 +- chimere/rss/views.py | 4 +- chimere/urls.py | 2 + 7 files changed, 99 insertions(+), 128 deletions(-) (limited to 'chimere/rss/templates/rss.html') diff --git a/chimere/main/admin.py b/chimere/main/admin.py index 30ea716..ea79f7a 100644 --- a/chimere/main/admin.py +++ b/chimere/main/admin.py @@ -21,6 +21,7 @@ Settings for administration pages """ +from chimere import settings from chimere.main.models import Category, Icon, SubCategory, Marker, \ PropertyModel, News, Route, Area, ColorTheme, Color from chimere.main.forms import MarkerAdminForm, RouteAdminForm, AreaAdminForm,\ @@ -50,6 +51,8 @@ class MarkerAdmin(admin.ModelAdmin): list_display = ('name', 'status') list_filter = ('status', 'categories') exclude = ['height', 'width'] + if 'chimere.rss' in settings.INSTALLED_APPS: + exclude.append('available_date') form = MarkerAdminForm def queryset(self, request): diff --git a/chimere/main/views.py b/chimere/main/views.py index be9b64b..b74a472 100644 --- a/chimere/main/views.py +++ b/chimere/main/views.py @@ -312,7 +312,6 @@ def getGeoObjects(request, area_name, category_ids, status): try: q = checkDate(Q(status__in=status, categories__in=category_ids)) query = Marker.objects.filter(q) - print query.query except: return HttpResponse('no results') category_ids = [int(cat_id) for cat_id in category_ids] diff --git a/chimere/rss/feeds.py b/chimere/rss/feeds.py index 1c4e015..870d00c 100644 --- a/chimere/rss/feeds.py +++ b/chimere/rss/feeds.py @@ -27,87 +27,100 @@ from django.contrib.gis.geos import * from chimere import settings +class BaseFeed(Feed): + """ + Base feed for Chimere objects + """ + def item_link(self, item): + ''' Return POI permalink ''' + coord = item.point + return settings.BASE_URL + '?zoom=16&lat=%d&lon=%d¤t_feature=%d&\ +checked_categories=%d' % (coord.y, coord.x, item.id, + item.categories.all()[0].id) + + def item_pubdate(self, item): + """ + Date of the Marker when it has been available + """ + return item.available_date -class LatestPOIsByCategory(Feed): + def description(self, obj): + return "" + +class LatestPOIsByCategory(BaseFeed): ''' Last Points of interests by category in Feeds ''' title_template = "rss_title.html" description_template = "rss_descr.html" - # Get extra url, after rss/category/ -> bits[0]=id of category + def get_object(self, bits): + """ + Get extra url, after rss/category/ id of category + """ if len(bits) != 1: raise ObjectDoesNotExist return Category.objects.get(id__exact=bits[0]) - # Define the title of the feed, here The name of the category + def title(self, obj): + """ + Define the title of the feed + """ return u"%s - %s" % (settings.PROJECT_NAME, obj.name) - # Define the link of the feed. Feeds agregators update at this link + def link(self, obj): + """ + Define the link of the feed. + """ if not obj: raise FeedDoesNotExist return settings.BASE_URL + 'rss/category/' + str(obj.id) - # Description of the feed + def description(self, obj): + """ + Description of the feed + """ return obj.description - # Link of the item/POI. Here the link is the permalink of the marker/POI - def item_link(self, item): - # Return the permalink of the POI : - # Get thirst the attribute point of the marker - # Then we had to transform this to the good system metric. From srid=4326 to srid=900913 - coord = item.point - #coord.transform(settings.EPSG_PROJECTION) - lnk = settings.BASE_URL + '?zoom=16&lat=' + str(coord.y) + '&lon=' + \ -str(coord.x) + '&layers=BTT&checked_categories=1&display_submited=false' - return lnk - # Date of the Marker when it has been available - def item_pubdate(self,item): - return item.available_date - # Requests to marker where its category match the category is requested AND its status is available - # This returns a list of the 15 last markers/POIs ordering by date + def items(self, obj): - return Marker.objects.filter(status__exact='A', - categories__subcategory__category__id__exact=obj.id).order_by( - '-available_date')[:15] + """ + Requests to marker where its category match the category is requested + and its status is available + This returns a list of the 15 last markers/POIs ordering by date + """ + q = Marker.objects.filter(status__exact='A', + categories__subcategory__category__id__exact=obj.id, + available_date__isnull=False).order_by('-available_date')[:15] + return q -class LatestPOIsBySubCategory(Feed): +class LatestPOIsBySubCategory(BaseFeed): ''' Last Points of interests by SubCategory in Feeds ''' title_template = "rss_title.html" description_template = "rss_descr.html" + def get_object(self, bits): if len(bits) != 1: raise ObjectDoesNotExist return SubCategory.objects.get(id__exact=bits[0]) def title(self, obj): - return obj.category.name + u"%s - %s" % (settings.PROJECT_NAME, - obj.name) + return u"%s - %s - %s" % (settings.PROJECT_NAME, obj.category.name, + obj.name) def link(self, obj): if not obj: raise FeedDoesNotExist return settings.BASE_URL + 'rss/subcategory/' + str(obj.id) - def description(self, obj): - return "" - - def item_link(self, item): - # Renvoyer le permalink du POI : - coord = item.point - #coord.transform(settings.EPSG_PROJECTION) - return settings.BASE_URL + '?zoom=16&lat=' + str(coord.y) + '&lon=' + \ -str(coord.x) + '&layers=BTT&checked_categories=1&display_submited=false' - - def item_pubdate(self,item): - return item.available_date - def items(self, obj): - return Marker.objects.filter(categories_subcategory__id__exact=obj.id, - status__exact='A').order_by('-available_date')[:15] + q = Marker.objects.filter(categories__id__exact=obj.id, + available_date__isnull=False, status__exact='A').order_by( + '-available_date')[:15] + return q -class LatestPOIs(Feed): +class LatestPOIs(BaseFeed): ''' Last Points of interests ''' @@ -123,96 +136,74 @@ class LatestPOIs(Feed): def description(self): return "Latest POIs from Chimere" - def item_link(self, item): - # Renvoyer le permalink du POI : - coord = item.point - #coord.transform(settings.EPSG_PROJECTION) - return settings.BASE_URL + '?zoom=16&lat=' + str(coord.y) + '&lon=' + \ -str(coord.x) + '&layers=BTT&checked_categories=1&display_submited=false' - - def item_pubdate(self,item): - return item.available_date - def items(self): - return Marker.objects.filter(status__exact='A' - ).order_by('-available_date')[:15] - + q = Marker.objects.filter(status__exact='A', + available_date__isnull=False).order_by('-available_date')[:15] + return q -class LatestPOIsByZone(Feed): +class LatestPOIsByZone(BaseFeed): ''' Last Points of interests by zone by coordinates ''' title_template = "rss_title.html" description_template = "rss_descr.html" - # Attributes which store coordinates of the requested zone upper_left_lat = 0 upper_left_lon = 0 lower_right_lat = 0 lower_right_lon = 0 def get_object(self, bits): + """ + Get the extra url. Parameters are the coordinates of the zone (the + upper left and lower right points) + """ if len(bits) != 1: raise ObjectDoesNotExist - # Get the extra url. Parameters are the coordinates of the zone (the - # upper left and lower right points) # Then define the upper right and lower left points - coordinates = str(bits[0]).split(',') + coordinates = str(bits[0]).split('_') upper_left_lat = float(coordinates[0]) upper_left_lon = float(coordinates[1]) lower_right_lat = float(coordinates[2]) lower_right_lon = float(coordinates[3]) - """ upper_right_lat = upper_left_lat upper_right_lon = lower_right_lon lower_left_lat = lower_right_lat - lower_left_lon = upper_left_lon""" + lower_left_lon = upper_left_lon # Define a Polygon with the 4 points of the zone. - # Cordinates are define with a srid=900913, use by google, yahoo but no OpenStreeMap areaBox = Polygon(((upper_left_lon, upper_left_lat), (upper_right_lon, upper_right_lat), (lower_right_lon, lower_right_lat), (lower_left_lon, lower_left_lat), (upper_left_lon, upper_left_lat)), - srid=settings.EPSG_PROJECTION) - # OSM uses the standard srid=4326, wich uses the real pairs latitude/longitude in degrees. - #areaBox.transform(settings.EPSG_DISPLAY_PROJECTION) - + srid=settings.EPSG_DISPLAY_PROJECTION) return areaBox def title(self, obj): return u"%s - Last POIs by area" % settings.PROJECT_NAME - # Define the link of the feed. It's the same url as we get in the method get_object + def link(self, obj): + """ + Define the link of the feed. It's the same url as we get in the method + get_object + """ if not obj: raise FeedDoesNotExist return settings.BASE_URL + 'rss/area/' \ - + str(self.upper_left_lat) + ',' + str(self.upper_left_lon) + \ - ',' + str(self.lower_right_lat) + ',' + str(self.lower_right_lon) - - def description(self, obj): - return "" - - # Link of the item/POI. Here the link is the permalink of the marker/POI - def item_link(self, item): - # Return the permalink of the POI : - # Get thirst the attribute point of the marker - # Then we had to transform this to the good system metric. From srid=4326 to srid=900913 - coord = item.point - #coord.transform(settings.EPSG_PROJECTION) - return settings.BASE_URL + '?zoom=16&lat=' + str(coord.y) + '&lon=' + \ -str(coord.x) + '&layers=BTT&checked_categories=1&display_submited=false' - - # Return the date of the Marker - def item_pubdate(self,item): - return item.available_date + + str(self.upper_left_lat) + '_' + str(self.upper_left_lon) + \ + '_' + str(self.lower_right_lat) + '_' + str(self.lower_right_lon) - # Request to return Markers WHERE there points are containes in the zone which is requested. - # This returns a list of the 15 last markers/POIs ordering by date def items(self, obj): - return Marker.objects.filter(point__contained=obj, status__exact='A' - ).order_by('-available_date')[:15] + """ + Request to return Markers WHERE there points are containes in the zone + which is requested. + This returns a list of the 15 last markers/POIs ordering by date + """ + print obj + q = Marker.objects.filter(point__contained=obj, status__exact='A', + available_date__isnull=False).order_by('-available_date')[:15] + return q -class LatestPOIsByZoneID(Feed): +class LatestPOIsByZoneID(BaseFeed): ''' Last Points of interests by zone by id ''' @@ -232,34 +223,10 @@ class LatestPOIsByZoneID(Feed): raise FeedDoesNotExist return settings.BASE_URL + 'rss/areaid/' + str(obj.id) - def description(self, obj): - return "" - - def item_link(self, item): - coord = item.point - coord.transform(settings.EPSG_PROJECTION) - return settings.BASE_URL + '?zoom=16&lat=' + str(coord.y) + '&lon=' + \ -str(coord.x) + '&layers=BTT&checked_categories=1&display_submited=false' - - def item_pubdate(self,item): - return item.available_date - def items(self, obj): - upper_left_lat = float(obj.upper_left_corner.x) - upper_left_lon = float(obj.upper_left_corner.y) - lower_right_lat = float(obj.lower_right_corner.x) - lower_right_lon = float(obj.lower_right_corner.y) - ''' - upper_right_lat = upper_left_lat - upper_right_lon = lower_right_lon - lower_left_lat = lower_right_lat - lower_left_lon = upper_left_lon - ''' - areaBox = Polygon(((upper_left_lon, upper_left_lat), - (upper_right_lon, upper_right_lat), - (lower_right_lon, lower_right_lat), - (lower_left_lon, lower_left_lat), - (upper_left_lon, upper_left_lat)), - srid=settings.EPSG_PROJECTION) - #areaBox.transform(settings.EPSG_DISPLAY_PROJECTION) - return Marker.objects.filter(point__contained=areaBox) + sql = 'select * from "main_marker" where ' + obj.getIncludeSql() + sql += ' and "main_marker".available_date is not null' + sql += ' and "main_marker".status=\'A\'' + sql += ' order by "main_marker".available_date desc limit 15' + q = Marker.objects.raw(sql) + return q diff --git a/chimere/rss/templates/rss.html b/chimere/rss/templates/rss.html index bb656e3..52f118e 100644 --- a/chimere/rss/templates/rss.html +++ b/chimere/rss/templates/rss.html @@ -18,9 +18,9 @@ {% endif %} diff --git a/chimere/rss/urls.py b/chimere/rss/urls.py index 9c841c8..e5e9a24 100644 --- a/chimere/rss/urls.py +++ b/chimere/rss/urls.py @@ -24,7 +24,7 @@ from django.conf.urls.defaults import * from chimere.rss.feeds import LatestPOIsByCategory, LatestPOIsBySubCategory, \ LatestPOIs, LatestPOIsByZone, LatestPOIsByZoneID -from chimere.urls import BASE, EXTRA +from chimere.urls import EXTRA_NO_AREA as EXTRA feeds = { 'category': LatestPOIsByCategory, diff --git a/chimere/rss/views.py b/chimere/rss/views.py index 305d255..b82d3ae 100644 --- a/chimere/rss/views.py +++ b/chimere/rss/views.py @@ -123,8 +123,8 @@ def rss(request, area_name=''): 'lower_right_lat' in request.POST and \ request.POST['lower_right_lat'] != '' : feeds_link = '/' + settings.EXTRA_URL + 'rss/area/' + \ -request.POST['upper_left_lat'] + ',' + request.POST['upper_left_lon'] + ',' + \ -request.POST['lower_right_lat'] + ',' + request.POST['lower_right_lon'] +request.POST['upper_left_lat'] + '_' + request.POST['upper_left_lon'] + '_' + \ +request.POST['lower_right_lat'] + '_' + request.POST['lower_right_lon'] return HttpResponseRedirect(feeds_link) diff --git a/chimere/urls.py b/chimere/urls.py index 7b9b3c7..5788c43 100644 --- a/chimere/urls.py +++ b/chimere/urls.py @@ -57,7 +57,9 @@ for area in url_areas: EXTRA = "|".join([area.urn for area in url_areas]) default_dct = {} +EXTRA_NO_AREA = EXTRA if EXTRA: + EXTRA_NO_AREA = "(%s)?/?" % EXTRA EXTRA = "(?P%s)?/?" % EXTRA else: default_dct = {'area_name':''} -- cgit v1.2.3 From 8b26be646b115af7d62c85289229c15c510f971b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 20 Nov 2010 01:29:28 +0100 Subject: Correct bad link on RSS page - Correct display of RSS page (refs #65) --- chimere/main/actions.py | 5 +-- chimere/rss/templates/rss.html | 4 +-- chimere/rss/views.py | 81 ++++++++++++++---------------------------- 3 files changed, 32 insertions(+), 58 deletions(-) (limited to 'chimere/rss/templates/rss.html') diff --git a/chimere/main/actions.py b/chimere/main/actions.py index 2dba2ac..b6ee06a 100644 --- a/chimere/main/actions.py +++ b/chimere/main/actions.py @@ -34,9 +34,10 @@ actions = [(Action('view', '', _('View')), []), (Action('edit', 'edit', _('Add a new point of interest')), Action('edit_route', 'edit_route', _('Add a new route'))) ),] -if EMAIL_HOST: - actions.append((Action('contact', 'contact', _('Contact us')), []),) if 'chimere.rss' in INSTALLED_APPS: actions.append((Action('rss', 'rss', _('Feeds')), [])) +if EMAIL_HOST: + actions.append((Action('contact', 'contact', _('Contact us')), []),) + diff --git a/chimere/rss/templates/rss.html b/chimere/rss/templates/rss.html index 52f118e..885841d 100644 --- a/chimere/rss/templates/rss.html +++ b/chimere/rss/templates/rss.html @@ -5,7 +5,7 @@ {% endblock %} {% block content %} - +
{% trans "Subscribe to RSS feed" %}

* {% trans "indicates a mandatory field" %}

@@ -61,5 +61,5 @@
- +
{% endblock %} diff --git a/chimere/rss/views.py b/chimere/rss/views.py index b82d3ae..5dd9797 100644 --- a/chimere/rss/views.py +++ b/chimere/rss/views.py @@ -23,27 +23,23 @@ Views of the project """ -import datetime - from django.shortcuts import render_to_response -from django.template import loader -from django.http import HttpResponseRedirect, HttpResponse -from django.core import serializers +from django.http import HttpResponseRedirect from chimere import settings +from chimere.main.views import get_base_response from chimere.main.actions import actions - -from chimere.main.models import Category, SubCategory, PropertyModel, Marker, \ - Route, News, Area, Color - -from chimere.main.widgets import getMapJS, PointChooserWidget, \ - RouteChooserWidget, URL_OSM_JS, URL_OSM_CSS, AreaWidget -from chimere.main.forms import MarkerForm, RouteForm, AreaForm, notifyStaff +from chimere.main.models import SubCategory,Area +from chimere.main.forms import AreaForm +from chimere.main.widgets import AreaWidget def rss(request, area_name=''): ''' Redirect to RSS subscription page ''' + response_dct = get_base_response() + response_dct.update({'actions':actions, 'action_selected':('rss',), + 'category_rss_feed':'',}) # If the form has been submited if request.method == "POST": # User has defined the kind of POI he is interested in : POI in a area @@ -55,39 +51,29 @@ def rss(request, area_name=''): return HttpResponseRedirect(feeds_link) # User wants to follow all the new POI by category or subcategory elif request.POST['rss_category'] == 'poi': - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'extra_url':settings.EXTRA_URL, - 'category_rss_feed':'category', - 'sub_categories':SubCategory.getAvailable(['M', 'B']) - } + response_dct['category_rss_feed'] = 'category' + response_dct['sub_categories'] = SubCategory.getAvailable(['M', + 'B']) return render_to_response('rss.html', response_dct) # User wants to follow all the new POI situated in a defined area elif request.POST['rss_category'] == 'area': # An unbound form form = AreaForm() - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'extra_url':settings.EXTRA_URL, - 'map_layer':settings.MAP_LAYER, - 'extra_head':form.media, - 'form':form, - 'category_rss_feed':'area', - 'area_id':Area.getAvailable(), - 'area_widget':AreaWidget().render('area', None) - } + area_widget = AreaWidget().render('area', None) + response_dct.update({'map_layer':settings.MAP_LAYER, + 'extra_head':form.media, + 'form':form, + 'category_rss_feed':'area', + 'area_id':Area.getAvailable(), + 'area_widget':area_widget + }) return render_to_response('rss.html', response_dct) # Error when submitting the form else: - error = _("Error - Please choose a correct choice in the list") - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'extra_url':settings.EXTRA_URL, - 'error_message':error, - 'category_rss_feed':'category', - 'sub_categories':SubCategory.getAvailable(['M', - 'B']) - } + error = _("Please choose a correct choice in the list") + response_dct.update({'error_message':error, + 'category_rss_feed':'category', + 'sub_categories':SubCategory.getAvailable(['M', 'B'])}) return render_to_response('rss.html', response_dct) # User has specified the category or subcategory he wants to follow => @@ -135,33 +121,20 @@ request.POST['lower_right_lat'] + '_' + request.POST['lower_right_lon'] feeds_link = '/' + settings.EXTRA_URL + 'rss/global/' return HttpResponseRedirect(feeds_link) if request.GET['rss_category'] == 'poi': - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'extra_url':settings.EXTRA_URL, - 'category_rss_feed':'category', - 'sub_categories':SubCategory.getAvailable(['M', 'B']) - } + response_dct['category_rss_feed'] = 'category' + response_dct['sub_categories'] = SubCategory.getAvailable(['M','B']) return render_to_response('rss.html', response_dct) if request.GET['rss_category'] == 'area': # An unbound form form = AreaForm() - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'extra_url':settings.EXTRA_URL, - 'map_layer':settings.MAP_LAYER, + response_dct.update({'map_layer':settings.MAP_LAYER, 'extra_head':form.media, 'form':form, 'category_rss_feed':'area', 'area_id':Area.getAvailable(), - 'area_widget':AreaWidget().render('area', None) - } + 'area_widget':AreaWidget().render('area', None)}) return render_to_response('rss.html', response_dct) # User access to the RSS tab else: - response_dct = {'actions':actions, 'action_selected':'rss', - 'media_path':settings.MEDIA_URL, - 'category_rss_feed':'', - 'extra_url':settings.EXTRA_URL - } return render_to_response('rss.html', response_dct) -- cgit v1.2.3 From 18980694a24e3cc28e6e99e3582613c3cd623f40 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 20 Nov 2010 01:49:44 +0100 Subject: Improve RSS form (refs #65) --- chimere/rss/templates/rss.html | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'chimere/rss/templates/rss.html') diff --git a/chimere/rss/templates/rss.html b/chimere/rss/templates/rss.html index 885841d..c28b3db 100644 --- a/chimere/rss/templates/rss.html +++ b/chimere/rss/templates/rss.html @@ -8,27 +8,26 @@
{% trans "Subscribe to RSS feed" %} -

* {% trans "indicates a mandatory field" %}

{{ error_message }}

-
+ {%if not category_rss_feed %}
- - + + + +
{% endif %} {%ifequal category_rss_feed "category" %}
- - {% for cat_subcat in sub_categories %} + +
+{% endif %}
-

{% trans "Or select a location for this new site :" %}

+ + {{form.area}}
+

{% endifequal %} - -

-- cgit v1.2.3 From 00697996e885044314cc297b72aaa86d69d2a219 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 20 Nov 2010 02:22:28 +0100 Subject: Better labels - french traduction (fixes #65) --- .gitignore | 1 + chimere/locale/fr/LC_MESSAGES/django.po | 145 +++++++++++++++++++++++--------- chimere/main/actions.py | 2 +- chimere/rss/feeds.py | 12 +-- chimere/rss/templates/rss.html | 19 +++-- chimere/rss/views.py | 2 +- 6 files changed, 126 insertions(+), 55 deletions(-) (limited to 'chimere/rss/templates/rss.html') diff --git a/.gitignore b/.gitignore index a02a417..b2d6d32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc *.swp +*.mo chimere/settings.py chimere/static/icons/* chimere/static/upload/* diff --git a/chimere/locale/fr/LC_MESSAGES/django.po b/chimere/locale/fr/LC_MESSAGES/django.po index 1b46b24..8563abf 100644 --- a/chimere/locale/fr/LC_MESSAGES/django.po +++ b/chimere/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-11-19 03:17+0100\n" +"POT-Creation-Date: 2010-11-20 02:16+0100\n" "PO-Revision-Date: 2010-03-20 20:00+0100\n" "Last-Translator: Étienne Loks \n" "MIME-Version: 1.0\n" @@ -30,47 +30,51 @@ msgstr "Ajout d'un point remarquable" msgid "Add a new route" msgstr "Ajout d'un nouveau trajet" -#: main/actions.py:38 +#: main/actions.py:39 +msgid "RSS feeds" +msgstr "Flux RSS" + +#: main/actions.py:42 msgid "Contact us" msgstr "Nous contacter" -#: main/forms.py:56 +#: main/forms.py:72 msgid "New submission for" msgstr "Nouvelle proposition pour" -#: main/forms.py:57 +#: main/forms.py:73 #, python-format msgid "The new item \"%s\" has been submited in the category: " msgstr "Le nouvel élément « %s » a été proposé dans la catégorie : " -#: main/forms.py:59 +#: main/forms.py:75 msgid "To valid, precise or unvalid this item: " msgstr "Pour valider, préciser ou rejeter cet élément : " -#: main/forms.py:68 +#: main/forms.py:84 msgid "Email (optional)" msgstr "Courriel (optionnel) " -#: main/forms.py:69 +#: main/forms.py:85 msgid "Object" msgstr "Objet" -#: main/forms.py:127 +#: main/forms.py:143 msgid "End date has been set with no start date" msgstr "Une date de fin a été donnée sans date de début" -#: main/forms.py:248 main/models.py:446 +#: main/forms.py:268 main/models.py:449 msgid "Area" msgstr "Zone" #: main/models.py:37 main/models.py:90 main/models.py:111 main/models.py:124 -#: main/models.py:138 main/models.py:188 main/models.py:269 main/models.py:430 -#: main/models.py:472 +#: main/models.py:138 main/models.py:188 main/models.py:272 main/models.py:433 +#: main/models.py:475 msgid "Name" msgstr "Nom" #: main/models.py:38 main/models.py:112 main/models.py:139 main/models.py:196 -#: main/models.py:277 main/models.py:434 main/models.py:474 +#: main/models.py:280 main/models.py:437 main/models.py:477 msgid "Available" msgstr "Disponible" @@ -98,8 +102,8 @@ msgstr "Thème de couleur" msgid "Code" msgstr "Code" -#: main/models.py:100 main/models.py:113 main/models.py:144 main/models.py:433 -#: main/models.py:473 +#: main/models.py:100 main/models.py:113 main/models.py:144 main/models.py:436 +#: main/models.py:476 msgid "Order" msgstr "Ordre" @@ -111,16 +115,16 @@ msgstr "Couleur" msgid "Category" msgstr "Catégorie" -#: main/models.py:125 main/models.py:191 main/models.py:272 +#: main/models.py:125 main/models.py:191 main/models.py:275 #: templates/edit.html:35 templates/edit_route.html:35 msgid "Image" msgstr "Image" -#: main/models.py:127 main/models.py:193 main/models.py:274 +#: main/models.py:127 main/models.py:193 main/models.py:277 msgid "Height" msgstr "Hauteur" -#: main/models.py:128 main/models.py:194 main/models.py:275 +#: main/models.py:128 main/models.py:194 main/models.py:278 msgid "Width" msgstr "Largeur" @@ -132,7 +136,7 @@ msgstr "Icône" msgid "Marker" msgstr "Point d'intérêt" -#: main/models.py:146 main/models.py:271 main/models.py:297 +#: main/models.py:146 main/models.py:274 main/models.py:300 #: templates/edit_route.html:29 msgid "Route" msgstr "Trajet" @@ -153,82 +157,86 @@ msgstr "Sous-catégorie" msgid "Localisation" msgstr "Localisation" -#: main/models.py:195 main/models.py:276 +#: main/models.py:195 main/models.py:279 msgid "Submited" msgstr "Soumis" -#: main/models.py:197 main/models.py:278 +#: main/models.py:197 main/models.py:281 msgid "Disabled" msgstr "Désactivé" -#: main/models.py:201 main/models.py:289 +#: main/models.py:201 main/models.py:292 msgid "Status" msgstr "État" -#: main/models.py:203 main/models.py:283 templates/edit.html:41 +#: main/models.py:203 main/models.py:286 templates/edit.html:41 #: templates/edit_route.html:41 msgid "Start date" msgstr "Date de début" -#: main/models.py:204 main/models.py:284 +#: main/models.py:204 main/models.py:287 msgid "Not mandatory. Set it for dated item such as event. Format YYYY-MM-DD" msgstr "" "Optionnel. Précisez ce champ pour les éléments datés comme un événement. " "Format du champ : AAAA-MM-JJ" -#: main/models.py:206 main/models.py:286 templates/edit.html:47 +#: main/models.py:206 main/models.py:289 templates/edit.html:47 #: templates/edit_route.html:47 msgid "End date" msgstr "Date de fin" -#: main/models.py:207 main/models.py:287 +#: main/models.py:207 main/models.py:290 msgid "" "Not mandatory. Set it only if you have a multi-day event. Format YYYY-MM-DD" msgstr "" "Optionnel. Précisez ce champ seulement pour des événements durant plusieurs " "jours. Format du champ : AAAA-MM-JJ" -#: main/models.py:216 main/models.py:496 +#: main/models.py:210 +msgid "Available Date" +msgstr "Date de mise en disponibilité" + +#: main/models.py:219 main/models.py:499 msgid "Point of interest" msgstr "Point d'intérêt" -#: main/models.py:431 +#: main/models.py:434 msgid "Area urn" msgstr "Urn de la zone" -#: main/models.py:435 +#: main/models.py:438 msgid "Upper left corner" msgstr "Coin en haut à gauche" -#: main/models.py:437 +#: main/models.py:440 msgid "Lower right corner" msgstr "Coin en bas à droite" -#: main/models.py:475 +#: main/models.py:478 msgid "Text" msgstr "Texte" -#: main/models.py:476 +#: main/models.py:479 msgid "Long text" msgstr "Texte long" -#: main/models.py:477 +#: main/models.py:480 msgid "Password" msgstr "Mot de passe" -#: main/models.py:481 +#: main/models.py:484 msgid "Type" msgstr "Type" -#: main/models.py:486 main/models.py:498 +#: main/models.py:489 main/models.py:501 msgid "Property model" msgstr "Modèle de propriété" -#: main/models.py:499 +#: main/models.py:502 msgid "Value" msgstr "Valeur" -#: main/models.py:503 +#: main/models.py:506 msgid "Property" msgstr "Propriété" @@ -249,7 +257,7 @@ msgstr "" msgid "Temporary error. Renew your message later." msgstr "Erreur temporaire. Réenvoyez votre message plus tard." -#: main/views.py:338 +#: main/views.py:337 msgid "No category available in this area." msgstr "Pas de catégorie disponible sur cette zone." @@ -337,6 +345,66 @@ msgstr "Arrêter le tracé" msgid "Select..." msgstr "Sélectionner..." +#: rss/feeds.py:132 rss/feeds.py:222 +msgid "Last points of interest" +msgstr "Derniers points d'intérêt" + +#: rss/feeds.py:138 +msgid "Latest points of interest from " +msgstr "Nouveaux points d'intérêt de " + +#: rss/feeds.py:184 +msgid "Last points of interest by area" +msgstr "Nouveaux points d'intérêt par zone" + +#: rss/views.py:73 +msgid "Incorrect choice in the list" +msgstr "Choix incorrect dans la liste" + +#: rss/templates/rss.html:10 +msgid "Subscribe to RSS feed" +msgstr "Souscrire à un flux RSS" + +#: rss/templates/rss.html:17 +msgid "Type of RSS feed" +msgstr "Type de flux RSS" + +#: rss/templates/rss.html:20 +msgid "All new points of interest" +msgstr "Tous les nouveaux points d'intérêt" + +#: rss/templates/rss.html:21 rss/templates/rss.html.py:28 +msgid "New points of interest by category" +msgstr "Les nouveaux points d'intérêt par catégorie" + +#: rss/templates/rss.html:22 rss/templates/rss.html.py:44 +msgid "New points of interest by area" +msgstr "Les nouveaux points d'intérêt par zone" + +#: rss/templates/rss.html:30 +msgid "Choose a category" +msgstr "Choisir une catégorie" + +#: rss/templates/rss.html:47 +msgid "Choose a pre-defined areas" +msgstr "Choisir une zone pré-définie" + +#: rss/templates/rss.html:61 +msgid "Or select the area by zooming and panning this map" +msgstr "Ou sélectionner une zone en zoomant et en se déplaçant sur cette carte" + +#: rss/templates/rss.html:66 +msgid "Validate" +msgstr "Valider" + +#: templates/404.html:4 +msgid "Page not found" +msgstr "Page non trouvée" + +#: templates/500.html:4 +msgid "Internal server error" +msgstr "Erreur interne du serveur" + #: templates/base.html:39 msgid "This site uses Chimère" msgstr "Ce site utilise Chimère" @@ -452,6 +520,3 @@ msgstr "" "fichier welcome.html dans le dossier de patrons de Chimère. En dessous de ce " "message toutes les nouvelles vont être affichées. Vous pouvez les ajouter " "dans les pages d'administration." - -#~ msgid "Description" -#~ msgstr "Description" diff --git a/chimere/main/actions.py b/chimere/main/actions.py index b6ee06a..b383bb4 100644 --- a/chimere/main/actions.py +++ b/chimere/main/actions.py @@ -36,7 +36,7 @@ actions = [(Action('view', '', _('View')), []), ),] if 'chimere.rss' in INSTALLED_APPS: - actions.append((Action('rss', 'rss', _('Feeds')), [])) + actions.append((Action('rss', 'rss', _('RSS feeds')), [])) if EMAIL_HOST: actions.append((Action('contact', 'contact', _('Contact us')), []),) diff --git a/chimere/rss/feeds.py b/chimere/rss/feeds.py index 870d00c..1bb1a76 100644 --- a/chimere/rss/feeds.py +++ b/chimere/rss/feeds.py @@ -19,6 +19,7 @@ # See the file COPYING for details. +from django.utils.translation import ugettext as _ from django.contrib.syndication.feeds import Feed from django.contrib.syndication.feeds import FeedDoesNotExist from chimere.main.models import Category, SubCategory, Marker, Area @@ -128,13 +129,13 @@ class LatestPOIs(BaseFeed): description_template = "rss_descr.html" def title(self): - return u"%s - Last POIs" % settings.PROJECT_NAME + return settings.PROJECT_NAME + u" - " + _(u"Last points of interest") def link(self): return settings.BASE_URL + 'rss/categories/' def description(self): - return "Latest POIs from Chimere" + return _("Latest points of interest from ") + settings.PROJECT_NAME def items(self): q = Marker.objects.filter(status__exact='A', @@ -179,7 +180,8 @@ class LatestPOIsByZone(BaseFeed): return areaBox def title(self, obj): - return u"%s - Last POIs by area" % settings.PROJECT_NAME + return settings.PROJECT_NAME + u" - " +\ + _(u"Last points of interest by area") def link(self, obj): """ @@ -198,7 +200,6 @@ class LatestPOIsByZone(BaseFeed): which is requested. This returns a list of the 15 last markers/POIs ordering by date """ - print obj q = Marker.objects.filter(point__contained=obj, status__exact='A', available_date__isnull=False).order_by('-available_date')[:15] return q @@ -216,7 +217,8 @@ class LatestPOIsByZoneID(BaseFeed): return Area.objects.get(id__exact=bits[0]) def title(self, obj): - return u"%s - Last POIs of %s" % (settings.PROJECT_NAME, obj.name) + return settings.PROJECT_NAME + u" - " + \ + _(u"Last points of interest") + u" - " + obj.name def link(self, obj): if not obj: diff --git a/chimere/rss/templates/rss.html b/chimere/rss/templates/rss.html index c28b3db..0c895ed 100644 --- a/chimere/rss/templates/rss.html +++ b/chimere/rss/templates/rss.html @@ -17,16 +17,17 @@
{% endif %} {%ifequal category_rss_feed "category" %} +

{% trans "New points of interest by category" %}

- + {% for areaID in area_id %} @@ -55,12 +57,13 @@
{% endif %} +
+
- - {{form.area}}
-

+
+

{% endifequal %}
diff --git a/chimere/rss/views.py b/chimere/rss/views.py index 5dd9797..04d69dc 100644 --- a/chimere/rss/views.py +++ b/chimere/rss/views.py @@ -70,7 +70,7 @@ def rss(request, area_name=''): return render_to_response('rss.html', response_dct) # Error when submitting the form else: - error = _("Please choose a correct choice in the list") + error = _("Incorrect choice in the list") response_dct.update({'error_message':error, 'category_rss_feed':'category', 'sub_categories':SubCategory.getAvailable(['M', 'B'])}) -- cgit v1.2.3