Format with djlint

This commit is contained in:
Mo 2022-11-06 21:24:30 +01:00
parent 8445a59cbe
commit 97e12feb60
3 changed files with 37 additions and 26 deletions

View file

@ -8,7 +8,8 @@
{% block styles %}{% endblock %}
<link href="{{ path_prefix }}/static/bootstrap/bootstrap.min.css" rel="stylesheet"/>
<link href="{{ path_prefix }}/static/bootstrap/bootstrap.min.css"
rel="stylesheet"/>
</head>
<body>
{% block body %}{% endblock %}

View file

@ -7,33 +7,45 @@
<h2>Kontakt-Formular</h2>
<form id="contact-form" action="{{ path_prefix }}/submit" method="post" class="{% if was_validated %}was-validated{% endif %}" novalidate>
<form id="contact-form"
action="{{ path_prefix }}/submit"
method="post"
class="{% if was_validated %}was-validated{% endif %}"
novalidate>
<input type="hidden" name="id" value="{{ id }}" required>
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" name="name" value="{{ name }}" class="form-control" id="exampleInputEmail1" required>
<div class="invalid-feedback">
Geben Sie bitte Ihren Namen ein
</div>
<input type="text"
name="name"
value="{{ name }}"
class="form-control"
id="exampleInputEmail1"
required>
<div class="invalid-feedback">Geben Sie bitte Ihren Namen ein</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">E-Mail</label>
<input type="email" name="email" value="{{ email }}" class="form-control" id="email" required>
<div class="invalid-feedback">
Geben Sie bitte Ihre E-Mail-Adresse ein
</div>
<input type="email"
name="email"
value="{{ email }}"
class="form-control"
id="email"
required>
<div class="invalid-feedback">Geben Sie bitte Ihre E-Mail-Adresse ein</div>
</div>
<div class="mb-3">
<label for="telefon" class="form-label">Telefon (optional)</label>
<input type="text" name="telefon" value="{{ telefon }}" class="form-control" id="telefon">
<input type="text"
name="telefon"
value="{{ telefon }}"
class="form-control"
id="telefon">
</div>
<div class="mb-5">
<label for="message" class="form-label">Nachricht</label>
<textarea name="message" rows="5" class="form-control" id="message" style="resize: none;" required>{{ message }}</textarea>
<div class="invalid-feedback">
Geben Sie bitte eine Nachricht mit Ihrem Anliegen ein
</div>
<div class="invalid-feedback">Geben Sie bitte eine Nachricht mit Ihrem Anliegen ein</div>
</div>
<div class="mb-3">
@ -41,10 +53,12 @@
</div>
<div class="mb-3">
<label for="captcha_answer" class="form-label">Code vom oberen Bild eingeben</label>
<input type="text" name="captcha_answer" class="form-control" id="captcha_answer" required>
<div class="invalid-feedback">
Geben Sie bitte den Code vom oberen Bild ein
</div>
<input type="text"
name="captcha_answer"
class="form-control"
id="captcha_answer"
required>
<div class="invalid-feedback">Geben Sie bitte den Code vom oberen Bild ein</div>
</div>
<div class="d-grid">
@ -56,15 +70,15 @@
{% block scripts %}
<script>
"use strict";
const form = document.querySelector("#contact-form");
form.addEventListener("submit", (event) => {
if (!form.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add("was-validated");
});
</script>

View file

@ -1,7 +1,3 @@
{% extends "base.askama.html" %}
{% block body %}
<div class="alert alert-success" role="alert">
{{ message }}
</div>
{% endblock %}
{% block body %}<div class="alert alert-success" role="alert">{{ message }}</div>{% endblock %}