Commit f8ecf5e0 authored by Christophe Siraut's avatar Christophe Siraut

Use message framework. Update french translation.

parent 2acce46b
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-12 19:59+0200\n"
"POT-Creation-Date: 2013-05-12 23:38+0200\n"
"PO-Revision-Date: 2013-05-10 11:12+0200\n"
"Last-Translator: Joan <aseques@gmail.com>\n"
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
......@@ -47,28 +47,51 @@ msgstr "descripció"
msgid "Title"
msgstr "Titol"
#: meetingpoll/views.py:113
#: meetingpoll/views.py:32
#, fuzzy
msgid ""
"You are not logged so you will not be able to modify your poll after "
"creation or recieve notifications."
msgstr ""
"No esteu registrat per tant no podreu modificar la enquesta un cop creada. "
"Potser voleu entrar o registrar-vos abans."
#: meetingpoll/views.py:114
msgid "There are some errors in the form you posted."
msgstr ""
#: meetingpoll/views.py:212
#: meetingpoll/views.py:214
#, fuzzy
msgid "Your vote has been counted, thank you."
msgstr "El vostre compte ja s'ha creat, podeu entrar."
#: meetingpoll/views.py:216
#, fuzzy
msgid "Your vote has been updated, thank you."
msgstr "El vostre compte ja s'ha creat, podeu entrar."
#: meetingpoll/views.py:220 meetingpoll/views.py:223
#: meetingpoll/views.py:224 meetingpoll/views.py:226
msgid "Did you forget to provide your name?"
msgstr ""
#: meetingpoll/views.py:224
#: meetingpoll/views.py:227
#, fuzzy
msgid "your name"
msgstr "El vostre nom:"
#: meetingpoll/views.py:253
#: meetingpoll/views.py:242
msgid "You have voted."
msgstr ""
#: meetingpoll/views.py:256
msgid "Login let you modify your vote anytime."
msgstr ""
#: meetingpoll/views.py:264
#, python-format
msgid "%s has voted"
msgstr ""
#: poll/views.py:28
msgid "Thanks for your vote."
msgstr ""
......@@ -92,7 +115,16 @@ msgstr "No hi ha enquestes disponibles."
msgid "Easy poll sharing"
msgstr "Compartició fàcil d'enquestes"
#: templates/base.html:63
#: templates/base.html:34 templates/index.html:55
msgid "Logout"
msgstr "Sortir"
#: templates/base.html:36
#, fuzzy
msgid "Login"
msgstr "entrar"
#: templates/base.html:65
msgid "Nuages is brought to you by"
msgstr "Nuages ús ha arribat a través de"
......@@ -165,10 +197,6 @@ msgstr "Canviar la contrasenya"
msgid "Change email address"
msgstr "Canviar l'adreça de correu"
#: templates/index.html:55
msgid "Logout"
msgstr "Sortir"
#: templates/index.html:58
msgid "Examples"
msgstr "Exemples"
......@@ -317,33 +345,16 @@ msgstr "Marqueu les caselles per confirmar."
msgid "You may provide a comment for each choice."
msgstr "Podeu fer un comentari per cada tria."
#: templates/meetingpoll/poll_form.html:9
#: templates/meetingpoll/poll_form.html:8
msgid "Step 1 : About your poll"
msgstr "Pas 1 :Sobre la vostra enquesta"
#: templates/meetingpoll/poll_form.html:12
msgid ""
"Enter basic information on your poll. (You are not logged so you will not be "
"able to modify your poll after creation. You may want to login or register "
"first."
msgstr ""
"Entreu informació bàsica de la vostra enquesta. (No esteu registrat per tant "
"no podreu modificar la enquesta un cop creada. Potser voleu entrar o "
"registrar-vos abans)."
#: templates/meetingpoll/poll_form.html:12
msgid "login"
msgstr "entrar"
#: templates/meetingpoll/poll_form.html:12
msgid "register"
msgstr "registrar-se"
#: templates/meetingpoll/poll_form.html:14
msgid "Enter basic information on your poll."
#: templates/meetingpoll/poll_form.html:9
#, fuzzy
msgid "Enter basic information for your poll."
msgstr "Entrar informació bàsica de la vostra enquesta."
#: templates/meetingpoll/poll_form.html:26
#: templates/meetingpoll/poll_form.html:18
msgid "Next"
msgstr "Següent"
......@@ -430,6 +441,9 @@ msgstr "Reiniciar la contrasenya a %(site_name)s"
msgid "You are now registered. Activation email sent."
msgstr "Ja esteu registrat. S'ha enviat el correu d'activació."
#~ msgid "register"
#~ msgstr "registrar-se"
#~ msgid "Activate users"
#~ msgstr "Activar usuaris"
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-12 19:59+0200\n"
"POT-Creation-Date: 2013-05-12 23:38+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"
......@@ -48,27 +48,51 @@ msgstr ""
msgid "Title"
msgstr "Titel"
#: meetingpoll/views.py:113
#: meetingpoll/views.py:32
#, 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) "
#: meetingpoll/views.py:114
msgid "There are some errors in the form you posted."
msgstr ""
#: meetingpoll/views.py:212
#: meetingpoll/views.py:214
msgid "Your vote has been counted, thank you."
msgstr ""
#: meetingpoll/views.py:216
msgid "Your vote has been updated, thank you."
msgstr ""
#: meetingpoll/views.py:220 meetingpoll/views.py:223
#: meetingpoll/views.py:224 meetingpoll/views.py:226
msgid "Did you forget to provide your name?"
msgstr ""
#: meetingpoll/views.py:224
#: meetingpoll/views.py:227
#, fuzzy
msgid "your name"
msgstr "Uw naam:"
#: meetingpoll/views.py:253
#: meetingpoll/views.py:242
msgid "You have voted."
msgstr ""
#: meetingpoll/views.py:256
msgid "Login let you modify your vote anytime."
msgstr ""
#: meetingpoll/views.py:264
#, python-format
msgid "%s has voted"
msgstr ""
#: poll/views.py:28
msgid "Thanks for your vote."
msgstr ""
......@@ -92,7 +116,16 @@ msgstr "Geen poll is beschikbaar"
msgid "Easy poll sharing"
msgstr "Eenvoudig poll publiceren"
#: templates/base.html:63
#: templates/base.html:34 templates/index.html:55
msgid "Logout"
msgstr "Logout"
#: templates/base.html:36
#, fuzzy
msgid "Login"
msgstr "Login"
#: templates/base.html:65
msgid "Nuages is brought to you by"
msgstr "Nuages is gemaakt door"
......@@ -165,10 +198,6 @@ msgstr "Wachtwoord wijzigen"
msgid "Change email address"
msgstr "Email adres wijzigen"
#: templates/index.html:55
msgid "Logout"
msgstr "Logout"
#: templates/index.html:58
msgid "Examples"
msgstr "Voorbeelden"
......@@ -308,37 +337,16 @@ msgstr "Check de vakjes aan voor de positieve antwoorden. "
msgid "You may provide a comment for each choice."
msgstr "U kmag een reactie voor elke keuze toevoegen. "
#: templates/meetingpoll/poll_form.html:9
#: templates/meetingpoll/poll_form.html:8
msgid "Step 1 : About your poll"
msgstr "Stap 1 : Over uw poll"
#: templates/meetingpoll/poll_form.html:12
#, fuzzy
msgid ""
"Enter basic information on your poll. (You are not logged so you will not be "
"able to modify your poll after creation. You may want to login or register "
"first."
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) "
#: templates/meetingpoll/poll_form.html:12
#, fuzzy
msgid "login"
msgstr "Login"
#: templates/meetingpoll/poll_form.html:12
#: templates/meetingpoll/poll_form.html:9
#, fuzzy
msgid "register"
msgstr "registreer"
#: templates/meetingpoll/poll_form.html:14
msgid "Enter basic information on your poll."
msgid "Enter basic information for your poll."
msgstr "Geef basisinformatie over uw poll."
#: templates/meetingpoll/poll_form.html:26
#: templates/meetingpoll/poll_form.html:18
msgid "Next"
msgstr "Volgende"
......@@ -427,6 +435,10 @@ msgstr ""
msgid "You are now registered. Activation email sent."
msgstr ""
#, fuzzy
#~ msgid "register"
#~ msgstr "registreer"
#, fuzzy
#~ msgid "E-mail"
#~ msgstr "Email"
......
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render_to_response
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.forms.formsets import formset_factory
from django.forms.models import inlineformset_factory, BaseInlineFormSet
from django.core.exceptions import ObjectDoesNotExist
from django.views.generic.create_update import update_object
from django.contrib.auth.decorators import login_required
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 django.contrib.sites.models import get_current_site
from django.conf import settings
from meetingpoll.models import Poll, Choice, Vote, Bulletin
from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm
from account.views import email_notify
from django.views.generic.create_update import update_object
from account.forms import UserProfileForm
from account.views import email_notify
from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm
from meetingpoll.models import Poll, Choice, Vote, Bulletin
def new(request):
if request.method == 'POST':
......@@ -28,6 +28,8 @@ def new(request):
request.session[key] = True # This writes cookie??
return HttpResponseRedirect(reverse('choices', args=(str(poll.id),)))
else:
if request.user.is_anonymous():
messages.warning(request, _('You are not logged so you will not be able to modify your poll after creation or recieve notifications.'))
form = PollForm()
return render_to_response(
'meetingpoll/poll_form.html',
......@@ -55,7 +57,6 @@ def editchoices(request, poll_id):
poll = get_object_or_404(Poll.objects.all(), id=poll_id)
language_code = request.LANGUAGE_CODE
error_message = ''
if request.user.is_anonymous(): # Anonymous wants to edit his new poll
key = 'is_' + poll_id + '_author'
if not request.session.get(key, False):
......@@ -110,7 +111,7 @@ def editchoices(request, poll_id):
return HttpResponseRedirect(poll.link)
else:
#vforms=OrderedItemFormset(request.POST, instance=poll)
error_message = _("There are some errors in the form you posted.")
messages.error(request, _("There are some errors in the form you posted."))
vforms = instances
else:
......@@ -121,7 +122,9 @@ def editchoices(request, poll_id):
else:
vforms = OrderedItemFormset(instance=poll)
return render_to_response('meetingpoll/choice_form.html', {'object': poll, 'vforms': vforms, 'error_message' : error_message, 'language_code': language_code,}, context_instance=RequestContext(request))
return render_to_response('meetingpoll/choice_form.html',
{'object': poll, 'vforms': vforms, 'language_code': language_code,},
context_instance=RequestContext(request))
@login_required
......@@ -141,8 +144,7 @@ def make_buletin_form(poll, **kwargs):
def vote(request, poll_id):
poll = get_object_or_404(Poll.objects.all(), id=poll_id)
error_message = None
has_voted = False
has_voted, is_updated = False, False
if request.method == 'POST':
form = BulletinForm(request.POST, initial={'poll': poll.id,})
......@@ -160,7 +162,6 @@ def vote(request, poll_id):
"""
try:
Bulletin.objects.get(poll=poll.id,voter=voter)
error_message = 'A user with the same name has already voted.'
return render_to_response('sondage/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message}, context_instance=RequestContext(request))
except:
pass
......@@ -188,7 +189,6 @@ def vote(request, poll_id):
if new.voice:
choice.votecount += 1
choice.save()
error_message = "Your vote has been counted, thank you."
if request.user.is_anonymous(): # Anonymous has voted...
key = 'has_voted-' + poll.id
request.session[key] = True # This writes cookie
......@@ -209,7 +209,11 @@ def vote(request, poll_id):
old.voice = vorm.cleaned_data['voice']
old.comment = vorm.cleaned_data['comment']
old.save()
error_message = _("Your vote has been updated, thank you.")
is_updated = True
if has_voted:
messages.info(request, _("Your vote has been counted, thank you."))
if is_updated:
messages.info(request, _("Your vote has been updated, thank you."))
if has_voted and poll.user:
try:
if poll.user.userprofile.email_notifications:
......@@ -217,10 +221,9 @@ def vote(request, poll_id):
except:
pass
else:
error_message = _('Did you forget to provide your name?')
messages.error(request, _('Did you forget to provide your name?'))
else:
#error_message = form.errors
error_message = _('Did you forget to provide your name?')
messages.error(request, _('Did you forget to provide your name?'))
voter = _('your name')
else: # request.method = 'GET'
......@@ -236,7 +239,7 @@ def vote(request, poll_id):
voter = str(request.user)
try:
bulletin = Bulletin.objects.get(poll=poll,voter=voter)
error_message = " You have voted."
messages.info(request, _("You have voted."))
diff = len(vforms) - len(Vote.objects.filter(bulletin=bulletin))
if diff == 0:
"""
......@@ -250,7 +253,7 @@ def vote(request, poll_id):
pass
else:
voter = ''
error_message = _("Login let you modify your vote anytime.")
messages.info(request, _("Login let you modify your vote anytime."))
key = 'has_voted-' + poll.id
if request.session.get(key, False):
has_voted = True # Used to show "Forget me"
......@@ -258,7 +261,7 @@ def vote(request, poll_id):
#error_message = 'Modify your vote? (clear cookie if you are not ' + voter + ')'
try:
bulletin = Bulletin.objects.get(poll=poll, voter=voter)
error_message = voter + ' has voted'
messages.info(request, _('%s has voted') % voter)
diff = len(vforms) - len(Vote.objects.filter(bulletin=bulletin))
if diff == 0:
"""
......@@ -273,7 +276,7 @@ def vote(request, poll_id):
form = BulletinForm(instance=poll,initial={'voter': voter})
#form = BulletinForm(instance=poll)
return render_to_response('meetingpoll/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message, 'has_voted': has_voted}, context_instance=RequestContext(request))
return render_to_response('meetingpoll/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'has_voted': has_voted}, context_instance=RequestContext(request))
def exp_csv(request, poll_id):
import csv
......
......@@ -36,6 +36,9 @@ ul li {
list-style-type: circle;
}
ul.messagelist { margin: 0px 1px 2px 1px;}
ul.messagelist li { padding: 6px 6px 5px 28px; }
td, thead, th, tr {
border: 0px; /* override django default */
}
......@@ -49,6 +52,7 @@ form label {
float: left;
width: 210px;
height: 30px;
cursor: pointer;
}
input[type="submit"] { margin-left: 210px; }
......@@ -56,8 +60,11 @@ input[type="submit"] { margin-left: 210px; }
#nheader {
/* height: 7px; */
padding-top: 6px;
border-bottom: 0 solid #7f90a5;
}
h1 {
}
#nheader select {
border: 0px solid #111;
}
......@@ -233,7 +240,7 @@ input:focus, textarea:focus {
font-size: 12px;
}
.info {
.filet {
float: none;
padding: 10px 15px;
width: 520px;
......
......@@ -7,7 +7,6 @@
<head>
<title> {% block title %} Nuages - {% trans "Easy poll sharing" %} {% endblock %} </title>
{% block head %}{% endblock %}
<!-- Django stylesheet -->
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admin/css/base.css"/>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admin/css/forms.css"/>
......@@ -17,23 +16,27 @@
</head>
<body>
{% block messages %}
{% if messages %}
<ul class="messagelist">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}</ul>
{% endif %}
{% endblock messages %}
<div id="nheader">
<div class="menu">
<a href="{% url 'home' %}" title="Homepage">Nuages</a>&nbsp;
{% block menu %}{% endblock %}
{% if user.is_authenticated %}
<a href="{% url 'auth_logout' %}">{% trans 'Logout' %}</a>
{% else %}
<a href="{% url 'auth_login' %}">{% trans 'Login' %}</a>
{% endif %}
<a href="{% url 'home' %}" title="Homepage">Nuages</a>&nbsp;
{% block menu %}{% endblock %}
{% if user.is_authenticated %}
<a href="{% url 'auth_logout' %}">Logout</a>
{% else %}
<a href="{% url 'auth_login' %}">Login</a>
{% endif %}
<span class="notify">
{% if error_message %}
<!--img src="/static/images/info.png" alt="info" "-->&nbsp; {{ error_message }}
{% endif %}
<span class="notify">
<form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">{% csrf_token %}
<input name="next" type="hidden" value="" />
<select name="language" onChange="langForm.submit()" />
......@@ -45,8 +48,7 @@
{% endfor %}
</select>
</form>
</span>
</span>
</div>
</div>
......
......@@ -13,7 +13,7 @@
<h1><img src="{{ STATIC_URL }}images/nuage_guillaume_boitel.png">Nuages</h1>
<p class="info">
<p class="filet">
{% trans "Create polls easily, and publish them for your mates, in order to plan meetings or else." %}
</p>
{% endblock %}
......
......@@ -105,7 +105,7 @@
{% block chapeau %}
<h3>{% trans "Step 2 : Manage choices" %}</h3>
<p class="info">{% trans "Provide possible dates for your meeting. You may adjust the time and add other details in the text field" %}</p>
<p class="filet">{% trans "Provide possible dates for your meeting. You may adjust the time and add other details in the text field" %}</p>
{% endblock %}
{% block content %}
......
......@@ -12,7 +12,7 @@
{% block chapeau %}
<h1>{{object}}</h1>
<p class="info">
<p class="filet">
{{object.description}} <br /> {% trans "Posted by" %} <code> {% if object.user %}{{object.user}}{% else %}{% trans 'Anonymous' %}{% endif %} </code> {% trans "on" %} <code> {{object.pub_date|date:"d F"}}. </code><br /> {% trans "Shared address" %}: <input type="text" name="link" style="border:0;" value="{{ object.link }}" readonly="readonly" class='adresse' />
</p>
......
......@@ -5,19 +5,11 @@
{% block title %}Create an meeting{% endblock %}
{% block chapeau %}
<h3>{% trans "Step 1 : About your poll" %}</h3>
{% if not user.is_authenticated %}
<p class="info">{% trans 'Enter basic information on your poll. (You are not logged so you will not be able to modify your poll after creation. You may want to login or register first.' %}) <a href="{% url 'auth_login' %}">{% trans 'login' %}</a>/<a href="{% url 'registration_register' %}">{% trans 'register' %}</a></p>
{% else %}
<p class="info">{% trans 'Enter basic information on your poll.' %}</p>
{% endif %}
<p class="filet">{% trans 'Enter basic information for your poll.' %}</p>
{% endblock %}
{% block content %}
<br />
<form action="" method="post"> {% csrf_token %}
<table>
......@@ -26,6 +18,5 @@
<tr><th><label class="hide"> </label></th><td><input type="submit" value=" {% trans 'Next' %} &rarr; " /></td></tr>
</table>
</form>
{% endblock %}
......@@ -5,14 +5,14 @@
<h1>{% trans "About Nuages" %}</h1>
<p class="info">
<p class="filet">
{% trans "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." %}
</p>
<p class="info">
<p class="filet">
{% trans "Feedback and collaboration are welcome at" %} <a href="mailto:nuages@lists.domainepublic.net">nuages@lists.domainepublic.net</a>. {% trans "<a href='https://listes.domainepublic.net/listinfo/nuages'>Inscription to the mailing list</a> is recommended before posting." %}
{% trans "We have a project page at" %} <a href="http://projets.domainepublic.net/projects/nuages/">projets.domainepublic.net</a>.
</p>
<p class="info">
<p class="filet">
Get Nuages: git clone http://git.domainepublic.net/git/nuages.git <br>
Browse changes: <a href="http://git.domainepublic.net/?p=nuages.git">http://git.domainepublic.net/?p=nuages.git</a><br>
{% trans "Sources freely available under license" %} <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.
......@@ -46,7 +46,7 @@ Browse changes: <a href="http://git.domainepublic.net/?p=nuages.git">http://git.
</ol>
</div>
<h3>{% trans "Translate Nuages" %}</h3>
<div class="info">
<div class="filet">
<p>{% trans "If you have a little time and want help translate Nuages in your language, your help is welcome. You can translate the following file to your language, and present yourself on the mailing list." %}</p>
<pre>
......@@ -57,7 +57,7 @@ http://git.domainepublic.net/?p=nuages.git;a=blob_plain;f=locale/fr/LC_MESSAGES/
<h3>{% trans "Applying patches" %}</h3>
<div class="info">
<div class="filet">
<p>{% trans "Please send us a mail or join Domaine Public irc to let us know your propositions." %}</p>
</div>
......
......@@ -5,7 +5,7 @@
{% block content %}
<h2>Success</h2>
<p class=info>{% trans 'Your account has been created. You may now login.' %}</p>
<p class="filet">{% trans 'Your account has been created. You may now login.' %}</p>
<ul>
<li><a href="{% url 'auth_login' %}">Log in</a></li>
......
......@@ -5,7 +5,7 @@
{% block chapeau %}
<h2>Create an account</h2>
<p class=info>Fill the form to create an account for <i>sondage</i>.</p>
<p class="filet">Fill the form to create an account for <i>sondage</i>.</p>
{% endblock %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment