fix: the untildate field is not mandatory!

This commit is contained in:
tonio
2010-07-27 15:51:45 +02:00
parent 9888be1ba9
commit 5239bc2da9
10 changed files with 103 additions and 64 deletions
+28
View File
@@ -46,6 +46,34 @@ First, decompress the new tarball at the same location than your
current installation. Then, check if the new version you're installing current installation. Then, check if the new version you're installing
requires a migration:: requires a migration::
0.8 -> 0.8.1 : project renamed.
* First, rename your mailng folder to modoboa and copy all the
content from modoboa-0.8.1 to modoboa.
* Edit your settings.py and replace all occurences of mailng by
modoboa. Make sure you don't modify the DATABASE section as you're
not going to rename your database.
* Rename the MAILNG_DIR variable to MODOBOA_DIR.
* Add 'django.contrib.messages.middleware.MessageMiddleware' to
MIDDLEWARE_CLASSES and 'django.contrib.messages' to
INSTALLED_APPS. Save your modifications.
* Run the following command::
# python manage.py syncdb
* For all activated extensions, run the following command::
# export PYTHONPATH=<modoboa_dir>/..
# DJANGO_SETTINGS_MODULE=modoboa.settings \
<modoboa_dir>/scripts/extension.py <extension> on
* Update your webserver configuration and restart it.
0.7 -> 0.8 : SQL migration needed. 0.7 -> 0.8 : SQL migration needed.
Before you start migration, make sure you have updated your Before you start migration, make sure you have updated your
+7 -3
View File
@@ -4,9 +4,12 @@ from django.utils.translation import ugettext as _
import datetime import datetime
class ARmessageForm(forms.ModelForm): class ARmessageForm(forms.ModelForm):
untildate = forms.DateField(label=_('Until'), required=False,
help_text=_("Activate your auto reply until this date"))
class Meta: class Meta:
model = ARmessage model = ARmessage
fields = ('subject', 'content', 'enabled', 'untildate') fields = ('subject', 'content', 'enabled')
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ARmessageForm, self).__init__(*args, **kwargs) super(ARmessageForm, self).__init__(*args, **kwargs)
@@ -14,6 +17,7 @@ class ARmessageForm(forms.ModelForm):
self.fields['content'].widget.attrs['cols'] = 50 self.fields['content'].widget.attrs['cols'] = 50
def clean_untildate(self): def clean_untildate(self):
if self.cleaned_data["untildate"] < datetime.date.today(): if self.cleaned_data["untildate"] is not None:
raise forms.ValidationError(_("This date is over")) if self.cleaned_data["untildate"] < datetime.date.today():
raise forms.ValidationError(_("This date is over"))
return self.cleaned_data['untildate'] return self.cleaned_data['untildate']
+1 -1
View File
@@ -55,7 +55,7 @@ def menu(**kwargs):
"url" : reverse(views.autoreply), "url" : reverse(views.autoreply),
"img" : "/static/pics/auto-reply.png", "img" : "/static/pics/auto-reply.png",
"class" : "boxed", "class" : "boxed",
"rel" : "{handler:'iframe',size:{x:440,y:370}}", "rel" : "{handler:'iframe',size:{x:440,y:400}}",
"label" : _("Auto-reply message")} "label" : _("Auto-reply message")}
] ]
+1 -2
View File
@@ -18,8 +18,7 @@ class ARmessage(models.Model):
help_text=_("The content that will appear in sended emails")) help_text=_("The content that will appear in sended emails"))
enabled = models.BooleanField(_('enabled'), enabled = models.BooleanField(_('enabled'),
help_text=_("Activate/Deactivate your auto reply")) help_text=_("Activate/Deactivate your auto reply"))
untildate = models.DateField(_('until'), untildate = models.DateField()
help_text=_("Activate your auto reply until this date"))
class ARhistoric(models.Model): class ARhistoric(models.Model):
armessage = models.ForeignKey(ARmessage) armessage = models.ForeignKey(ARmessage)
+2
View File
@@ -29,6 +29,7 @@ def autoreply(request):
from modoboa import userprefs from modoboa import userprefs
arm = form.save(commit=False) arm = form.save(commit=False)
arm.untildate = form.cleaned_data["untildate"]
arm.mbox = mb arm.mbox = mb
arm.save() arm.save()
messages.info(request, _("Auto reply message updated successfully."), messages.info(request, _("Auto reply message updated successfully."),
@@ -42,6 +43,7 @@ def autoreply(request):
mimetype="application/json") mimetype="application/json")
form = ARmessageForm(instance=arm) form = ARmessageForm(instance=arm)
form.fields['untildate'].initial = arm.untildate
return _render(request, "postfix_autoreply/autoreply.html", { return _render(request, "postfix_autoreply/autoreply.html", {
"form" : form "form" : form
}) })
+1 -1
View File
@@ -43,7 +43,7 @@ def display_messages(msgs):
<script type="text/javascript"> <script type="text/javascript">
window.addEvent("domready", function() { window.addEvent("domready", function() {
infobox.%s("%s"); infobox.%s("%s");
infobox.hide(3); infobox.hide(2);
}); });
</script> </script>
""" % (level, text) """ % (level, text)
+25 -25
View File
@@ -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: 2010-07-23 16:23+0200\n" "POT-Creation-Date: 2010-07-27 15:29+0200\n"
"PO-Revision-Date: 2010-07-25 21:39+0200\n" "PO-Revision-Date: 2010-07-25 21:39+0200\n"
"Last-Translator: Patrick Ben Koetter <p@state-of-mind.de>\n" "Last-Translator: Patrick Ben Koetter <p@state-of-mind.de>\n"
"Language-Team: DE <p@state-of-mind.de>\n" "Language-Team: DE <p@state-of-mind.de>\n"
@@ -170,45 +170,45 @@ msgstr "Mailbox auf den dieser Alias verweist"
msgid "Check to activate this alias" msgid "Check to activate this alias"
msgstr "Auswählen um den Alias zu aktivieren" msgstr "Auswählen um den Alias zu aktivieren"
#: admin/views.py:27 #: admin/views.py:29
msgid "Permission denied." msgid "Permission denied."
msgstr "Zugriff verweigert." msgstr "Zugriff verweigert."
#: admin/views.py:73 admin/views.py:103 #: admin/views.py:75 admin/views.py:105
msgid "Domain with this name already defined" msgid "Domain with this name already defined"
msgstr "Es existiert bereits eine Domain mit diesem Namen" msgstr "Es existiert bereits eine Domain mit diesem Namen"
#: admin/views.py:82 #: admin/views.py:84
msgid "Failed to initialise domain, check permissions" msgid "Failed to initialise domain, check permissions"
msgstr "" msgstr ""
"Domäne konnte nicht initialisiert werden. Prüfen Sie die Berechtigungen." "Domäne konnte nicht initialisiert werden. Prüfen Sie die Berechtigungen."
#: admin/views.py:106 #: admin/views.py:108
msgid "Failed to rename domain, check permissions" msgid "Failed to rename domain, check permissions"
msgstr "Domäne konnte nicht umbenannt werden. Prüfen Sie die Berechtigungen." msgstr "Domäne konnte nicht umbenannt werden. Prüfen Sie die Berechtigungen."
#: admin/views.py:160 admin/views.py:222 #: admin/views.py:162 admin/views.py:225
msgid "Mailbox with this address already exists" msgid "Mailbox with this address already exists"
msgstr "Eine Mailbox mit diesem Namen existiert bereits." msgstr "Eine Mailbox mit diesem Namen existiert bereits."
#: admin/views.py:194 #: admin/views.py:196
msgid "Mailbox created." msgid "Mailbox created."
msgstr "Mailbox erstellt." msgstr "Mailbox erstellt."
#: admin/views.py:198 #: admin/views.py:201
msgid "Failed to initialise mailbox, check permissions" msgid "Failed to initialise mailbox, check permissions"
msgstr "" msgstr ""
"Mailbox konnte nicht initialisiert werden. Prüfen Sie die Berechtigungen." "Mailbox konnte nicht initialisiert werden. Prüfen Sie die Berechtigungen."
#: admin/views.py:225 #: admin/views.py:228
msgid "Failed to rename mailbox, check permissions" msgid "Failed to rename mailbox, check permissions"
msgstr "Mailbox konnte nicht umbenannt werden. Prüfen Sie die Berechtigungen." msgstr "Mailbox konnte nicht umbenannt werden. Prüfen Sie die Berechtigungen."
#: admin/views.py:296 admin/views.py:326 #: admin/views.py:299 admin/views.py:329
msgid "Alias with this name already exists" msgid "Alias with this name already exists"
msgstr "Ein Alias mit dieser Adresse existiert bereits" msgstr "Ein Alias mit dieser Adresse existiert bereits"
#: admin/views.py:401 #: admin/views.py:404
msgid "admin is intouchable!!" msgid "admin is intouchable!!"
msgstr "admin ist unantastbar!!" msgstr "admin ist unantastbar!!"
@@ -435,7 +435,15 @@ msgstr "Nachrichten-Header"
msgid "Bad MIME" msgid "Bad MIME"
msgstr "Schlechtes MIME" msgstr "Schlechtes MIME"
#: extensions/postfix_autoreply/forms.py:18 #: extensions/postfix_autoreply/forms.py:7
msgid "Until"
msgstr "Bis"
#: extensions/postfix_autoreply/forms.py:8
msgid "Activate your auto reply until this date"
msgstr "Aktivieren Sie ihre automatisierte Antwort bis zu diesem Datum"
#: extensions/postfix_autoreply/forms.py:22
msgid "This date is over" msgid "This date is over"
msgstr "Das Datum ist vorbei" msgstr "Das Datum ist vorbei"
@@ -470,14 +478,6 @@ msgstr "Der Inhalt, der in den versendeten Nachrichten verwendet wird"
msgid "Activate/Deactivate your auto reply" msgid "Activate/Deactivate your auto reply"
msgstr "Aktivieren/Deaktivieren Sie die automatisierte Antwort" msgstr "Aktivieren/Deaktivieren Sie die automatisierte Antwort"
#: extensions/postfix_autoreply/models.py:21
msgid "until"
msgstr "bis"
#: extensions/postfix_autoreply/models.py:22
msgid "Activate your auto reply until this date"
msgstr "Aktivieren Sie ihre automatisierte Antwort bis zu diesem Datum"
#: extensions/postfix_autoreply/views.py:34 #: extensions/postfix_autoreply/views.py:34
msgid "Auto reply message updated successfully." msgid "Auto reply message updated successfully."
msgstr "Automatische Antwort erfolgreich aktualisiert." msgstr "Automatische Antwort erfolgreich aktualisiert."
@@ -681,7 +681,7 @@ msgstr "Benutzerdefinierte Signatur der E-Mail"
msgid "Simple IMAP webmail" msgid "Simple IMAP webmail"
msgstr "Einfaches IMAP-Webmail" msgstr "Einfaches IMAP-Webmail"
#: extensions/webmail/main.py:67 extensions/webmail/templates/index.html:309 #: extensions/webmail/main.py:67 extensions/webmail/templates/index.html:313
msgid "Webmail" msgid "Webmail"
msgstr "Webmail" msgstr "Webmail"
@@ -705,15 +705,15 @@ msgstr "Ordner"
msgid "Attachments" msgid "Attachments"
msgstr "Dateianhänge" msgstr "Dateianhänge"
#: extensions/webmail/templates/index.html:120 #: extensions/webmail/templates/index.html:125
msgid "Reloading..." msgid "Reloading..."
msgstr "Aktualisiere..." msgstr "Aktualisiere..."
#: extensions/webmail/templates/index.html:127 #: extensions/webmail/templates/index.html:132
msgid "Done" msgid "Done"
msgstr "Abgeschlossen" msgstr "Abgeschlossen"
#: extensions/webmail/templates/index.html:315 #: extensions/webmail/templates/index.html:319
msgid "Mailbox quota" msgid "Mailbox quota"
msgstr "Mailbox Quota" msgstr "Mailbox Quota"
@@ -958,7 +958,7 @@ msgstr "Passwort ändern"
msgid "Do not delete mailbox directory" msgid "Do not delete mailbox directory"
msgstr "Mailbox-Verzeichnis nicht löschen" msgstr "Mailbox-Verzeichnis nicht löschen"
#: templates/userprefs/preferences.html:7 #: templates/userprefs/preferences.html:6
#: userprefs/templatetags/uprefs_extras.py:26 #: userprefs/templatetags/uprefs_extras.py:26
msgid "Preferences" msgid "Preferences"
msgstr "Einstellungen" msgstr "Einstellungen"
+27 -27
View File
@@ -1,17 +1,17 @@
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # Antoine Nguyen <tonio@ngyn.org>, 2010.
# #
#, fuzzy #, fuzzy
msgid "" 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: 2010-07-23 16:23+0200\n" "POT-Creation-Date: 2010-07-27 15:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Antoine Nguyen <tonio@ngyn.org>\n" "Last-Translator: Antoine Nguyen <tonio@ngyn.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: Antoine Nguyen <tonio@ngyn.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"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"
@@ -173,44 +173,44 @@ msgstr "Les boites aux lettres sur lesquelles pointe cet alias"
msgid "Check to activate this alias" msgid "Check to activate this alias"
msgstr "Cocher pour activer cet alias" msgstr "Cocher pour activer cet alias"
#: admin/views.py:27 #: admin/views.py:29
msgid "Permission denied." msgid "Permission denied."
msgstr "Permission refusée." msgstr "Permission refusée."
#: admin/views.py:73 admin/views.py:103 #: admin/views.py:75 admin/views.py:105
msgid "Domain with this name already defined" msgid "Domain with this name already defined"
msgstr "Un domaine avec ce nom existe déjà" msgstr "Un domaine avec ce nom existe déjà"
#: admin/views.py:82 #: admin/views.py:84
msgid "Failed to initialise domain, check permissions" msgid "Failed to initialise domain, check permissions"
msgstr "Impossible d'initialiser le domaine, vérifier les permissions" msgstr "Impossible d'initialiser le domaine, vérifier les permissions"
#: admin/views.py:106 #: admin/views.py:108
msgid "Failed to rename domain, check permissions" msgid "Failed to rename domain, check permissions"
msgstr "Impossible de renommer le domaine, vérifier les permissions" msgstr "Impossible de renommer le domaine, vérifier les permissions"
#: admin/views.py:160 admin/views.py:222 #: admin/views.py:162 admin/views.py:225
msgid "Mailbox with this address already exists" msgid "Mailbox with this address already exists"
msgstr "Une boite aux lettres pour cette adresse existe déjà" msgstr "Une boite aux lettres pour cette adresse existe déjà"
#: admin/views.py:194 #: admin/views.py:196
msgid "Mailbox created." msgid "Mailbox created."
msgstr "Boite aux lettres créé." msgstr "Boite aux lettres créé."
#: admin/views.py:198 #: admin/views.py:201
msgid "Failed to initialise mailbox, check permissions" msgid "Failed to initialise mailbox, check permissions"
msgstr "" msgstr ""
"Impossible d'initialiser la boite aux lettres, vérifier les permissions" "Impossible d'initialiser la boite aux lettres, vérifier les permissions"
#: admin/views.py:225 #: admin/views.py:228
msgid "Failed to rename mailbox, check permissions" msgid "Failed to rename mailbox, check permissions"
msgstr "Impossible de renommer la boite aux lettres, vérifier les permissions." msgstr "Impossible de renommer la boite aux lettres, vérifier les permissions."
#: admin/views.py:296 admin/views.py:326 #: admin/views.py:299 admin/views.py:329
msgid "Alias with this name already exists" msgid "Alias with this name already exists"
msgstr "Un alias avec ce nom existe déjà" msgstr "Un alias avec ce nom existe déjà"
#: admin/views.py:401 #: admin/views.py:404
msgid "admin is intouchable!!" msgid "admin is intouchable!!"
msgstr "admin est intouchable!!" msgstr "admin est intouchable!!"
@@ -435,7 +435,15 @@ msgstr "Mauvais entête"
msgid "Bad MIME" msgid "Bad MIME"
msgstr "Mauvais type MIME" msgstr "Mauvais type MIME"
#: extensions/postfix_autoreply/forms.py:18 #: extensions/postfix_autoreply/forms.py:7
msgid "Until"
msgstr "Jusqu'à"
#: extensions/postfix_autoreply/forms.py:8
msgid "Activate your auto reply until this date"
msgstr "Activer votre réponse automatique jusqu'à cette date"
#: extensions/postfix_autoreply/forms.py:22
msgid "This date is over" msgid "This date is over"
msgstr "Cette date est dépassée" msgstr "Cette date est dépassée"
@@ -470,14 +478,6 @@ msgstr "Le contenu qui apparaitra dans les emails envoyés"
msgid "Activate/Deactivate your auto reply" msgid "Activate/Deactivate your auto reply"
msgstr "Activer/Désactiver votre réponse automatique" msgstr "Activer/Désactiver votre réponse automatique"
#: extensions/postfix_autoreply/models.py:21
msgid "until"
msgstr "jusqu'à"
#: extensions/postfix_autoreply/models.py:22
msgid "Activate your auto reply until this date"
msgstr "Activer votre réponse automatique jusqu'à cette date"
#: extensions/postfix_autoreply/views.py:34 #: extensions/postfix_autoreply/views.py:34
msgid "Auto reply message updated successfully." msgid "Auto reply message updated successfully."
msgstr "Message de réponse auto. mis à jour." msgstr "Message de réponse auto. mis à jour."
@@ -680,7 +680,7 @@ msgstr ""
msgid "Simple IMAP webmail" msgid "Simple IMAP webmail"
msgstr "" msgstr ""
#: extensions/webmail/main.py:67 extensions/webmail/templates/index.html:309 #: extensions/webmail/main.py:67 extensions/webmail/templates/index.html:313
msgid "Webmail" msgid "Webmail"
msgstr "" msgstr ""
@@ -704,15 +704,15 @@ msgstr "Dossiers"
msgid "Attachments" msgid "Attachments"
msgstr "Pièces jointes" msgstr "Pièces jointes"
#: extensions/webmail/templates/index.html:120 #: extensions/webmail/templates/index.html:125
msgid "Reloading..." msgid "Reloading..."
msgstr "Rechargement..." msgstr "Rechargement..."
#: extensions/webmail/templates/index.html:127 #: extensions/webmail/templates/index.html:132
msgid "Done" msgid "Done"
msgstr "Effectué" msgstr "Effectué"
#: extensions/webmail/templates/index.html:315 #: extensions/webmail/templates/index.html:319
msgid "Mailbox quota" msgid "Mailbox quota"
msgstr "Quota de la boite aux lettres" msgstr "Quota de la boite aux lettres"
@@ -957,7 +957,7 @@ msgstr "Changer de mot de passe"
msgid "Do not delete mailbox directory" msgid "Do not delete mailbox directory"
msgstr "Ne pas supprimer le répertoire de la boite aux lettres" msgstr "Ne pas supprimer le répertoire de la boite aux lettres"
#: templates/userprefs/preferences.html:7 #: templates/userprefs/preferences.html:6
#: userprefs/templatetags/uprefs_extras.py:26 #: userprefs/templatetags/uprefs_extras.py:26
msgid "Preferences" msgid "Preferences"
msgstr "Préférences" msgstr "Préférences"
+9 -3
View File
@@ -1,6 +1,6 @@
body { body {
font-family: arial, helvetica, verdana, tahoma, sans-serif; font-family: arial, helvetica, verdana, tahoma, sans-serif;
font-size: small; font-size: 0.9em;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
} }
@@ -14,14 +14,12 @@ div.row {
div.row label { div.row label {
float: left; float: left;
width: 120px; width: 120px;
font-size: small;
padding: 3px 0; padding: 3px 0;
} }
input { input {
border: 1px solid #cccccc; border: 1px solid #cccccc;
color: inherit; color: inherit;
/*background-color: #e9e9e9;*/
background-color: #eee; background-color: #eee;
padding: 2px; padding: 2px;
} }
@@ -35,6 +33,14 @@ input:hover {
background-color: #ffffcc; background-color: #ffffcc;
} }
textarea {
border: 1px solid #cccccc;
background-color: #eee;
width: 300px;
font-family: inherit;
font-size: inherit;
}
select { select {
width: 135px; width: 135px;
background-color: #eee; background-color: #eee;
+2 -2
View File
@@ -24,8 +24,8 @@ button.calendar{
padding:0px; padding:0px;
margin-right:3px; margin-right:3px;
cursor:pointer; cursor:pointer;
width:16px; width:20px;
height:16px; height:20px;
} }
input.calendar{ input.calendar{
cursor:pointer; cursor:pointer;