summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2008-12-16 21:55:14 +0000
committeretienne2008-12-16 21:55:14 +0000
commit7e1a52328266738aaf7887169209bf77a3cf5ba2 (patch)
treefb0e932d0bfe76c2ccca33e0048b23af2f4a22d7
parentd70651257eb7651fe05efe7f623984cfdd7ad16c (diff)
Improvement of syndication
-rw-r--r--locale/fr/LC_MESSAGES/django.po28
-rw-r--r--polls/feeds.py3
-rw-r--r--polls/models.py5
-rw-r--r--settings.py2
-rw-r--r--templates/feeds/poll_description.html8
5 files changed, 36 insertions, 10 deletions
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po
index b38d607..274fe13 100644
--- a/locale/fr/LC_MESSAGES/django.po
+++ b/locale/fr/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-12-09 11:01+0100\n"
+"POT-Creation-Date: 2008-12-16 22:53+0100\n"
"PO-Revision-Date: 2008-08-20 00:22+0200\n"
"Last-Translator: Étienne Loks <etienne.loks@peacefrogs.net>,\n"
"Language-Team: fr\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: polls/feeds.py:40
+#: polls/feeds.py:37
msgid "Papillon - poll : "
msgstr "Papillon - sondage : "
@@ -32,20 +32,20 @@ msgstr "Sondage pondéré"
msgid "One choice poll"
msgstr "Sondage à choix unique"
-#: polls/models.py:108
+#: polls/models.py:113
#, python-format
msgid "Vote from %(user)s"
msgstr "Vote de %(user)s"
-#: polls/models.py:162
+#: polls/models.py:167
msgid "Yes"
msgstr "Oui"
-#: polls/models.py:163 polls/models.py:164
+#: polls/models.py:168 polls/models.py:169
msgid "No"
msgstr "Non"
-#: polls/models.py:163
+#: polls/models.py:168
msgid "Maybe"
msgstr "Peut-être"
@@ -331,6 +331,22 @@ msgstr "Envoyer"
msgid "DATETIME_FORMAT"
msgstr ""
+#: templates/feeds/poll_description.html:2
+#, python-format
+msgid "%(voter_name)s has added/modified a vote."
+msgstr "%(voter_name)s a ajouté ou modifié un vote."
+
+#: templates/feeds/poll_description.html:3
+msgid "Current results:"
+msgstr "Résultats actuels :"
+
+#: templates/feeds/poll_description.html:6
+#, python-format
+msgid ": %(sum)s vote"
+msgid_plural ": %(sum)s votes"
+msgstr[0] " : %(sum)s vote"
+msgstr[1] " : %(sum)s votes"
+
#~ msgid "French"
#~ msgstr "Français"
diff --git a/polls/feeds.py b/polls/feeds.py
index c2c79be..2d52dc7 100644
--- a/polls/feeds.py
+++ b/polls/feeds.py
@@ -26,9 +26,6 @@ from django.utils.translation import gettext_lazy as _
from papillon.settings import BASE_SITE
from papillon.polls.models import Poll, Vote, Voter
-class VoterFeedObject:
- def __init__(self, voter):
- self.voter = voter
class PollLatestEntries(Feed):
def get_object(self, poll_url):
diff --git a/polls/models.py b/polls/models.py
index 4a7f584..531c1e3 100644
--- a/polls/models.py
+++ b/polls/models.py
@@ -81,6 +81,11 @@ class Poll(models.Model):
comment.delete()
self.delete()
+ def getChoices(self):
+ """
+ Get choices associated to this vote"""
+ return Choice.objects.filter(poll=self)
+
class Admin:
pass
class Meta:
diff --git a/settings.py b/settings.py
index c179ec7..0118dc3 100644
--- a/settings.py
+++ b/settings.py
@@ -34,7 +34,7 @@ TIME_ZONE = 'Europe/Paris'
# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
-LANGUAGE_CODE = 'en-en'
+LANGUAGE_CODE = 'fr-fr'
SITE_ID = 1
diff --git a/templates/feeds/poll_description.html b/templates/feeds/poll_description.html
new file mode 100644
index 0000000..7522a5a
--- /dev/null
+++ b/templates/feeds/poll_description.html
@@ -0,0 +1,8 @@
+{% load i18n %}
+<p>{% blocktrans with obj.user.name as voter_name %}{{ voter_name }} has added/modified a vote.{%endblocktrans%}</p>
+<p>{% trans "Current results:" %}</p>
+<ul>
+{% for choice in obj.poll.getChoices %}
+ <li><strong>{{choice.name}}</strong>{% blocktrans count choice.getSum as sum %}: {{sum}} vote{%plural%}: {{sum}} votes{%endblocktrans%}</li>
+{% endfor %}
+</ul> \ No newline at end of file