| 1 |
{% extends "admin/models/base_forms.html" %} |
| 2 |
|
| 3 |
{% block breadcrumbs %} |
| 4 |
{{ super() }} |
| 5 |
<li class="breadcrumb-item"><a href=".">Add new</a></li> |
| 6 |
{% endblock %} |
| 7 |
|
| 8 |
{% block tab_add_class %}active{% endblock %} |
| 9 |
|
| 10 |
{% block content %} |
| 11 |
{% include "admin/includes/form_raw_id.html" %} |
| 12 |
{% if form.errors %} |
| 13 |
<div class="alert alert-danger alert-dismissible fade show"> |
| 14 |
<p class="mb-0">There were errors with your form submission</p> |
| 15 |
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
| 16 |
</div> |
| 17 |
{% endif %} |
| 18 |
<form method="post" action="." class="add" enctype="multipart/form-data"> |
| 19 |
<fieldset> |
| 20 |
{% if csrf_token %}{# Support for flask-seasurf #}<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">{% endif %} |
| 21 |
<legend>Add a new {{ admin.fix_underscores(model_admin.get_display_name()) }}</legend> |
| 22 |
{% for field in form %} |
| 23 |
{{ admin_field(field) }} |
| 24 |
{% endfor %} |
| 25 |
{% block extra_form %}{% endblock %} |
| 26 |
<div class="form-actions d-flex gap-2"> |
| 27 |
<button class="btn btn-primary" name="save" type="submit">Save</button> |
| 28 |
<button class="btn btn-secondary" name="save_add" type="submit">Save and add new</button> |
| 29 |
<button class="btn btn-secondary" name="save_edit" type="submit">Save and edit</button> |
| 30 |
<a class="btn btn-outline-secondary" href="{{ url_for(model_admin.get_url_name('index')) }}">Cancel</a> |
| 31 |
</div> |
| 32 |
</fieldset> |
| 33 |
</form> |
| 34 |
{% endblock %} |