Skip to content

Commit

Permalink
Setup Crispy Forms to tidy up refractometer calc
Browse files Browse the repository at this point in the history
  • Loading branch information
apaxson committed Aug 17, 2021
1 parent 87a1cf0 commit 9d02251
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django>=3.0
django_measurement>=3.2
django_crispy_forms>=1.12
16 changes: 5 additions & 11 deletions templates/util.refractometer.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
{% extends 'base.html' %}
{% block content %}
{% include 'topbar.html' %}
{% load crispy_forms_tags %}

<div class="container-fluid">
<div class="row">
<div class="col">
<form method="POST" class="post-form">
<form method="POST" class="post-form form-group">
{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="save btn btn-default">Save</button>
{{ form|crispy }}
<button type="submit" class="save btn btn-default">Calculate</button>
</form>
</div
</div>
<div class="row">
<div class="col">
<div style="font-size: 140%">
SG: {{ sg }}
ABV: {{ abv }}%
</div>
</div>
</div>
</div>
{% endblock %}

0 comments on commit 9d02251

Please sign in to comment.