2020-04-10 10:21:02 -04:00
|
|
|
{% extends 'base.html' %}
|
2016-05-09 14:11:53 -04:00
|
|
|
{% load form_helpers %}
|
2020-03-05 13:56:03 -05:00
|
|
|
{% load helpers %}
|
2016-05-09 14:11:53 -04:00
|
|
|
|
|
|
|
{% block content %}
|
2017-09-01 12:25:57 -04:00
|
|
|
<form action="" method="post" enctype="multipart/form-data" class="form form-horizontal">
|
2016-05-09 14:11:53 -04:00
|
|
|
{% csrf_token %}
|
2016-12-14 13:47:22 -05:00
|
|
|
{% for field in form.hidden_fields %}
|
|
|
|
{{ field }}
|
|
|
|
{% endfor %}
|
2016-05-09 14:11:53 -04:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-md-offset-3">
|
2020-03-05 13:56:03 -05:00
|
|
|
<h3>
|
2020-03-06 09:35:58 -05:00
|
|
|
{% if settings.DOCS_ROOT %}
|
|
|
|
<div class="pull-right">
|
2020-11-17 15:07:05 -05:00
|
|
|
<button type="button" class="btn btn-link btn-xs" data-toggle="modal" data-target="#docs_modal" title="Help">
|
|
|
|
<i class="mdi mdi-help-circle"></i>
|
|
|
|
</button>
|
2020-03-06 09:35:58 -05:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-03-05 13:56:03 -05:00
|
|
|
{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}
|
|
|
|
</h3>
|
2016-12-20 15:39:22 -05:00
|
|
|
{% block tabs %}{% endblock %}
|
2016-05-09 14:11:53 -04:00
|
|
|
{% if form.non_field_errors %}
|
|
|
|
<div class="panel panel-danger">
|
|
|
|
<div class="panel-heading"><strong>Errors</strong></div>
|
|
|
|
<div class="panel-body">
|
|
|
|
{{ form.non_field_errors }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2016-05-12 15:07:27 -04:00
|
|
|
{% block form %}
|
|
|
|
<div class="panel panel-default">
|
2016-06-22 10:57:32 -04:00
|
|
|
<div class="panel-heading"><strong>{{ obj_type|capfirst }}</strong></div>
|
2016-05-12 15:07:27 -04:00
|
|
|
<div class="panel-body">
|
2020-09-04 16:09:05 -04:00
|
|
|
{% block form_fields %}
|
|
|
|
{% render_form form %}
|
|
|
|
{% endblock %}
|
2016-05-12 15:07:27 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
2016-05-09 14:11:53 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-md-offset-3 text-right">
|
2018-03-08 13:25:51 -05:00
|
|
|
{% block buttons %}
|
|
|
|
{% if obj.pk %}
|
|
|
|
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
|
|
|
{% else %}
|
|
|
|
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
|
|
|
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
|
|
{% endblock %}
|
2016-05-09 14:11:53 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2020-03-13 09:07:03 -04:00
|
|
|
{% if obj and settings.DOCS_ROOT %}
|
2020-03-06 09:35:58 -05:00
|
|
|
{% include 'inc/modal.html' with name='docs' content=obj|get_docs %}
|
|
|
|
{% endif %}
|
2016-05-09 14:11:53 -04:00
|
|
|
{% endblock %}
|