2021-05-17 16:27:27 -04:00
|
|
|
{% extends 'base/layout.html' %}
|
2021-07-01 10:48:24 -04:00
|
|
|
{% load helpers %}
|
2016-06-15 13:27:12 -04:00
|
|
|
{% load form_helpers %}
|
|
|
|
|
2020-02-05 12:36:38 -05:00
|
|
|
{% block title %}Create {{ component_type }}{% endblock %}
|
2016-06-15 13:27:12 -04:00
|
|
|
|
2021-03-14 17:26:33 -07:00
|
|
|
{% render_errors form %}
|
|
|
|
|
2017-02-27 16:52:13 -05:00
|
|
|
{% block content %}
|
2021-04-22 15:58:57 -07:00
|
|
|
<form action="" method="post" enctype="multipart/form-data">
|
2016-06-15 13:27:12 -04:00
|
|
|
{% csrf_token %}
|
|
|
|
<div class="row">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-8">
|
2021-03-14 17:26:33 -07:00
|
|
|
<div class="field-group">
|
|
|
|
<h4>{{ component_type|title }}</h4>
|
2021-07-06 12:10:29 -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>
|
2016-06-15 13:27:12 -04:00
|
|
|
</div>
|
2021-07-06 12:10:29 -04:00
|
|
|
{% endif %}
|
2021-07-01 10:48:24 -04:00
|
|
|
<div class="panel panel-default">
|
2021-07-06 12:10:29 -04:00
|
|
|
<div class="panel-heading">
|
|
|
|
<strong>{{ component_type|bettertitle }}</strong>
|
|
|
|
</div>
|
2021-07-01 10:48:24 -04:00
|
|
|
<div class="panel-body">
|
2021-07-06 12:10:29 -04:00
|
|
|
{% for field in form.hidden_fields %}
|
|
|
|
{{ field }}
|
|
|
|
{% endfor %}
|
|
|
|
{% for field in form.visible_fields %}
|
|
|
|
{% if field.name not in form.custom_fields %}
|
|
|
|
{% render_field field %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2021-07-01 10:48:24 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-06 12:10:29 -04:00
|
|
|
{% if form.custom_fields %}
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading"><strong>Custom Fields</strong></div>
|
|
|
|
<div class="panel-body">
|
|
|
|
{% render_custom_fields form %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-03-13 11:16:29 -07:00
|
|
|
</div>
|
2016-06-15 13:27:12 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-03-14 17:26:33 -07:00
|
|
|
<div class="row my-3">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-8 text-end">
|
2021-03-14 17:26:33 -07:00
|
|
|
{% block buttons %}
|
|
|
|
<a class="btn btn-outline-danger" href="{{ return_url }}">Cancel</a>
|
2021-04-30 17:17:56 -07:00
|
|
|
{% if component_type == 'interface' and perms.ipam.add_ipaddress %}
|
2021-04-30 11:13:38 -07:00
|
|
|
<button type="submit" name="_assignip" class="btn btn-outline-success">
|
|
|
|
Create & Assign IP Address
|
|
|
|
</button>
|
|
|
|
{% endif %}
|
2021-03-14 17:26:33 -07:00
|
|
|
<button type="submit" name="_addanother" class="btn btn-outline-primary">
|
|
|
|
Create & Add Another
|
|
|
|
</button>
|
|
|
|
<button type="submit" name="_create" class="btn btn-primary">
|
|
|
|
Create
|
|
|
|
</button>
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-06-15 13:27:12 -04:00
|
|
|
</form>
|
|
|
|
{% endblock %}
|