Bootstrap eingefügt, Buttons ausprobiert

This commit is contained in:
2024-01-13 15:50:10 +01:00
parent df15c04395
commit f3202c7235
3 changed files with 28 additions and 16 deletions

6
app.py
View File

@@ -1,11 +1,11 @@
from flask import Flask, redirect, url_for, render_template from flask import Flask, render_template
app = Flask(__name__) app = Flask(__name__)
@app.route('/') @app.route('/')
def home(): def home():
return render_template('index.html', content=5) return render_template('index.html')
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run(debug=True)

22
templates/base.html Normal file
View File

@@ -0,0 +1,22 @@
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<title>{% block title %}{% endblock %}</title>
</head>
<body>
<h1>Homepage</h1>
<input type="radio" class="btn-check" name="options-base" id="option5" autocomplete="off" checked>
<label class="btn" for="option5">Fuck yes!</label>
<input type="radio" class="btn-check" name="options-base" id="option6" autocomplete="off">
<label class="btn" for="option6">Fuck no!</label>
<input type="radio" class="btn-check" name="options-base" id="option7" autocomplete="off">
<label class="btn" for="option7">Fuck you!</label>
<button type="button" class="btn btn-primary">Submit</button>
{% block content %}{% endblock %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,13 +1,3 @@
<html> {% extends "base.html" %}
<head> {% block title %}Homepage{% endblock %}
<title>Homepage</title> {% block content %}<h1>Test</h1>{% endblock %}
</head>
<body>
<h1>Homepage</h1>
{% for x in range(content) %}
<p>{{x}}</p>
{% endfor %}
<p>{{x}}<p>
</body>
</html>