mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-21 06:18:45 +02:00
Ticket #8
Mootools calendar plugin update. We are now using the rc4 version (http://www.electricprism.com/aeron/calendar/).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from models import ARmessage
|
||||
from django.utils.translation import ugettext as _
|
||||
import datetime
|
||||
|
||||
class ARmessageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -11,3 +12,8 @@ class ARmessageForm(forms.ModelForm):
|
||||
super(ARmessageForm, self).__init__(*args, **kwargs)
|
||||
self.fields['subject'].widget.attrs['size'] = 40
|
||||
self.fields['content'].widget.attrs['cols'] = 50
|
||||
|
||||
def clean_untildate(self):
|
||||
if self.cleaned_data["untildate"] < datetime.date.today():
|
||||
raise forms.ValidationError(_("This date is over"))
|
||||
return self.cleaned_data['untildate']
|
||||
|
||||
@@ -12,10 +12,14 @@ class Alias(models.Model):
|
||||
|
||||
class ARmessage(models.Model):
|
||||
mbox = models.ForeignKey(Mailbox)
|
||||
subject = models.CharField(_('subject'), max_length=255)
|
||||
content = models.TextField(_('content'))
|
||||
enabled = models.BooleanField(_('enabled'))
|
||||
untildate = models.DateTimeField(_('until'))
|
||||
subject = models.CharField(_('subject'), max_length=255,
|
||||
help_text=_("The subject that will appear in sended emails"))
|
||||
content = models.TextField(_('content'),
|
||||
help_text=_("The content that will appear in sended emails"))
|
||||
enabled = models.BooleanField(_('enabled'),
|
||||
help_text=_("Activate/Deactivate your auto reply"))
|
||||
untildate = models.DateField(_('until'),
|
||||
help_text=_("Activate your auto reply until this date"))
|
||||
|
||||
class ARhistoric(models.Model):
|
||||
armessage = models.ForeignKey(ARmessage)
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<!--<link rel="stylesheet" type="text/css"
|
||||
href="/static/stylesheets/datepicker/vista.css" />
|
||||
<script src="/static/js/datepicker.js" type="text/javascript"></script>-->
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="/static/stylesheets/calendar.css" />
|
||||
<script type="text/javascript" src="/static/js/calendar.js"></script>
|
||||
@@ -18,7 +15,7 @@
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
window.addEvent("domready", function() {
|
||||
cal = new Calendar({id_untildate: "d/m/Y"});
|
||||
var cal = new Calendar({id_untildate: "Y-m-d"}, {tweak: {x: -100, y:-100}});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -149,7 +149,8 @@ def move(request):
|
||||
@is_not_localadmin()
|
||||
def delete(request, fdname, mail_id):
|
||||
mbc = IMAPconnector(user=request.user.username)
|
||||
mbc.move(mail_id, fdname, "Trash")
|
||||
mbc.move(mail_id, fdname, parameters.get_user(request.user, "webmail",
|
||||
"TRASH_FOLDER"))
|
||||
return folder(request, fdname, False)
|
||||
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user