diff options
-rw-r--r-- | locale/fr/LC_MESSAGES/django.po | 54 | ||||
-rw-r--r-- | main/forms.py | 16 | ||||
-rw-r--r-- | main/views.py | 4 | ||||
-rw-r--r-- | settings.py | 3 |
4 files changed, 56 insertions, 21 deletions
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index bcecb7e..173caba 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-20 00:20+0100\n" +"POT-Creation-Date: 2009-01-21 00:21+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -27,13 +27,30 @@ msgstr "Ajout d'un point remarquable" msgid "Add a new route" msgstr "Ajout d'un nouveau trajet" +#: main/forms.py:36 +msgid "New submission for" +msgstr "" + +#: main/forms.py:39 +#, 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:41 +msgid "To valid, precise or unvalid this item: " +msgstr "Pour valider, préciser ou rejeter cet élément : " + +#: main/forms.py:186 main/models.py:260 +msgid "Area" +msgstr "Zone" + #: main/models.py:35 main/models.py:48 main/models.py:60 main/models.py:72 -#: main/models.py:110 main/models.py:178 main/models.py:246 main/models.py:265 +#: main/models.py:110 main/models.py:178 main/models.py:246 main/models.py:271 msgid "Name" msgstr "Nom" #: main/models.py:36 main/models.py:49 main/models.py:73 main/models.py:116 -#: main/models.py:184 main/models.py:248 main/models.py:267 +#: main/models.py:184 main/models.py:248 main/models.py:273 msgid "Available" msgstr "Disponible" @@ -45,7 +62,7 @@ msgstr "Date" msgid "News" msgstr "Nouvelle" -#: main/models.py:50 main/models.py:76 main/models.py:247 main/models.py:266 +#: main/models.py:50 main/models.py:76 main/models.py:247 main/models.py:272 msgid "Order" msgstr "Ordre" @@ -100,7 +117,7 @@ msgstr "Désactivé" msgid "Status" msgstr "État" -#: main/models.py:129 main/models.py:289 +#: main/models.py:129 main/models.py:295 msgid "Point of interest" msgstr "Point d'intérêt" @@ -112,35 +129,31 @@ msgstr "Coin en haut à gauche" msgid "Lower right corner" msgstr "Coin en bas à droite" -#: main/models.py:260 -msgid "Area" -msgstr "Zone" - -#: main/models.py:268 +#: main/models.py:274 msgid "Text" msgstr "Texte" -#: main/models.py:269 +#: main/models.py:275 msgid "Long text" msgstr "Texte long" -#: main/models.py:270 +#: main/models.py:276 msgid "Password" msgstr "Mot de passe" -#: main/models.py:274 +#: main/models.py:280 msgid "Type" msgstr "Type" -#: main/models.py:279 main/models.py:291 +#: main/models.py:285 main/models.py:297 msgid "Property model" msgstr "Modèle de propriété" -#: main/models.py:292 +#: main/models.py:298 msgid "Value" msgstr "Valeur" -#: main/models.py:296 +#: main/models.py:302 msgid "Property" msgstr "Propriété" @@ -224,7 +237,7 @@ msgstr "Commencer le tracé" msgid "Stop drawing" msgstr "Arrêter le tracé" -#: templates/base.html:27 templates/main_map.html:42 +#: templates/base.html:27 templates/main_map.html:48 msgid "This site uses Chimère" msgstr "Ce site utilise Chimère" @@ -253,6 +266,7 @@ msgid "Propose" msgstr "Proposez" #: templates/main_map.html:14 templates/main_map.html.py:19 +#: templates/main_map.html:29 msgid "Zoom to" msgstr "Zoomer sur" @@ -261,15 +275,15 @@ msgid "Display markers and routes waiting for validation" msgstr "" "Afficher les points remarquables et les trajets en attente de validation" -#: templates/main_map.html:32 +#: templates/main_map.html:38 msgid "Permalink" msgstr "Lien permanent" -#: templates/main_map.html:42 +#: templates/main_map.html:48 msgid "Welcome message" msgstr "Message d'accueil" -#: templates/main_map.html:42 +#: templates/main_map.html:48 msgid "Map" msgstr "Carte" diff --git a/main/forms.py b/main/forms.py index 6c03c7d..d09d648 100644 --- a/main/forms.py +++ b/main/forms.py @@ -23,10 +23,26 @@ Forms from django import forms from django.contrib.gis.db import models from django.utils.translation import ugettext as _ +from django.contrib.auth.models import User +from django.core.mail import send_mail + +from chimere import settings from chimere.main.models import Marker, Route, PropertyModel, Property, Area from chimere.main.widgets import AreaField, PointField +def notifyStaff(geo_object): + category = unicode(geo_object.subcategory) + subject = u'[Chimère] %s %s' % (_(u"New submission for"), category) + user_list = [u.email for u in + User.objects.filter(is_staff=True).exclude(email="").order_by('id')] + message = _(u'The new item "%s" has been submited in the category: ') % \ + geo_object.name + category + message += "\n\n" + _(u"To valid, precise or unvalid this item: ") + message += settings.BASE_URL + 'admin' + message += u"\n\n--\nChimère" + send_mail(subject, message, user_list[0], user_list) + class MarkerAdminForm(forms.ModelForm): """ Main form for marker diff --git a/main/views.py b/main/views.py index bbe9fc2..d88e67a 100644 --- a/main/views.py +++ b/main/views.py @@ -35,7 +35,7 @@ from chimere.main.models import SubCategory, PropertyModel, Marker, Route, \ from chimere.main.widgets import getMapJS, PointChooserWidget, \ RouteChooserWidget, URL_OSM_JS, URL_OSM_CSS -from chimere.main.forms import MarkerForm, RouteForm +from chimere.main.forms import MarkerForm, RouteForm, notifyStaff def index(request): """ @@ -103,6 +103,7 @@ def edit(request): # set the submited status marker.status = 'S' marker.save() + notifyStaff(marker) return HttpResponseRedirect('/chimere/submited/edit') else: # An unbound form @@ -136,6 +137,7 @@ def editRoute(request): # set the submited status route.status = 'S' route.save() + notifyStaff(route) return HttpResponseRedirect('/chimere/submited/edit_route') else: # An unbound form diff --git a/settings.py b/settings.py index 74b7995..d8c6204 100644 --- a/settings.py +++ b/settings.py @@ -2,6 +2,9 @@ ROOT_PATH = '/var/local/django/chimere/' +BASE_URL = "http://www.peacefrogs.net/chimere/" +EMAIL_HOST = 'localhost' + # chimere specific DEFAULT_CENTER = (-1.679444, 48.114722) EPSG_PROJECTION = 900913 |