{% extends 'netbox_meraki/base.html' %}

{% block page_content %}
<div class="row">
    <div class="col-md-12">
        <h1>Delete Site Name Rule</h1>
    </div>
</div>

<div class="row mt-4">
    <div class="col-md-8 offset-md-2">
        <div class="card">
            <div class="card-header bg-danger text-white">
                <strong>Confirm Deletion</strong>
            </div>
            <div class="card-body">
                <div class="alert alert-warning">
                    <strong>Warning:</strong> Are you sure you want to delete this site name rule?
                </div>
                
                <table class="table">
                    <tbody>
                        <tr>
                            <th style="width: 30%;">Name:</th>
                            <td>{{ object.name }}</td>
                        </tr>
                        <tr>
                            <th>Pattern:</th>
                            <td><code>{{ object.regex_pattern }}</code></td>
                        </tr>
                        <tr>
                            <th>Template:</th>
                            <td><code>{{ object.site_name_template }}</code></td>
                        </tr>
                        <tr>
                            <th>Priority:</th>
                            <td>{{ object.priority }}</td>
                        </tr>
                        <tr>
                            <th>Status:</th>
                            <td>
                                {% if object.enabled %}
                                    <span class="badge bg-success">Enabled</span>
                                {% else %}
                                    <span class="badge bg-secondary">Disabled</span>
                                {% endif %}
                            </td>
                        </tr>
                        {% if object.description %}
                        <tr>
                            <th>Description:</th>
                            <td>{{ object.description }}</td>
                        </tr>
                        {% endif %}
                    </tbody>
                </table>
                
                <form method="post">
                    {% csrf_token %}
                    <div class="d-flex gap-2">
                        <button type="submit" class="btn btn-danger">Delete</button>
                        <a href="{% url 'plugins:netbox_meraki:config' %}" class="btn btn-secondary">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
