mirror of
https://github.com/status-im/cabot.git
synced 2025-02-24 10:28:06 +00:00
Calendar icon, initial values for date fields.
This commit is contained in:
parent
5a4b194689
commit
ab12979bb6
@ -1,5 +1,6 @@
|
||||
from django.template import RequestContext, loader
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, date
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.conf import settings
|
||||
@ -397,7 +398,13 @@ class ServiceDetailView(LoginRequiredMixin, DetailView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ServiceDetailView, self).get_context_data(**kwargs)
|
||||
context['report_form'] = StatusCheckReportForm(initial={'checks': self.object.status_checks.all(), 'service': self.object})
|
||||
date_from = date.today() - relativedelta(day=1)
|
||||
context['report_form'] = StatusCheckReportForm(initial={
|
||||
'checks': self.object.status_checks.all(),
|
||||
'service': self.object,
|
||||
'date_from': date_from,
|
||||
'date_to': date_from + relativedelta(months=1) - relativedelta(days=1)
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
|
@ -200,7 +200,12 @@ drawRickshaw = (data, labels, events = []) ->
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(':input.datepicker').datepicker({dateFormat: 'yy-mm-dd'});
|
||||
$(':input.datepicker').datepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
buttonImage: '{{ STATIC_URL }}theme/img/calendar.gif',
|
||||
buttonImageOnly: true,
|
||||
showOn: 'button'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
@ -29,4 +29,5 @@ redis==2.9.0
|
||||
requests==0.14.2
|
||||
six==1.5.1
|
||||
twilio==3.4.1
|
||||
wsgiref==0.1.2
|
||||
wsgiref==0.1.2
|
||||
python-dateutil==2.1
|
||||
|
BIN
static/theme/img/calendar.gif
Normal file
BIN
static/theme/img/calendar.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 B |
Loading…
x
Reference in New Issue
Block a user