mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-04-19 00:45:16 +00:00
Start using django crispy forms
This commit is contained in:
parent
d4163b9278
commit
2e8ac8669c
@ -1,12 +1,14 @@
|
||||
asgiref==3.7.2
|
||||
asgiref==3.8.1
|
||||
certifi==2024.2.2
|
||||
charset-normalizer==3.3.2
|
||||
crispy-bootstrap4==2024.1
|
||||
Django==5.0.4
|
||||
idna==3.6
|
||||
django-crispy-forms==2.1
|
||||
idna==3.7
|
||||
pypng==0.20220715.0
|
||||
pytz==2024.1
|
||||
qrcode==7.4.2
|
||||
requests==2.31.0
|
||||
sqlparse==0.4.4
|
||||
typing_extensions==4.9.0
|
||||
sqlparse==0.5.0
|
||||
typing_extensions==4.11.0
|
||||
urllib3==2.2.1
|
||||
|
51
templates/generic_form.html
Normal file
51
templates/generic_form.html
Normal file
@ -0,0 +1,51 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<div class='row'>
|
||||
<div class='{% if form_size %}{{ form_size }}{% else %}col-lg-6{% endif %}'>
|
||||
<div class="card card-primary card-outline">
|
||||
{% if page_title %}
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ page_title }}</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-body row">
|
||||
<div class="col-lg-12">
|
||||
{% csrf_token %}
|
||||
{% crispy form %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if form_description %}
|
||||
<div class='{% if form_description.size %}{{ form_description.size }}{% else %}col-lg-6{% endif %}'>
|
||||
<div class="card card-primary card-outline">
|
||||
|
||||
<div class="card-body row">
|
||||
<div class="col-lg-12">
|
||||
{{ form_description.content|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block custom_page_scripts %}
|
||||
|
||||
<script>
|
||||
function openCommandDialog(element) {
|
||||
var command = element.getAttribute('data-command');
|
||||
var confirmation = prompt("{% if delete_confirmation_message %}{{ delete_confirmation_message }}{% else %}Please type 'delete' to proceed.{% endif %}");
|
||||
if (confirmation) {
|
||||
var url = "?uuid={{ instance.uuid }}&action=delete&confirmation=" + encodeURIComponent(confirmation);
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user