From 8b7300edc08d649c8f410d8f6a0fdac6942b4994 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 21 Jun 2013 23:55:50 +0200 Subject: [PATCH 1/4] models: Announce.category is mandatory --- portail_citoyen_announces/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portail_citoyen_announces/models.py b/portail_citoyen_announces/models.py index 1c1ede0..271bcda 100644 --- a/portail_citoyen_announces/models.py +++ b/portail_citoyen_announces/models.py @@ -48,7 +48,7 @@ class Announce(models.Model): creation_time = models.DateTimeField(_('creation time'), auto_now_add=True) modification_time = models.DateTimeField(_('modification time'), auto_now=True) - category = models.ForeignKey('Category', verbose_name=_('category'), blank=True) + category = models.ForeignKey('Category', verbose_name=_('category')) def __unicode__(self): return u'{title} ({id}) at {modification_time}'.format(title=self.title, From 8afa3e4e1a8aa7f22534224a145b3d05d24f7626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 24 Jun 2013 10:35:19 +0200 Subject: [PATCH 2/4] templates: add class and tags to tables (#3106) --- .../templates/portail_citoyen_announces/form_plugin.html | 6 +++--- .../portail_citoyen_announces/subscription_edit.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/portail_citoyen_announces/templates/portail_citoyen_announces/form_plugin.html b/portail_citoyen_announces/templates/portail_citoyen_announces/form_plugin.html index 0140c82..b121a9d 100644 --- a/portail_citoyen_announces/templates/portail_citoyen_announces/form_plugin.html +++ b/portail_citoyen_announces/templates/portail_citoyen_announces/form_plugin.html @@ -3,19 +3,19 @@
{% csrf_token %} {{ form.non_field_errors }} - +
{% for choice_key, choice_name in form.choices %} - + {% endfor %} {% for field in form %} - + {% for subwidget in field %} {% endfor %} diff --git a/portail_citoyen_announces/templates/portail_citoyen_announces/subscription_edit.html b/portail_citoyen_announces/templates/portail_citoyen_announces/subscription_edit.html index 06a74cf..bfc60e1 100644 --- a/portail_citoyen_announces/templates/portail_citoyen_announces/subscription_edit.html +++ b/portail_citoyen_announces/templates/portail_citoyen_announces/subscription_edit.html @@ -5,19 +5,19 @@ {% csrf_token %} {{ form.non_field_errors }} -
{% trans "Category" %}{{ choice_name }}{{ choice_name }}
{{ field.label }}{{ field.label }}{{ subwidget.tag }}
+
{% for choice_key, choice_name in form.choices %} - + {% endfor %} {% for field in form %} - + {% for subwidget in field %} {% endfor %} From f75d1e9fd82c469e8ed4c18b5fe4c4b0fbfa4bae Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 24 Jun 2013 11:00:23 +0200 Subject: [PATCH 3/4] transports: make SMSTransport name customizable --- portail_citoyen_announces/transports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/portail_citoyen_announces/transports.py b/portail_citoyen_announces/transports.py index 7fb18c5..db53702 100644 --- a/portail_citoyen_announces/transports.py +++ b/portail_citoyen_announces/transports.py @@ -90,15 +90,16 @@ class SMSTransport(object): ] mobile_re = re.compile('^0[67][0-9]{8}$') - def __init__(self, url, from_mobile, login=None, password=None, identifier='sms'): + def __init__(self, url, from_mobile, login=None, password=None, identifier='sms', name=_('sms')): self.url = url self.from_mobile = from_mobile self.login = login self.password = password self.identifier = identifier + self.name = name def get_choices(self): - return ((self.identifier, self.identifier),) + return ((self.identifier, self.name),) def get_subscriptions(self, category): return models.Subscription.objects.filter(category=category, From 4a63b9dd68b7dc102e4a9e2cf6eca2d116a2ef27 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 24 Jun 2013 11:20:30 +0200 Subject: [PATCH 4/4] transports: improve captions --- .../locale/fr/LC_MESSAGES/django.po | 31 ++++++++++++------- portail_citoyen_announces/transports.py | 6 ++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/portail_citoyen_announces/locale/fr/LC_MESSAGES/django.po b/portail_citoyen_announces/locale/fr/LC_MESSAGES/django.po index 1155442..7c9271c 100644 --- a/portail_citoyen_announces/locale/fr/LC_MESSAGES/django.po +++ b/portail_citoyen_announces/locale/fr/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: portail-citoyen-announces 0.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-04-23 22:31+0200\n" -"PO-Revision-Date: 2013-06-04 16:48+0200\n" +"POT-Creation-Date: 2013-06-24 11:20+0200\n" +"PO-Revision-Date: 2013-06-24 11:20+0200\n" "Last-Translator: Benjamin Dauvergne \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -16,15 +16,15 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: admin.py:21 +#: admin.py:22 msgid "Send by {0}" msgstr "Envoyé via {0}" -#: admin.py:56 +#: admin.py:59 msgid "extract" msgstr "extrait" -#: admin.py:60 models.py:75 +#: admin.py:63 models.py:75 msgid "sent" msgstr "envoyé via" @@ -122,15 +122,19 @@ msgstr "ex.: courriel, numéro de téléphone mobile, identifiant jabber" msgid "subscription" msgstr "abonnement" -#: transports.py:70 -msgid "homepage" -msgstr "page d'accueil" +#: transports.py:81 +msgid "Homepage" +msgstr "Page d'accueil" -#: transports.py:91 -msgid "email" -msgstr "courriel" +#: transports.py:93 +msgid "SMS" +msgstr "" -#: templates/portail_citoyen_announces/announce_list.html:12 +#: transports.py:176 +msgid "Email" +msgstr "Courriel" + +#: templates/portail_citoyen_announces/announce_list.html:13 msgid "Subscriptions" msgstr "Abonnements" @@ -143,3 +147,6 @@ msgstr "Catégorie" #: templates/portail_citoyen_announces/subscription_edit.html:31 msgid "Modify" msgstr "Modifier" + +#~ msgid "sms" +#~ msgstr "SMS" diff --git a/portail_citoyen_announces/transports.py b/portail_citoyen_announces/transports.py index db53702..e27cbfc 100644 --- a/portail_citoyen_announces/transports.py +++ b/portail_citoyen_announces/transports.py @@ -78,7 +78,7 @@ class HomepageTransport(object): identifier = 'homepage' def get_choices(self): - return (('homepage', _('homepage')),) + return (('homepage', _('Homepage')),) class SMSTransport(object): @@ -90,7 +90,7 @@ class SMSTransport(object): ] mobile_re = re.compile('^0[67][0-9]{8}$') - def __init__(self, url, from_mobile, login=None, password=None, identifier='sms', name=_('sms')): + def __init__(self, url, from_mobile, login=None, password=None, identifier='sms', name=_('SMS')): self.url = url self.from_mobile = from_mobile self.login = login @@ -173,7 +173,7 @@ class EmailTransport(object): ] def get_choices(self): - return (('email', _('email')),) + return (('email', _('Email')),) def get_subscriptions(self, category): return models.Subscription.objects.filter(category=category,
{% trans "Category" %}{{ choice_name }}{{ choice_name }}
{{ field.label }}{{ field.label }}{{ subwidget.tag }}