Skip to content

Commit

Permalink
Merge 9207e2f into 36c5b7f
Browse files Browse the repository at this point in the history
  • Loading branch information
danhedron committed Jun 25, 2014
2 parents 36c5b7f + 9207e2f commit 7c35701
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
13 changes: 1 addition & 12 deletions templates/task/changetask.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,7 @@ <h1>Add or Edit Task</h1>
{% endblock %}

{% block content %}
<script type="text/javascript">
{% if user.triageuser.default_due_time %}
$(document).ready(function() {
$('.dateinput').change(function(){
if($(".timeinput").prop("value") == ""){
// Set the time if no already set to a value
$('.timeinput').val("{{ user.triageuser.default_due_time|date:"H:i" }}");
}
});
});
{% endif %}
</script>
{% include 'task/default_due_time_js.html' %}
<form method="post">
{% csrf_token %}
<input type="hidden" name="next" value="{{next}}" />
Expand Down
1 change: 1 addition & 0 deletions templates/task/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% endblock %}

{% block content %}
{% include 'task/default_due_time_js.html' %}
<script type="text/javascript">
function humanize(timestamp){
return moment(timestamp).fromNow();
Expand Down
12 changes: 12 additions & 0 deletions templates/task/default_due_time_js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script type="text/javascript">
{% if user.triageuser.default_due_time %}
$(document).ready(function() {
$('.timeinput').focus(function(){
if($(".timeinput").prop("value") == ""){
// Set the time if no already set to a value
$('.timeinput').val("{{ user.triageuser.default_due_time|date:"H:i" }}");
}
});
});
{% endif %}
</script>
3 changes: 2 additions & 1 deletion templates/task/housekeeping.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1>Housekeeping</h1>
});
});
</script>
{% include 'task/default_due_time_js.html' %}

<div class="row">
<div id="housekeeper" class="col-md-6">
Expand Down Expand Up @@ -127,7 +128,7 @@ <h3>{{ task.name }}</h3>
{% csrf_token %}
<input type="hidden" name="form_type" value="quick-duedate" />
<div class="input-group">
<input class="dateinput form-control" data_input="YYYY-MM-DD" id="id_due_date_0" name="due_date_0" type="date">
<input class="dateinput form-control" data_input="YYYY-MM-DD" id="id_due_date_0" name="due_date_0" type="date" value="{% now "Y-m-d" %}">
<input class="timeinput form-control" id="id_due_date_1" name="due_date_1" type="time"><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
<button type="submit" class="btn btn-warning btn-block">Reschedule</button>
Expand Down

0 comments on commit 7c35701

Please sign in to comment.