Commit 7a81d378 authored by Christophe Siraut's avatar Christophe Siraut

Modularize.

parent d3a69b31
...@@ -7,3 +7,5 @@ local_settings.py ...@@ -7,3 +7,5 @@ local_settings.py
local_urls.py local_urls.py
.coverage .coverage
htmlcov htmlcov
nuages.egg-info
...@@ -5,9 +5,6 @@ clean: ...@@ -5,9 +5,6 @@ clean:
find . -name "*~" -exec rm {} \; find . -name "*~" -exec rm {} \;
find . -name ".svn" -exec rm -r {} \; find . -name ".svn" -exec rm -r {} \;
apps:
apps="meetingpoll registration_templates nuages_base"
update: update:
git pull --rebase git pull --rebase
python manage.py syncdb --noinput python manage.py syncdb --noinput
...@@ -33,3 +30,6 @@ test: ...@@ -33,3 +30,6 @@ test:
python-coverage run --source='.' manage.py test python-coverage run --source='.' manage.py test
python-coverage report python-coverage report
build:
python setup.py --command-packages=stdeb.command debianize
git-buildpackage -us -uc --git-upstream-tree=branch --git-upstream-branch=master
from meetingpoll.models import Poll, Choice, Bulletin, Vote
from django.contrib import admin from django.contrib import admin
from .models import UserProfile, Poll, Choice, Bulletin, Vote
admin.site.register(UserProfile)
admin.site.register(Poll) admin.site.register(Poll)
admin.site.register(Choice) admin.site.register(Choice)
admin.site.register(Bulletin) admin.site.register(Bulletin)
......
from django import forms from django import forms
from models import Poll, Choice, Bulletin, Vote from .models import UserProfile, Poll, Choice, Bulletin, Vote
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from datetimewidget.widgets import DateTimeWidget
from datetime import datetime
dateTimeOptions = {
'weekStart': '1',
'startView': '3',
'minView': '1',
'startDate': datetime.today().date(),
'autoclose': 'true',
'todayHighlight': 'true'
}
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ('email_notifications',)
class DateTimeWidgetFixed(DateTimeWidget):
def __init__(self, **kwargs):
super(DateTimeWidgetFixed, self).__init__(**kwargs)
def value_from_datadict(self, data, files, name):
return str(super(
DateTimeWidgetFixed, self).value_from_datadict(data, files, name))
class PollForm(forms.ModelForm): class PollForm(forms.ModelForm):
title = forms.CharField(label=_('title')) title = forms.CharField(label=_('Title'))
description = forms.CharField(widget=forms.Textarea, label=_('description')) description = forms.CharField(
widget=forms.Textarea,
label=_('Description'))
class Meta: class Meta:
model = Poll model = Poll
fields = ('title','description') fields = ('title', 'description')
class ChoiceForm(forms.ModelForm): class ChoiceForm(forms.ModelForm):
choice = forms.DateTimeField( choice = forms.DateTimeField(
widget=forms.DateTimeInput(format='%d-%m-%Y %H:%M', widget=DateTimeWidgetFixed(
attrs={'class':'hasdatepicker','size':'18',}), options=dateTimeOptions)
input_formats=['%d-%m-%Y %H:%M'] )
)
details = forms.CharField(
required=False,
max_length='200',
widget=forms.TextInput(attrs={'size':'32',})
)
class Meta: class Meta:
model = Choice model = Choice
exclude = ('poll','votecount') #widgets = {
# 'choice': DateTimeWidget(
# attrs={'id': '666'},
# options=dateTimeOptions)}
exclude = ('poll', 'votecount')
class BulletinForm(forms.ModelForm): class BulletinForm(forms.ModelForm):
class Meta: class Meta:
......
...@@ -6,7 +6,7 @@ msgid "" ...@@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-23 14:18+0200\n" "POT-Creation-Date: 2013-07-15 12:00+0200\n"
"PO-Revision-Date: 2013-05-14 09:32+0200\n" "PO-Revision-Date: 2013-05-14 09:32+0200\n"
"Last-Translator: Joan <aseques@gmail.com>\n" "Last-Translator: Joan <aseques@gmail.com>\n"
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n" "Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
...@@ -17,15 +17,15 @@ msgstr "" ...@@ -17,15 +17,15 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 1.4\n" "X-Generator: Lokalize 1.4\n"
#: forms.py:6 #: forms.py:27
msgid "title" msgid "title"
msgstr "titol" msgstr "titol"
#: forms.py:7 #: forms.py:30
msgid "description" msgid "description"
msgstr "descripció" msgstr "descripció"
#: models.py:23 #: models.py:24
msgid "Title" msgid "Title"
msgstr "Titol" msgstr "Titol"
...@@ -37,49 +37,49 @@ msgstr "" ...@@ -37,49 +37,49 @@ msgstr ""
"No heu entrat per tant no podreu modificar la enquesta un cop creada ni " "No heu entrat per tant no podreu modificar la enquesta un cop creada ni "
"rebre notificacions." "rebre notificacions."
#: views.py:81 #: views.py:59
msgid "There are some errors in the form you posted." msgid "There are some errors in the form you posted."
msgstr "Hi ha errors el formulari que heu enviat." msgstr "Hi ha errors el formulari que heu enviat."
#: views.py:176 #: views.py:146
msgid "Your vote has been counted, thank you." msgid "Your vote has been counted, thank you."
msgstr "El vostre vot s'ha comptat, gràcies." msgstr "El vostre vot s'ha comptat, gràcies."
#: views.py:178 #: views.py:148
msgid "Your vote has been updated, thank you." msgid "Your vote has been updated, thank you."
msgstr "El vostre vot s'ha actualitzat, gràcies." msgstr "El vostre vot s'ha actualitzat, gràcies."
#: views.py:186 views.py:188 #: views.py:156 views.py:158
msgid "Did you forget to provide your name?" msgid "Did you forget to provide your name?"
msgstr "Heu oblidat de donar un nom?" msgstr "Heu oblidat de donar un nom?"
#: views.py:189 #: views.py:159
msgid "your name" msgid "your name"
msgstr "El vostre nom" msgstr "El vostre nom"
#: views.py:204 #: views.py:174
msgid "You have voted." msgid "You have voted."
msgstr "Heu votat" msgstr "Heu votat"
#: views.py:221 #: views.py:191
msgid "Login let you modify your vote anytime." msgid "Login let you modify your vote anytime."
msgstr "Entrar us permet modificar el vot sempre." msgstr "Entrar us permet modificar el vot sempre."
#: views.py:227 #: views.py:197
#, python-format #, python-format
msgid "%s has voted and can still modify its vote." msgid "%s has voted and can still modify its vote."
msgstr "" msgstr ""
#: views.py:228 views.py:242 #: views.py:198 views.py:212
#, python-format #, python-format
msgid "Not %s? Click Forget me." msgid "Not %s? Click Forget me."
msgstr "" msgstr ""
#: templates/meetingpoll/choice_form.html:107 #: templates/meetingpoll/choice_form.html:12
msgid "Step 2 : Manage choices" msgid "Step 2 : Manage choices"
msgstr "Pas 2 : Gestionar les opcions" msgstr "Pas 2 : Gestionar les opcions"
#: templates/meetingpoll/choice_form.html:108 #: templates/meetingpoll/choice_form.html:13
msgid "" msgid ""
"Provide possible dates for your meeting. You may adjust the time and add " "Provide possible dates for your meeting. You may adjust the time and add "
"other details in the text field." "other details in the text field."
...@@ -87,76 +87,85 @@ msgstr "" ...@@ -87,76 +87,85 @@ msgstr ""
"Proposeu dates possibles per la trobada. Podeu ajustar la hora i afegir " "Proposeu dates possibles per la trobada. Podeu ajustar la hora i afegir "
"d'altres detalls en el camp de text." "d'altres detalls en el camp de text."
#: templates/meetingpoll/choice_form.html:120 #: templates/meetingpoll/choice_form.html:19
msgid "Dates" msgid "Dates"
msgstr "Dates" msgstr "Dates"
#: templates/meetingpoll/choice_form.html:121 #: templates/meetingpoll/choice_form.html:20
#: templates/meetingpoll/poll_detail.html:92 #: templates/meetingpoll/poll_detail.html:90
msgid "Details" msgid "Details"
msgstr "Detalls" msgstr "Detalls"
#: templates/meetingpoll/choice_form.html:147 #: templates/meetingpoll/choice_form.html:21
#, fuzzy
msgid "Delete"
msgstr "esborrar"
#: templates/meetingpoll/choice_form.html:38
msgid "Save and add another"
msgstr ""
#: templates/meetingpoll/choice_form.html:39
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
#: templates/meetingpoll/poll_detail.html:7 #: templates/meetingpoll/poll_detail.html:8
msgid "Clear cookie, you will not be able to change your vote." msgid "Clear cookie, you will not be able to change your vote."
msgstr "Esborrar la cookie, no podreu canviar el vot." msgstr "Esborrar la cookie, no podreu canviar el vot."
#: templates/meetingpoll/poll_detail.html:7 #: templates/meetingpoll/poll_detail.html:8
msgid "Forget me" msgid "Forget me"
msgstr "Oblida'm" msgstr "Oblida'm"
#: templates/meetingpoll/poll_detail.html:9 #: templates/meetingpoll/poll_detail.html:10
msgid "Export as csv spreadsheet" msgid "Export as csv spreadsheet"
msgstr "Exportar com a un full de càlcul csv" msgstr "Exportar com a un full de càlcul csv"
#: templates/meetingpoll/poll_detail.html:9 #: templates/meetingpoll/poll_detail.html:10
msgid "Export" msgid "Export"
msgstr "" msgstr ""
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Posted by" msgid "Posted by"
msgstr "Penjat per" msgstr "Penjat per"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Anonymous" msgid "Anonymous"
msgstr "Anònim" msgstr "Anònim"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "on" msgid "on"
msgstr "el" msgstr "el"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Shared address" msgid "Shared address"
msgstr "Adreça compartida" msgstr "Adreça compartida"
#: templates/meetingpoll/poll_detail.html:58 #: templates/meetingpoll/poll_detail.html:56
msgid "Your name:" msgid "Your name:"
msgstr "El vostre nom:" msgstr "El vostre nom:"
#: templates/meetingpoll/poll_detail.html:65 #: templates/meetingpoll/poll_detail.html:63
msgid " Check the little boxes to add positive answers " msgid " Check the little boxes to add positive answers "
msgstr "Marque les caselles petites per afegir respostes positives" msgstr "Marque les caselles petites per afegir respostes positives"
#: templates/meetingpoll/poll_detail.html:80 #: templates/meetingpoll/poll_detail.html:78
msgid "Instructions" msgid "Instructions"
msgstr "Instruccions" msgstr "Instruccions"
#: templates/meetingpoll/poll_detail.html:83 #: templates/meetingpoll/poll_detail.html:81
msgid "Point columns to see choice details and comments" msgid "Point columns to see choice details and comments"
msgstr "Apunteu a les columnes per veure els detalls i comentaris" msgstr "Apunteu a les columnes per veure els detalls i comentaris"
#: templates/meetingpoll/poll_detail.html:84 #: templates/meetingpoll/poll_detail.html:82
msgid "Check the boxes for positive answers. " msgid "Check the boxes for positive answers. "
msgstr "Marqueu les caselles per confirmar." msgstr "Marqueu les caselles per confirmar."
#: templates/meetingpoll/poll_detail.html:84 #: templates/meetingpoll/poll_detail.html:82
msgid "You may provide a comment for each choice." msgid "You may provide a comment for each choice."
msgstr "Podeu fer un comentari per cada tria." msgstr "Podeu fer un comentari per cada tria."
#: templates/meetingpoll/poll_detail.html:85 #: templates/meetingpoll/poll_detail.html:83
msgid "Vote" msgid "Vote"
msgstr "Votar" msgstr "Votar"
...@@ -164,7 +173,7 @@ msgstr "Votar" ...@@ -164,7 +173,7 @@ msgstr "Votar"
msgid "Step 1 : About your poll" msgid "Step 1 : About your poll"
msgstr "Pas 1 :Sobre la vostra enquesta" msgstr "Pas 1 :Sobre la vostra enquesta"
#: templates/meetingpoll/poll_form.html:9 #: templates/meetingpoll/poll_form.html:10
msgid "Enter basic information for your poll." msgid "Enter basic information for your poll."
msgstr "Entreu informació bàsica de la vostra enquesta." msgstr "Entreu informació bàsica de la vostra enquesta."
...@@ -248,9 +257,6 @@ msgstr "Següent" ...@@ -248,9 +257,6 @@ msgstr "Següent"
#~ msgid "Are you sure you want to delete this poll?" #~ msgid "Are you sure you want to delete this poll?"
#~ msgstr "Esteu segur que voleu esborrar aquesta enquesta?" #~ msgstr "Esteu segur que voleu esborrar aquesta enquesta?"
#~ msgid "delete"
#~ msgstr "esborrar"
#~ msgid "No poll created yet." #~ msgid "No poll created yet."
#~ msgstr "No hi ha enquestes creades." #~ msgstr "No hi ha enquestes creades."
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-23 14:18+0200\n" "POT-Creation-Date: 2013-07-15 12:00+0200\n"
"PO-Revision-Date: 2010-10-24 22:27+0100\n" "PO-Revision-Date: 2010-10-24 22:27+0100\n"
"Last-Translator: Christophe Siraut <chris@tobald.eu.org>\n" "Last-Translator: Christophe Siraut <chris@tobald.eu.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -16,15 +16,15 @@ msgstr "" ...@@ -16,15 +16,15 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: forms.py:6 #: forms.py:27
msgid "title" msgid "title"
msgstr "titre" msgstr "titre"
#: forms.py:7 #: forms.py:30
msgid "description" msgid "description"
msgstr "description" msgstr "description"
#: models.py:23 #: models.py:24
msgid "Title" msgid "Title"
msgstr "Titre" msgstr "Titre"
...@@ -36,49 +36,49 @@ msgstr "" ...@@ -36,49 +36,49 @@ msgstr ""
"Vous n'êtes pas authentifié et ne pourrez donc pas modifier le sondage après " "Vous n'êtes pas authentifié et ne pourrez donc pas modifier le sondage après "
"sa création ou recevoir des notifications." "sa création ou recevoir des notifications."
#: views.py:81 #: views.py:59
msgid "There are some errors in the form you posted." msgid "There are some errors in the form you posted."
msgstr "Il ya des erreurs dans le formulaire que vous avez posté." msgstr "Il ya des erreurs dans le formulaire que vous avez posté."
#: views.py:176 #: views.py:146
msgid "Your vote has been counted, thank you." msgid "Your vote has been counted, thank you."
msgstr "Votre vote a été compté, merci." msgstr "Votre vote a été compté, merci."
#: views.py:178 #: views.py:148
msgid "Your vote has been updated, thank you." msgid "Your vote has been updated, thank you."
msgstr "Votre vote a été mis-à-jour, merci." msgstr "Votre vote a été mis-à-jour, merci."
#: views.py:186 views.py:188 #: views.py:156 views.py:158
msgid "Did you forget to provide your name?" msgid "Did you forget to provide your name?"
msgstr "Auriez-vous oublié de renseigner votre nom?" msgstr "Auriez-vous oublié de renseigner votre nom?"
#: views.py:189 #: views.py:159
msgid "your name" msgid "your name"
msgstr "votre nom:" msgstr "votre nom:"
#: views.py:204 #: views.py:174
msgid "You have voted." msgid "You have voted."
msgstr "Vous avez voté." msgstr "Vous avez voté."
#: views.py:221 #: views.py:191
msgid "Login let you modify your vote anytime." msgid "Login let you modify your vote anytime."
msgstr "S'authentifier permet de modifier le vote ulterieurement." msgstr "S'authentifier permet de modifier le vote ulterieurement."
#: views.py:227 #: views.py:197
#, python-format #, python-format
msgid "%s has voted and can still modify its vote." msgid "%s has voted and can still modify its vote."
msgstr "%s a voté et peut encore modifier son vote." msgstr "%s a voté et peut encore modifier son vote."
#: views.py:228 views.py:242 #: views.py:198 views.py:212
#, python-format #, python-format
msgid "Not %s? Click Forget me." msgid "Not %s? Click Forget me."
msgstr "Vous n'êtes pas %s? Cliquez Oublie-moi." msgstr "Vous n'êtes pas %s? Cliquez Oublie-moi."
#: templates/meetingpoll/choice_form.html:107 #: templates/meetingpoll/choice_form.html:12
msgid "Step 2 : Manage choices" msgid "Step 2 : Manage choices"
msgstr "Etape 2: Choisir les dates proposées" msgstr "Etape 2: Choisir les dates proposées"
#: templates/meetingpoll/choice_form.html:108 #: templates/meetingpoll/choice_form.html:13
msgid "" msgid ""
"Provide possible dates for your meeting. You may adjust the time and add " "Provide possible dates for your meeting. You may adjust the time and add "
"other details in the text field." "other details in the text field."
...@@ -86,76 +86,85 @@ msgstr "" ...@@ -86,76 +86,85 @@ msgstr ""
"Proposez quelques dates pour votre rendez-vous. Vous pouvez ajuster l'heure " "Proposez quelques dates pour votre rendez-vous. Vous pouvez ajuster l'heure "
"et ajouter d'autres détails dans le champ texte." "et ajouter d'autres détails dans le champ texte."
#: templates/meetingpoll/choice_form.html:120 #: templates/meetingpoll/choice_form.html:19
msgid "Dates" msgid "Dates"
msgstr "" msgstr ""
#: templates/meetingpoll/choice_form.html:121 #: templates/meetingpoll/choice_form.html:20
#: templates/meetingpoll/poll_detail.html:92 #: templates/meetingpoll/poll_detail.html:90
msgid "Details" msgid "Details"
msgstr "Détails" msgstr "Détails"
#: templates/meetingpoll/choice_form.html:147 #: templates/meetingpoll/choice_form.html:21
#, fuzzy
msgid "Delete"
msgstr "supprimer"
#: templates/meetingpoll/choice_form.html:38
msgid "Save and add another"
msgstr ""
#: templates/meetingpoll/choice_form.html:39
msgid "Save" msgid "Save"
msgstr "Sauver" msgstr "Sauver"
#: templates/meetingpoll/poll_detail.html:7 #: templates/meetingpoll/poll_detail.html:8
msgid "Clear cookie, you will not be able to change your vote." msgid "Clear cookie, you will not be able to change your vote."
msgstr "Éffacer le cookie, vous ne pourrez plus modifier votre vote." msgstr "Éffacer le cookie, vous ne pourrez plus modifier votre vote."
#: templates/meetingpoll/poll_detail.html:7 #: templates/meetingpoll/poll_detail.html:8
msgid "Forget me" msgid "Forget me"
msgstr "Oublie-moi" msgstr "Oublie-moi"
#: templates/meetingpoll/poll_detail.html:9 #: templates/meetingpoll/poll_detail.html:10
msgid "Export as csv spreadsheet" msgid "Export as csv spreadsheet"
msgstr "Exporter vers un tableau csv" msgstr "Exporter vers un tableau csv"
#: templates/meetingpoll/poll_detail.html:9 #: templates/meetingpoll/poll_detail.html:10
msgid "Export" msgid "Export"
msgstr "Exporter" msgstr "Exporter"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Posted by" msgid "Posted by"
msgstr "Posté par" msgstr "Posté par"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Anonymous" msgid "Anonymous"
msgstr "Anonyme" msgstr "Anonyme"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "on" msgid "on"
msgstr "le" msgstr "le"
#: templates/meetingpoll/poll_detail.html:17 #: templates/meetingpoll/poll_detail.html:19
msgid "Shared address" msgid "Shared address"
msgstr "Adresse partagée" msgstr "Adresse partagée"
#: templates/meetingpoll/poll_detail.html:58 #: templates/meetingpoll/poll_detail.html:56
msgid "Your name:" msgid "Your name:"
msgstr "Votre nom:" msgstr "Votre nom:"
#: templates/meetingpoll/poll_detail.html:65 #: templates/meetingpoll/poll_detail.html:63
msgid " Check the little boxes to add positive answers " msgid " Check the little boxes to add positive answers "
msgstr "Cochez les boîtes pour des réponses positives " msgstr "Cochez les boîtes pour des réponses positives "
#: templates/meetingpoll/poll_detail.html:80 #: templates/meetingpoll/poll_detail.html:78
msgid "Instructions" msgid "Instructions"
msgstr "" msgstr ""
#: templates/meetingpoll/poll_detail.html:83 #: templates/meetingpoll/poll_detail.html:81
msgid "Point columns to see choice details and comments" msgid "Point columns to see choice details and comments"
msgstr "Pointez les colonnes pour faire apparaître les détails" msgstr "Pointez les colonnes pour faire apparaître les détails"
#: templates/meetingpoll/poll_detail.html:84 #: templates/meetingpoll/poll_detail.html:82
msgid "Check the boxes for positive answers. " msgid "Check the boxes for positive answers. "
msgstr "Cochez les boîtes pour des réponses positives." msgstr "Cochez les boîtes pour des réponses positives."
#: templates/meetingpoll/poll_detail.html:84