Compare commits

..

No commits in common. 'e49ff266410546ba2686e1f70ef3245b107fa69d' and '2deccd57ce6488fe888c8d8157bb9029a79f15a3' have entirely different histories.

@ -20,6 +20,5 @@ import main.views as main
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
# path('', admin.site.urls), path('', main.home)
path('calculator/', main.calculator)
] ]

@ -1,76 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bitwert Berechnung</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #f4f4f4;
}
label {
display: block;
margin: 5px 0;
}
input {
margin-right: 10px;
}
#result {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Wochentage Bitwert Berechnung</h1>
<form id="bitForm">
<label><input type="checkbox" name="MiV" value="1"> MiV</label>
<label><input type="checkbox" name="MiN" value="2"> MiN</label>
<label><input type="checkbox" name="DoV" value="4"> DoV</label>
<label><input type="checkbox" name="DoN" value="8"> DoN</label>
<label><input type="checkbox" name="FrV" value="16"> FrV</label>
<label><input type="checkbox" name="FrN" value="32"> FrN</label>
<label><input type="checkbox" name="SaV" value="64"> SaV</label>
<label><input type="checkbox" name="SaN" value="128"> SaN</label>
<label><input type="checkbox" name="SoV" value="256"> SoV</label>
<label><input type="checkbox" name="SoN" value="512"> SoN</label>
<label><input type="checkbox" name="Abbau" value="1024"> Abbau</label>
<br><br>
<button type="button" onclick="calculateBitValue()">Berechne Gesamtbitwert</button>
</form>
<div id="result"></div>
<script>
const TAGE = {
"MiV": 1,
"MiN": 2,
"DoV": 4,
"DoN": 8,
"FrV": 16,
"FrN": 32,
"SaV": 64,
"SaN": 128,
"SoV": 256,
"SoN": 512,
"Abbau": 1024,
};
function calculateBitValue() {
let totalBitValue = 0;
const formElements = document.forms['bitForm'].elements;
for (const element of formElements) {
if (element.type === 'checkbox' && element.checked) {
totalBitValue += TAGE[element.name];
}
}
document.getElementById('result').textContent = `Gesamtbitwert: ${totalBitValue}`;
}
</script>
</body>
</html>

@ -4,6 +4,3 @@ from django.http import HttpResponse
# Create your views here. # Create your views here.
def home(request): def home(request):
return HttpResponse("HELLO WORLD") return HttpResponse("HELLO WORLD")
def calculator(request):
return render(request, "main/calculator.html", {})
Loading…
Cancel
Save

Powered by TurnKey Linux.