* Auto-reply plugin fixed

* Added bootstrap-datepicker (https://github.com/eternicode/bootstrap-datepicker)

see #204
This commit is contained in:
Antoine Nguyen
2012-04-09 15:12:56 +02:00
parent 0aac55e399
commit 291ac057d2
12 changed files with 1040 additions and 1 deletions
+1 -1
View File
@@ -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,
+4
View File
@@ -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:
+3
View File
@@ -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)