Commit de1172bb authored by Christophe Siraut's avatar Christophe Siraut

Make meetingpoll reusable.

parent a751572b
APPS := meetingpoll registration_templates nuages_base
clean:
find . -name "*.pyc" -exec rm {} \;
find . -name "*~" -exec rm {} \;
find . -name ".svn" -exec rm -r {} \;
apps:
apps="meetingpoll registration_templates nuages_base"
update:
git pull --rebase
python manage.py syncdb --noinput
......@@ -10,14 +15,19 @@ update:
chown -R www-data .
translation:
#django-admin.py makemessages -l fr
python manage.py makemessages -a
python manage.py compilemessages
cwd=`pwd`;\
for app in ${APPS}; do\
cd $$cwd/$$app;\
django-admin makemessages -a;\
django-admin compilemessages;\
done
lint:
#django-lint
pylint --generated-members=objects,_meta,id meetingpoll
pylint --generated-members=objects,_meta,id accounts
new_translation:
echo Creating translation files for ${language}
for app in ${APPS}; do\
cd $$cwd/$$app;\
django-admin makemessages -l ${language};\
done
test:
python-coverage run --source='.' manage.py test
......
This diff is collapsed.
This diff is collapsed.
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-23 14:18+0200\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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: forms.py:6
msgid "title"
msgstr "titel"
#: forms.py:7
msgid "description"
msgstr ""
#: models.py:23
msgid "Title"
msgstr "Titel"
#: views.py:31
#, fuzzy
msgid ""
"You are not logged so you will not be able to modify your poll after "
"creation or recieve notifications."
msgstr ""
"Geef basisinformatie over uw poll. (U bent niet ingelogd, zodat u niet in "
"staat om uw poll te wijzigen na de schepping. U kunt <a href = \" / user / "
"login / \"> login </ a> of <a href=\"/user/registration/\"> registreer </ a> "
"eerste) "
#: views.py:81
msgid "There are some errors in the form you posted."
msgstr ""
#: views.py:176
msgid "Your vote has been counted, thank you."
msgstr ""
#: views.py:178
msgid "Your vote has been updated, thank you."
msgstr ""
#: views.py:186 views.py:188
msgid "Did you forget to provide your name?"
msgstr ""
#: views.py:189
#, fuzzy
msgid "your name"
msgstr "Uw naam:"
#: views.py:204
msgid "You have voted."
msgstr ""
#: views.py:221
msgid "Login let you modify your vote anytime."
msgstr ""
#: views.py:227
#, python-format
msgid "%s has voted and can still modify its vote."
msgstr ""
#: views.py:228 views.py:242
#, python-format
msgid "Not %s? Click Forget me."
msgstr ""
#: templates/meetingpoll/choice_form.html:107
msgid "Step 2 : Manage choices"
msgstr "Stap 2 : Beheer keuses"
#: templates/meetingpoll/choice_form.html:108
msgid ""
"Provide possible dates for your meeting. You may adjust the time and add "
"other details in the text field."
msgstr ""
#: templates/meetingpoll/choice_form.html:120
msgid "Dates"
msgstr ""
#: templates/meetingpoll/choice_form.html:121
#: templates/meetingpoll/poll_detail.html:92
msgid "Details"
msgstr ""
#: templates/meetingpoll/choice_form.html:147
msgid "Save"
msgstr "Opslaan"
#: templates/meetingpoll/poll_detail.html:7
msgid "Clear cookie, you will not be able to change your vote."
msgstr ""
#: templates/meetingpoll/poll_detail.html:7
msgid "Forget me"
msgstr "Vergeet mij"
#: templates/meetingpoll/poll_detail.html:9
msgid "Export as csv spreadsheet"
msgstr "Export als cvs spreadsheet"
#: templates/meetingpoll/poll_detail.html:9
msgid "Export"
msgstr ""
#: templates/meetingpoll/poll_detail.html:17
msgid "Posted by"
msgstr "Gepost door"
#: templates/meetingpoll/poll_detail.html:17
msgid "Anonymous"
msgstr ""
#: templates/meetingpoll/poll_detail.html:17
msgid "on"
msgstr "op"
#: templates/meetingpoll/poll_detail.html:17
msgid "Shared address"
msgstr "Gedeelde adres"
#: templates/meetingpoll/poll_detail.html:58
msgid "Your name:"
msgstr "Uw naam:"
#: templates/meetingpoll/poll_detail.html:65
msgid " Check the little boxes to add positive answers "
msgstr " Check de kleine vakjes om positieve antwoorden toe te voegen"
#: templates/meetingpoll/poll_detail.html:80
msgid "Instructions"
msgstr ""
#: templates/meetingpoll/poll_detail.html:83
#, fuzzy
msgid "Point columns to see choice details and comments"
msgstr "Punt colums om keuze details te zien"
#: templates/meetingpoll/poll_detail.html:84
msgid "Check the boxes for positive answers. "
msgstr "Check de vakjes aan voor de positieve antwoorden. "
#: templates/meetingpoll/poll_detail.html:84
msgid "You may provide a comment for each choice."
msgstr "U kmag een reactie voor elke keuze toevoegen. "
#: templates/meetingpoll/poll_detail.html:85
msgid "Vote"
msgstr ""
#: templates/meetingpoll/poll_form.html:8
msgid "Step 1 : About your poll"
msgstr "Stap 1 : Over uw poll"
#: templates/meetingpoll/poll_form.html:9
#, fuzzy
msgid "Enter basic information for your poll."
msgstr "Geef basisinformatie over uw poll."
#: templates/meetingpoll/poll_form.html:18
msgid "Next"
msgstr "Volgende"
#, fuzzy
#~ msgid "Polls"
#~ msgstr "Mijn polls"
#~ msgid "There are no polls available."
#~ msgstr "Geen poll is beschikbaar."
#~ msgid "Easy poll sharing"
#~ msgstr "Eenvoudig poll publiceren"
#~ msgid ""
#~ "Create polls easily, and publish them for your mates, in order to plan "
#~ "meetings and activities."
#~ msgstr ""
#~ "Eenvoudig maak polls, publiceer ze voor je maten, om vergaderingen te "
#~ "plannen."
#~ msgid "Logout"
#~ msgstr "Logout"
#, fuzzy
#~ msgid "Login"
#~ msgstr "Login"
#~ msgid "Nuages is brought to you by"
#~ msgstr "Nuages is gemaakt door"
#~ msgid "Make an event"
#~ msgstr "Maak een poll"
#~ msgid "Shedule an event"
#~ msgstr "Plan een meeting"
#~ msgid "About nuages"
#~ msgstr "Over Nuages"
#~ msgid "Learn more"
#~ msgstr "Leer wat meer"
#~ msgid "My polls"
#~ msgstr "Mijn polls"
#~ msgid "edit"
#~ msgstr "editeren"
#~ msgid "Are you sure you want to delete this poll?"
#~ msgstr "Bent U zeker U wil deze poll verwijderen"
#~ msgid "delete"
#~ msgstr "verwijderen"
#, fuzzy
#~ msgid "No poll created yet."
#~ msgstr "Geen poll is beschikbaar"
#~ msgid "My account"
#~ msgstr "Mijn profile"
#~ msgid "Username"
#~ msgstr "Gebruikersnaam"
#~ msgid "Change password"
#~ msgstr "Wachtwoord wijzigen"
#~ msgid "Change email address"
#~ msgstr "Email adres wijzigen"
#~ msgid "Examples"
#~ msgstr "Voorbeelden"
#~ msgid "This page is available in the following languages"
#~ msgstr "Deze pagina is beschikbaar in de volgende talen"
#~ msgid "Languages"
#~ msgstr "Talen"
#~ msgid "Nuages is available in many languages."
#~ msgstr "Nuages is beschikbaar in verschilende talen"
#, fuzzy
#~ msgid "Set language cookie"
#~ msgstr "Stap 2 : Beheer keuses"
#~ msgid "About Nuages"
#~ msgstr "Over Nuages"
#~ msgid ""
#~ "A collaborative meeting poll system, similar to doodle or rdvz. This "
#~ "application was named after Django's famous song and because computer "
#~ "work is easier when its cloudy. It is build in python, using the django "
#~ "framework and a little of javascript."
#~ msgstr ""
#~ "Een gezamenlijke bijeenkomst poll-systeem, vergelijkbaar met doodle of "
#~ "rdvz. Dezeapplicatie is vernoemd naar beroemde Django's lied en omdat "
#~ "computer werkgemakkelijker is wanneer het bewolkt is. Het is gebouwd in "
#~ "python, met behulp van het Django frameworken een beetje javascript."
#~ msgid "Feedback and collaboration are welcome at"
#~ msgstr "Feedback en samenwerking zijn hartelijk welkom"
#~ msgid "We have a project page at"
#~ msgstr "We hebben een project pagina op"
#~ msgid "Sources freely available under license"
#~ msgstr "Bron is vrij beschikbaar onder licentie"
#~ msgid "Translate Nuages"
#~ msgstr "Vertaal Nuages"
#, fuzzy
#~ msgid "Forgot password"
#~ msgstr "Oude wachtwoord"
#, fuzzy
#~ msgid "Register"
#~ msgstr "registreer"
#, fuzzy
#~ msgid "Password changed"
#~ msgstr "Wachtwoord"
#, fuzzy
#~ msgid "easy poll sharing"
#~ msgstr "Eenvoudig poll publiceren"
#, fuzzy
#~ msgid "E-mail"
#~ msgstr "Email"
#~ msgid "Password"
#~ msgstr "Wachtwoord"
#, fuzzy
#~ msgid "Password (again)"
#~ msgstr "Password (bevestiging)"
#, fuzzy
#~ msgid "The two password fields didn't match."
#~ msgstr "De wachtwoorden zijn niet gelijk"
#, fuzzy
#~ msgid "1 registered user"
#~ msgid_plural "%(counter)s registered users"
#~ msgstr[0] "registreer"
#~ msgstr[1] "registreer"
#~ msgid "Password length is less than %(min)d"
#~ msgstr "Wachtwoord lengte is minder dan %(min)d"
#~ msgid "Password length is more than %(max)d"
#~ msgstr "Wachtwoord lengte is meer dan %(max)d"
#~ msgid ""
#~ "You can use a-z, 0-9 and underscore. Login length could be from %(min)s "
#~ "to %(max)s chars."
#~ msgstr ""
#~ "U mag a-z, 0-9 and underscore gebruiken. Gebruikersnaam kan tussen "
#~ "%(min)s en %(max)s chars zijn."
#~ msgid "Login length is less than %(min)d"
#~ msgstr "Login lengte is minder dan %(min)d"
#~ msgid "Login length is more than %(max)d"
#~ msgstr "Login lengte is meer dan %(max)d"
#~ msgid "This login already registered"
#~ msgstr "Deze gebruikersnaam is al geregistreerd"
#~ msgid "This email already registered."
#~ msgstr "Deze email adres is al geregistreerd"
#~ msgid "Passwords do not match"
#~ msgstr "Wachtwoorden zijn niet gelijk."
#~ msgid "This email is not registered"
#~ msgstr "Deze email adres is niet geregistreers"
#~ msgid "New email"
#~ msgstr "Nieuwe email"
#~ msgid "Check the mail please"
#~ msgstr "Controleer email a.u.b."
#~ msgid "Change email"
#~ msgstr "Email wijzigen"
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
import string
......@@ -30,7 +31,9 @@ class Poll(models.Model):
@property
def link(self):
return 'http://%s/%s/' % (Site.objects.get_current(), self.id)
return 'http://%s%s' % (
Site.objects.get_current(),
reverse('meetingpoll', args=(self.id,)))
class Choice(models.Model):
......
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block menu %}
{% if has_voted %}
<a title=" {% trans 'Clear cookie, you will not be able to change your vote.' %} " href="/{{object.id}}/clear/">{% trans "Forget me" %}</a>
<a title=" {% trans 'Clear cookie, you will not be able to change your vote.' %} " href="{% url 'clearcookie' object.id %}">{% trans "Forget me" %}</a>
{% endif %}
<a title=" {% trans 'Export as csv spreadsheet' %} " href="/{{object.id}}/csv/">csv</a>
<a title=" {% trans 'Export as csv spreadsheet' %} " href="{% url 'csv' object.id %}">{% trans "Export" %}</a>
{% endblock %}
{% block title %}nuages - {{object}}{% endblock %}
......
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import UpdateView
from meetingpoll.models import Poll
from meetingpoll.forms import PollForm
urlpatterns = patterns(
'',
url(r'^new/$', 'meetingpoll.views.new', name='new'),
url(r'^(?P<pk>\w{4,6})/edit/$',
login_required(UpdateView.as_view(
queryset=Poll.objects.all(),
form_class=PollForm,
success_url='choices/'))),
url(r'^(?P<poll_id>\w{4,6})/$',
'meetingpoll.views.vote',
name='meetingpoll'),
url(r'^(?P<poll_id>\w{4,6})/delete/$', 'meetingpoll.views.delete'),
url(r'^(?P<poll_id>\w{4,6})/edit/choices/$',
'meetingpoll.views.editchoices',
name='choices'),
url(r'^(?P<poll_id>\w{4,6})/vote/$',
'meetingpoll.views.vote',
name='vote'),
url(r'^(?P<poll_id>\w{4,6})/csv/$',
'meetingpoll.views.exp_csv',
name='csv'),
url(r'^(?P<poll_id>\w{4,6})/clear/',
'meetingpoll.views.clear_cookie',
name='clearcookie'),
)
......@@ -7,7 +7,7 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from account.views import email_notify
from nuages_base.views import email_notify
from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm
from meetingpoll.models import Poll, Choice, Vote, Bulletin
......
#!/usr/bin/env python
# coding: utf-8
# Django settings for Nuages
import os
# Turn off for production
DEBUG = True
DEBUG = True # Turn off for production
TEMPLATE_DEBUG = DEBUG
PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
......@@ -51,8 +49,6 @@ LANGUAGES = (
('ca', u'Català')
)
LOCALE_PATHS = ((os.path.join(PROJECT_DIR, 'locale'),))
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
......@@ -83,7 +79,6 @@ STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'static'),
)
# List of finder classes that know how to find static files in
......@@ -120,7 +115,6 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'templates'),
)
INSTALLED_APPS = (
......@@ -133,8 +127,8 @@ INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.admindocs',
'registration',
'account',
'poll',
'registration_templates',
'nuages_base',
'meetingpoll',
)
......@@ -142,4 +136,3 @@ try:
from local_settings import *
except ImportError, e:
pass
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib.auth.views import login, logout
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView, ListView
from django.views.generic.edit import UpdateView
from meetingpoll.models import Poll
from meetingpoll.forms import PollForm
# Enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', ListView.as_view(queryset=Poll.objects.all(), template_name='index.html'), name='home'),
url(r'^nuages/$', TemplateView.as_view(template_name='nuages.html'), name='documentation'),
url(r'^languages/$', TemplateView.as_view(template_name='languages.html'), name='languages'),
url(r'^new/$', 'meetingpoll.views.new', name='new'),
url(r'^(?P<pk>\w{4,6})/edit/$', login_required(UpdateView.as_view(
queryset=Poll.objects.all(),
form_class=PollForm,
success_url='choices/'))),
url(r'^(?P<poll_id>\w{4,6})/$', 'meetingpoll.views.vote'),
url(r'^(?P<poll_id>\w{4,6})/delete/$', 'meetingpoll.views.delete'),
url(r'^(?P<poll_id>\w{4,6})/edit/choices/$', 'meetingpoll.views.editchoices', name='choices'),
url(r'^(?P<poll_id>\w{4,6})/vote/$', 'meetingpoll.views.vote', name='vote'),
url(r'^(?P<poll_id>\w{4,6})/csv/$', 'meetingpoll.views.exp_csv'),
url(r'^(?P<poll_id>\w{4,6})/clear/', 'meetingpoll.views.clear_cookie'),
url(r'^accounts/profile/$', 'account.views.profile', name='profile'),
url(r'^', include('nuages_base.urls')),
url(r'^m/', include('meetingpoll.urls')),
url(r'^accounts/', include('registration.backends.default.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')),
#url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
)
urlpatterns += i18n_patterns('',
url(r'^nuages/$', TemplateView.as_view(template_name='nuages.html'), name='documentation_translated'),
url(r'^$', ListView.as_view(queryset=Poll.objects.all(), template_name='index.html'), name='home_translated'),
url(r'^', include('nuages_base.urls_translated')),
)
from account.models import UserProfile
from nuages_base.models import UserProfile
from django.contrib import admin
admin.site.register(UserProfile)
from django.forms import ModelForm
from account.models import UserProfile
from nuages_base.models import UserProfile
class UserProfileForm(ModelForm):
class Meta:
......