2016-06-15 13:27:12 -04:00
|
|
|
{% extends '_base.html' %}
|
|
|
|
{% load form_helpers %}
|
|
|
|
|
2016-06-15 14:00:45 -04:00
|
|
|
{% block title %}{% if module %}Editing {{ module.device }} {{ module }}{% else %}Add a Module to {{ device }}{% endif %}{% endblock %}
|
2016-06-15 13:27:12 -04:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<form action="." method="post" class="form form-horizontal">
|
|
|
|
{% csrf_token %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-md-offset-3">
|
|
|
|
{% 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 %}
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2016-06-15 14:00:45 -04:00
|
|
|
<strong>{% if module %}Editing {{ module.device }} {{ module }}{% else %}Add a Module to {{ device }}{% endif %}</strong>
|
2016-06-15 13:27:12 -04:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-3 control-label required">Device</label>
|
|
|
|
<div class="col-md-9">
|
2016-06-15 14:00:45 -04:00
|
|
|
<p class="form-control-static">{% if module %}{{ module.device }}{% else %}{{ device }}{% endif %}</p>
|
2016-06-15 13:27:12 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% render_form form %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-9 col-md-offset-3">
|
|
|
|
{% if module.pk %}
|
|
|
|
<button type="submit" name="_update" class="btn btn-primary">Save</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 More</button>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{{ cancel_url }}" class="btn btn-default">Cancel</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|