{% extends "base.html" %}
{% import "bussdcc_framework/formtree/_formtree.jinja" as formtree %}

{% block content %}
<div class="card mb-3">
  <div class="card-header">
    {{ device_id }}
  </div>
  <div class="card-body">
    <form method="post" action="{{ action }}">
      {{ formtree.render(tree) }}

      <div class="d-flex justify-content-between align-items-center">
        <button class="btn btn-primary">Save</button>
        <a href="{{ url_for("device.index") }}" class="btn btn-secondary">Cancel</a>
      </div>
    </form>

    <hr>

    <form method="post" action="{{ url_for('device.delete_device', id=device_id) }}">
      <button
        class="btn btn-outline-danger"
        onclick="return confirm('Delete device {{ device_id }}?');">
        Detach / Delete Device
      </button>
    </form>
    </form>
  </div>
</div>
{% endblock %}
