<!--
Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
-->
{% extends "base.html" %}

{% block title %}{{ title }} - AISBF Dashboard{% endblock %}

{% block content %}
<h2 style="margin-bottom: 30px;">{{ title }}</h2>

{% if success %}
<div class="alert alert-success">{{ success }}</div>
{% endif %}

{% if error %}
<div class="alert alert-error">{{ error }}</div>
{% endif %}

<form method="POST">
    <div class="form-group">
        <label for="config">Configuration (JSON)</label>
        <textarea id="config" name="config" required>{{ config_content }}</textarea>
    </div>
    
    <div style="display: flex; gap: 10px;">
        <button type="submit" class="btn">Save Changes</button>
        <a href="/dashboard" class="btn btn-secondary">Cancel</a>
    </div>
</form>

<div style="margin-top: 30px; padding: 15px; background: #f8f9fa; border-radius: 4px;">
    <h4 style="margin-bottom: 10px;">Tips:</h4>
    <ul style="margin-left: 20px; line-height: 1.8;">
        <li>Ensure valid JSON syntax before saving</li>
        <li>Changes take effect after server restart</li>
        <li>Backup your configuration before making changes</li>
    </ul>
</div>
{% endblock %}
