mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
* Auto-reply plugin fixed
* Added bootstrap-datepicker (https://github.com/eternicode/bootstrap-datepicker) see #204
This commit is contained in:
@@ -118,7 +118,7 @@ def onModifyMailbox(mailbox, oldmailbox):
|
||||
def get_static_content():
|
||||
return """<script type="text/javascript">
|
||||
function arform_cb() {
|
||||
$('#id_untildate').datepicker();
|
||||
$('#id_untildate').datepicker({format: 'yyyy-mm-dd'});
|
||||
$(".submit").one('click', function(e) {
|
||||
simple_ajax_form_post(e, {
|
||||
error_cb: arform_cb,
|
||||
|
||||
@@ -12,6 +12,10 @@ class ARmessageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = ARmessage
|
||||
fields = ('subject', 'content', 'enabled')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ARmessageForm, self).__init__(*args, **kwargs)
|
||||
self.fields.keyOrder = ['subject', 'content', 'untildate', 'enabled']
|
||||
|
||||
def clean_untildate(self):
|
||||
if self.cleaned_data["untildate"] is not None:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# coding: utf-8
|
||||
from datetime import date
|
||||
from django.http import HttpResponse
|
||||
from django.utils import simplejson
|
||||
from django.contrib.auth.decorators \
|
||||
@@ -47,5 +48,7 @@ def autoreply(request, tplname="common/generic_modal_form.html"):
|
||||
form = ARmessageForm(instance=arm)
|
||||
if arm is not None:
|
||||
form.fields['untildate'].initial = arm.untildate
|
||||
else:
|
||||
form.fields['untildate'].initial = date.today()
|
||||
ctx.update(form=form)
|
||||
return _render(request, tplname, ctx)
|
||||
|
||||
Reference in New Issue
Block a user