{% extends 'base/layout.html' %}
{% load form_helpers %}

{% block title %}
  {% if object.pk %}Edit {{ object }}{% else %}Add Z-Wave Network{% endif %}
{% endblock %}

{% block content %}
  <form action="" method="post" enctype="multipart/form-data" class="form-object-edit">
    {% csrf_token %}
    <div class="row">
      <div class="col col-md-6">
        <div class="card">
          <h5 class="card-header">Network Details</h5>
          <div class="card-body">
            {% render_form form %}
          </div>
        </div>
      </div>
      <div class="col col-md-6">
        <div class="card">
          <h5 class="card-header">Security Settings</h5>
          <div class="card-body">
            {% render_field form.security_enabled %}
            {% render_field form.s2_enabled %}
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col col-md-12 text-end">
        <a href="{{ return_url }}" class="btn btn-outline-danger">Cancel</a>
        <button type="submit" name="_save" class="btn btn-primary">Save</button>
        <button type="submit" name="_addanother" class="btn btn-outline-primary">Save & Add Another</button>
      </div>
    </div>
  </form>
{% endblock %}
