Skip to content

Commit

Permalink
added date picker for daily charges. closes #206
Browse files Browse the repository at this point in the history
  • Loading branch information
jsayles committed Dec 14, 2016
1 parent 33df511 commit 84a50e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
7 changes: 0 additions & 7 deletions staff/templates/staff/activity_date.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

{% block sub-title %}Activity on {{ activity_date|date:"M d, Y" }} | {% endblock %}

{% block sub-head %}
<link rel="stylesheet" href="{% static 'css/jquery-ui.min.css' %}" />
<script src="{% static 'jquery-3.1.1.min.js' %}"></script>
<script src="{% static 'jquery-ui.min.js' %}"></script>
{% endblock %}

{% block style%}
nav #activity-tab { background: #FBD850; color: black; }
#content table { width: 100%; }
.log-note { width: 100px; }
#quick-links { text-align: right; margin-bottom: 20px;}

{% endblock %}

{% block content %}
Expand Down
19 changes: 18 additions & 1 deletion staff/templates/staff/charges.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ <h2>
Daily Charges - {{ date|date:"l, M dS" }}
<span style="float:right;">
<a href="{% url 'staff_charges' previous_date.year previous_date.month previous_date.day %}">&larr;</a>
<a href="{% url 'staff_charges_today' %}">&bull;</a>
<!-- <a href="{% url 'staff_charges_today' %}">&bull;</a> -->
<input type='date' name='date' class='datepicker' value="{{ date|date:'Y-m-d' }}" style='font-size:.6em; text-align:center; width:150px;'/>
<a href="{% url 'staff_charges' next_date.year next_date.month next_date.day %}">&rarr;</a>
</span>
</h2>
Expand Down Expand Up @@ -121,3 +122,19 @@ <h3>Other Transactions</h3>
{% endif %}

{% endblock %}

{% block extrajs %}
<script>
(function() {
$('.datepicker').datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function(ui, e) {
var date = ui.split('-');
var url = "{% url 'staff_charges' 2016 12 14 %}".replace(/14/, date[2]).replace(/12/, date[1]).replace(/2016/, date[0]);

window.location.href = url;
}
});
})();
</script>
{% endblock %}

0 comments on commit 84a50e9

Please sign in to comment.