Skip to content

Commit

Permalink
Tasks and commas now get along well
Browse files Browse the repository at this point in the history
  • Loading branch information
agubelu committed Apr 24, 2017
1 parent dd1a394 commit 7ef06d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Metronus-Project/metronus/templates/task_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@

});
};

$(function() {
$(':input[type="number"]').each(function(i) {
$(this).val($(this).attr("value").replace(",", "."));
});
});

</script>
{% endblock %}

Expand Down Expand Up @@ -194,7 +201,7 @@ <h2>{% if request.path == '/task/create'%}{% trans 'createTask' %}{% endif %}{%
<div class="form-group" >
<label class="control-label col-sm-4" for="id_{{ form.production_goal.name }}">{% trans 'production_goal' %}</label>
<div class="col-sm-6">
<input type="text" class="form-control col-md-6" name="{{ form.production_goal.name }}" id="id_{{ form.production_goal.name }}" value="{{ form.production_goal.value }}">
<input type="number" min="0" step="1" class="form-control col-md-6" name="{{ form.production_goal.name }}" id="id_{{ form.production_goal.name }}" value="{{ form.production_goal.value }}">
</div>
</div>

Expand All @@ -207,13 +214,13 @@ <h2>{% if request.path == '/task/create'%}{% trans 'createTask' %}{% endif %}{%
<div class="form-group" >
<label class="control-label col-sm-4" for="id_{{ form.price_per_unit.name }}">{% trans 'price_per_unit' %}</label>
<div class="col-sm-6">
<input type="text" class="form-control col-md-6" name="{{ form.price_per_unit.name }}" id="id_{{ form.price_per_unit.name }}" value="{{ form.price_per_unit.value }}">
<input type="number" min="0" step="1" class="form-control col-md-6" name="{{ form.price_per_unit.name }}" id="id_{{ form.price_per_unit.name }}" value="{{ form.price_per_unit.value }}">
</div>
</div>
<div class="form-group" >
<label class="control-label col-sm-4" for="id_{{ form.price_per_hour.name }}">{% trans 'price_per_hour' %}</label>
<div class="col-sm-6">
<input type="text" class="form-control col-md-6" name="{{ form.price_per_hour.name }}" id="id_{{ form.price_per_hour.name }}" value="{{ form.price_per_hour.value }}">
<input type="number" min="0" step="1" class="form-control col-md-6" name="{{ form.price_per_hour.name }}" id="id_{{ form.price_per_hour.name }}" value="{{ form.price_per_hour.value }}">
</div>
</div>
<!--this is the hidden input for task id, do not remove!!! -->
Expand Down

0 comments on commit 7ef06d6

Please sign in to comment.