refactor: split out relationship form

This commit is contained in:
James Graham
2022-03-31 19:01:03 +01:00
parent c50bdca3eb
commit 9a90b1a432
3 changed files with 23 additions and 42 deletions

View File

@@ -0,0 +1,21 @@
{% with config.RELATIONSHIP_FORM_HELP as help_text %}
{% if help_text %}
<div class="alert alert-info mt-3 pb-0">
{{ help_text|linebreaks }}
</div>
{% endif %}
{% endwith %}
<hr>
<form class="form"
method="POST">
{% csrf_token %}
{% load bootstrap4 %}
{% bootstrap_form form %}
{% buttons %}
<button class="btn btn-success" type="submit">Submit</button>
{% endbuttons %}
</form>

View File

@@ -15,26 +15,6 @@
<h1>Add Relationship</h1> <h1>Add Relationship</h1>
{% with config.RELATIONSHIP_FORM_HELP as help_text %} {% include 'people/includes/relationship_form.html' %}
{% if help_text %}
<div class="alert alert-info mt-3 pb-0">
{{ help_text|linebreaks }}
</div>
{% endif %}
{% endwith %}
<hr>
<form class="form"
method="POST">
{% csrf_token %}
{% load bootstrap4 %}
{% bootstrap_form form %}
{% buttons %}
<button class="btn btn-success" type="submit">Submit</button>
{% endbuttons %}
</form>
{% endblock %} {% endblock %}

View File

@@ -18,27 +18,7 @@
<h1>Update Relationship</h1> <h1>Update Relationship</h1>
{% with config.RELATIONSHIP_FORM_HELP as help_text %} {% include 'people/includes/relationship_form.html' %}
{% if help_text %}
<div class="alert alert-info mt-3 pb-0">
{{ help_text|linebreaks }}
</div>
{% endif %}
{% endwith %}
<hr>
<form class="form"
method="POST">
{% csrf_token %}
{% load bootstrap4 %}
{% bootstrap_form form %}
{% buttons %}
<button class="btn btn-success" type="submit">Submit</button>
{% endbuttons %}
</form>
{% endblock %} {% endblock %}