Add a help_text to Weekmail edit form

This commit is contained in:
Skia 2017-03-12 18:13:04 +01:00
parent 73cbfd3e82
commit a56d3a3088
2 changed files with 22 additions and 15 deletions

View File

@ -9,6 +9,7 @@ from django.core.exceptions import ValidationError
from django.utils import timezone from django.utils import timezone
from django.conf import settings from django.conf import settings
from django.db.models import Max from django.db.models import Max
from django.forms.models import modelform_factory
from django import forms from django import forms
from datetime import timedelta from datetime import timedelta
@ -259,7 +260,8 @@ class WeekmailPreviewView(ComTabsMixin, CanEditPropMixin, DetailView):
class WeekmailEditView(ComTabsMixin, QuickNotifMixin, CanEditPropMixin, UpdateView): class WeekmailEditView(ComTabsMixin, QuickNotifMixin, CanEditPropMixin, UpdateView):
model = Weekmail model = Weekmail
template_name = 'com/weekmail.jinja' template_name = 'com/weekmail.jinja'
fields = ['title', 'intro', 'joke', 'protip', 'conclusion'] form_class = modelform_factory(Weekmail, fields=['title', 'intro', 'joke', 'protip', 'conclusion'],
help_texts={'title': _("Delete and save to regenerate")})
success_url = reverse_lazy('com:weekmail') success_url = reverse_lazy('com:weekmail')
current_tab = "weekmail" current_tab = "weekmail"

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-12 17:57+0100\n" "POT-Creation-Date: 2017-03-12 18:11+0100\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -1037,7 +1037,7 @@ msgstr "Vous n'avez pas la permission de faire cela"
msgid "Begin date" msgid "Begin date"
msgstr "Date de début" msgstr "Date de début"
#: club/views.py:170 com/views.py:98 counter/views.py:933 #: club/views.py:170 com/views.py:99 counter/views.py:933
#: election/views.py:131 #: election/views.py:131
msgid "End date" msgid "End date"
msgstr "Date de fin" msgstr "Date de fin"
@ -1267,7 +1267,7 @@ msgid "Coming soon... don't miss!"
msgstr "Prochainement... à ne pas rater!" msgstr "Prochainement... à ne pas rater!"
#: com/templates/com/weekmail.jinja:5 com/templates/com/weekmail.jinja.py:9 #: com/templates/com/weekmail.jinja:5 com/templates/com/weekmail.jinja.py:9
#: com/views.py:36 core/templates/core/user_tools.jinja:69 #: com/views.py:37 core/templates/core/user_tools.jinja:69
msgid "Weekmail" msgid "Weekmail"
msgstr "Weekmail" msgstr "Weekmail"
@ -1347,43 +1347,47 @@ msgstr "Astuce"
msgid "Final word" msgid "Final word"
msgstr "Le mot de la fin" msgstr "Le mot de la fin"
#: com/views.py:29 #: com/views.py:30
msgid "Communication administration" msgid "Communication administration"
msgstr "Administration de la communication" msgstr "Administration de la communication"
#: com/views.py:41 core/templates/core/user_tools.jinja:70 #: com/views.py:42 core/templates/core/user_tools.jinja:70
msgid "Weekmail destinations" msgid "Weekmail destinations"
msgstr "Destinataires du Weekmail" msgstr "Destinataires du Weekmail"
#: com/views.py:46 #: com/views.py:47
msgid "Index page" msgid "Index page"
msgstr "Page d'accueil" msgstr "Page d'accueil"
#: com/views.py:51 #: com/views.py:52
msgid "Info message" msgid "Info message"
msgstr "Message d'info" msgstr "Message d'info"
#: com/views.py:56 #: com/views.py:57
msgid "Alert message" msgid "Alert message"
msgstr "Message d'alerte" msgstr "Message d'alerte"
#: com/views.py:97 election/views.py:130 #: com/views.py:98 election/views.py:130
msgid "Start date" msgid "Start date"
msgstr "Date de début" msgstr "Date de début"
#: com/views.py:99 #: com/views.py:100
msgid "Until" msgid "Until"
msgstr "Jusqu'à" msgstr "Jusqu'à"
#: com/views.py:100 #: com/views.py:101
msgid "Automoderation" msgid "Automoderation"
msgstr "Automodération" msgstr "Automodération"
#: com/views.py:106 com/views.py:108 com/views.py:110 #: com/views.py:107 com/views.py:109 com/views.py:111
msgid "This field is required." msgid "This field is required."
msgstr "Ce champ est obligatoire." msgstr "Ce champ est obligatoire."
#: com/views.py:270 #: com/views.py:264
msgid "Delete and save to regenerate"
msgstr "Supprimer et sauver pour regénérer"
#: com/views.py:272
msgid "Weekmail of the " msgid "Weekmail of the "
msgstr "Weekmail du " msgstr "Weekmail du "
@ -1730,7 +1734,8 @@ msgid ""
"Enter a valid page name. This value may contain only unaccented letters, " "Enter a valid page name. This value may contain only unaccented letters, "
"numbers and ./+/-/_ characters." "numbers and ./+/-/_ characters."
msgstr "" msgstr ""
"Entrez un nom de page correct. Uniquement des lettres non accentuées, numéros, et ./+/-/_" "Entrez un nom de page correct. Uniquement des lettres non accentuées, "
"numéros, et ./+/-/_"
#: core/models.py:748 #: core/models.py:748
msgid "page name" msgid "page name"