Files
Django-Proxmox-Mikrotik/frontend/templates/frontend/edit_container.html
Holger Sielaff 90c0ff61ed initial
2025-08-27 09:55:55 +02:00

69 lines
2.7 KiB
HTML

<!-- frontend/templates/frontend/edit_container.html -->
{% extends 'frontend/base.html' %}
{% load static %}
{% block title %} - Edit Container{% endblock %}
{% block extra_head %}
{{ block.super }}
{% endblock %}
{% block content %}
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-12 col-md-10">
<h4>Edit {{ container.name }}</h4>
</div>
<div class="col-12 col-md-2 text-end">
<a href="{% url 'frontend:create_container' %}?clone_lxc={{ container.lxc.pk }}"
class="btn btn-secondary">
<i class="bi bi-copy">&nbsp;Clone</i>
</a>
</div>
</div>
</div>
<div class="card-body">
<form method="post">
{% csrf_token %}
<input type="hidden" name="task_uuid" value="{{ task_uuid }}"/>
<div class="row">
{% for field in form %}
<div class="col-{% if field.name in 'lxcdnslease' %}12 mb-3{% else %}4{% endif %}">
<label for="{{ field.id_for_label }}" class="form-label">{{ field.label }}</label>
<input type="hidden" value="{{ field.value }}" name="{{ field.name }}"/>
{{ field }}
{% if field.help_text %}
<div class="form-text">{{ field.help_text }}</div>
{% endif %}
{% if field.errors %}
<div class="invalid-feedback d-block">
{% for error in field.errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
<div class="mt-4">
<button type="submit" class="btn btn-primary" id="save-btn">Speichern</button>
<a href="{% url 'frontend:container_detail' container.internal_id %}" class="btn btn-secondary">Abbrechen</a>
</div>
</form>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
$(document).ready(function () {
// Form blocking - disable submit button on form submission
$('form').on('submit', function () {
$('#save-btn').prop('disabled', true).text('Aktualisiere Container...');
});
});
</script>
{% endblock %}