Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dampdigits authored Oct 29, 2023
1 parent 8ad3325 commit d6d46d9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Binary file modified __pycache__/app.cpython-310.pyc
Binary file not shown.
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def index():
page = 0

if request.method == "POST":
page = request.form.get("page")
page = int(request.form.get("page")) # type: ignore
if page < 0:
return render_template("index.html", text="Invalid page number.")

random.seed(page)
length = 2000
text = random_string(length)
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}
{% block body %}
<p class="text-break">
<p class="text-break py-4">
{{ text }}
</p>
{% endblock %}
8 changes: 4 additions & 4 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</head>
<body>
<div class="container">
<h1 class="mt-5 text-center">Gibberish Library</h1>
<hr>
<form action="/" method="post" class="py-5">
<input type="text" name="page">
<h1 class="mt-4 pt-3 text-center">Gibberish Library</h1>
<form action="/" method="post" class="my-4 text-start">
<input type="number" name="page">
<button type="submit">
Go to page
</button>
</form>
<hr>
{% block body %}{% endblock %}
</div>
</body>
Expand Down

0 comments on commit d6d46d9

Please sign in to comment.