summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/locale/fr/LC_MESSAGES/django.po28
-rw-r--r--chimere/main/models.py2
-rw-r--r--chimere/main/views.py5
-rw-r--r--chimere/templates/upload_file.html3
4 files changed, 25 insertions, 13 deletions
diff --git a/chimere/locale/fr/LC_MESSAGES/django.po b/chimere/locale/fr/LC_MESSAGES/django.po
index 6ea015d..ec34c01 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: 2011-09-14 20:43+0200\n"
+"POT-Creation-Date: 2011-09-16 11:59+0200\n"
"PO-Revision-Date: 2010-03-20 20:00+0100\n"
"Last-Translator: Étienne Loks <etienne.loks@peacefrogs.net>\n"
"MIME-Version: 1.0\n"
@@ -268,11 +268,15 @@ msgstr "Valeur"
msgid "Property"
msgstr "Propriété"
-#: main/views.py:290
+#: main/views.py:180
+msgid "Bad file. Please check it with an external software."
+msgstr "Fichier incohérent. Merci de le vérifier avec un logiciel externe."
+
+#: main/views.py:295
msgid "Comments/request on the map"
msgstr "Commentaires/requètes sur la carte"
-#: main/views.py:293
+#: main/views.py:298
msgid ""
"Thank you for your contribution. It will be taken into account. If you have "
"left your email you may be contacted soon for more details."
@@ -281,11 +285,11 @@ msgstr ""
"laissé votre courriel vous serez peut-être contacté bientôt pour plus de "
"détails."
-#: main/views.py:297
+#: main/views.py:302
msgid "Temporary error. Renew your message later."
msgstr "Erreur temporaire. Réenvoyez votre message plus tard."
-#: main/views.py:409
+#: main/views.py:414
msgid "No category available in this area."
msgstr "Pas de catégorie disponible sur cette zone."
@@ -462,7 +466,7 @@ msgid "Display markers and routes waiting for validation"
msgstr ""
"Afficher les points remarquables et les trajets en attente de validation"
-#: templates/category_detail.html:6 templates/welcome.html:47
+#: templates/category_detail.html:6 templates/welcome.html:23
msgid "Close"
msgstr "Fermer"
@@ -545,15 +549,15 @@ msgstr ""
"Votre proposition a été soumise. Un modérateur va traiter votre proposition "
"sous peu. Merci !"
-#: templates/upload_file.html:20
-msgid "Upload a file"
-msgstr "Déposer un fichier"
-
-#: templates/upload_file.html:42
+#: templates/upload_file.html:21
msgid "Thank you for your submission!"
msgstr "Merci pour votre proposition !"
-#: templates/upload_file.html:47
+#: templates/upload_file.html:25
+msgid "Upload a file"
+msgstr "Déposer un fichier"
+
+#: templates/upload_file.html:50
msgid "Upload"
msgstr "Déposer"
diff --git a/chimere/main/models.py b/chimere/main/models.py
index 5ab45f6..6afb873 100644
--- a/chimere/main/models.py
+++ b/chimere/main/models.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2008-2010 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2008-2011 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
diff --git a/chimere/main/views.py b/chimere/main/views.py
index 80097d1..25ad630 100644
--- a/chimere/main/views.py
+++ b/chimere/main/views.py
@@ -176,6 +176,11 @@ def uploadFile(request, category_id='', area_name=''):
response_dct['gpx_id'] = routefile.pk
return render_to_response('upload_file.html', response_dct)
routefile.process()
+ if not routefile.route:
+ response_dct['errors'] = _(u"Bad file. Please check it with an "
+ u"external software.")
+ response_dct.update({'form':form})
+ return render_to_response('upload_file.html', response_dct)
route = Route(name=form.cleaned_data['name'], route=routefile.route,
associated_file=routefile, status='S')
route.save()
diff --git a/chimere/templates/upload_file.html b/chimere/templates/upload_file.html
index 50c1150..06c89ad 100644
--- a/chimere/templates/upload_file.html
+++ b/chimere/templates/upload_file.html
@@ -23,6 +23,9 @@
{% endif %}
<fieldset class='edit'>
<legend>{% trans "Upload a file" %}</legend>
+{% if errors %}
+<ul class="errorlist"><li>{{errors}}</li></ul>
+{% endif %}
{% if category %}<h3>{{category}}</h3>{% endif %}
<div class="fieldWrapper">
{% if gpx_id %}