|
| 1 | +{% load i18n %} |
| 2 | +{%load static %} |
| 3 | + |
| 4 | +<link rel="stylesheet" href="{% static 'cloudkitty/css/datepicker.css' %}"> |
| 5 | +<script src="{% static 'cloudkitty/js/datepicker.js' %}" type="text/javascript" charset="utf-8"></script> |
| 6 | + |
| 7 | +<form action="?" method="get" id="{{ datepicker_id }}" class="form-inline"> |
| 8 | + <h4>{% trans "Select a period of time to view data in:" %} |
| 9 | + <span class="small help-block">{% trans "The date should be in YYYY-MM-DD format." %}</span> |
| 10 | + </h4> |
| 11 | + <div class="datepicker form-group"> |
| 12 | + {% with datepicker_input=form.start datepicker_label="From" %} |
| 13 | + {% include 'project/reporting/_datepicker_reporting.html' %} |
| 14 | + {% endwith %} |
| 15 | + </div> |
| 16 | + <span class="datepicker-delimiter"> |
| 17 | + <span class="datepicker-delimiter-text">{% trans 'to' %}</span> |
| 18 | + </span> |
| 19 | + <div class="datepicker form-group"> |
| 20 | + {% with datepicker_input=form.end datepicker_label="To" %} |
| 21 | + {% include 'project/reporting/_datepicker_reporting.html' %} |
| 22 | + {% endwith %} |
| 23 | + </div> |
| 24 | + <button class="btn btn-primary" type="submit">{% trans "Submit" %}</button> |
| 25 | +</form> |
| 26 | + |
| 27 | +<div class="controls-container"> |
| 28 | + <div class="dropdown default-ranges"> |
| 29 | + <button class="dropbtn">{% trans "Period Range" %}</button> |
| 30 | + <div class="dropdown-content"> |
| 31 | + <button data-period="day" data-view="current">{% trans "Day View" %}</button> |
| 32 | + <button data-period="week" data-view="current">{% trans "Week View" %}</button> |
| 33 | + <button data-period="month" data-view="current">{% trans "Month View" %}</button> |
| 34 | + <button data-period="year" data-view="current">{% trans "Year View" %}</button> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + <div class="dropdown preset-ranges"> |
| 38 | + <button class="dropbtn">{% trans "Preset Ranges" %}</button> |
| 39 | + <div class="dropdown-content"> |
| 40 | + <button data-period="day" data-view="yesterday">{% trans "Yesterday" %}</button> |
| 41 | + <button data-period="week" data-view="last">{% trans "Last Week" %}</button> |
| 42 | + <button data-period="month" data-view="last">{% trans "Last Month" %}</button> |
| 43 | + <button data-period="month" data-view="last" data-amount="3">{% trans "Last 3 Months" %}</button> |
| 44 | + <button data-period="month" data-view="last" data-amount="6">{% trans "Last 6 Months" %}</button> |
| 45 | + <button data-period="year" data-view="last">{% trans "Last Year" %}</button> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + <button class="arrow-btn" data-direction="prev">«</button> |
| 49 | + <button class="arrow-btn" data-direction="next">»</button> |
| 50 | +</div> |
| 51 | + |
| 52 | + |
| 53 | +<script> |
| 54 | + $(function () { |
| 55 | + initDatepicker({ |
| 56 | + formId: '{{ datepicker_id }}', |
| 57 | + startFieldName: '{{ form.start.name }}', |
| 58 | + endFieldName: '{{ form.end.name }}' |
| 59 | + }); |
| 60 | + }); |
| 61 | +</script> |
0 commit comments