feat: store lines of a haiku, not just as a str

Refs: OPS-24
This commit is contained in:
Christoph J. Scherr 2025-02-25 18:32:50 +01:00
parent 5fa2122972
commit 82f8c7a721
No known key found for this signature in database
GPG key ID: 9EB784BB202BB7BB
2 changed files with 15 additions and 15 deletions

View file

@ -3,4 +3,4 @@ from dataclasses import dataclass
@dataclass @dataclass
class Haiku: class Haiku:
text: str lines: list[str]

View file

@ -2,19 +2,19 @@
{% block content %} {% block content %}
<div class="bg-violet-900 min-h-screen flex items-center justify-center text-white"> <div class="bg-violet-900 min-h-screen flex items-center justify-center text-white">
<div class="text-center"> <div class="text-center">
<div class="bg-white text-gray-900 p-10 rounded-lg shadow-lg max-w-2xl mx-auto transform -translate-y-10"> <div class="bg-white text-gray-900 p-10 rounded-lg shadow-lg max-w-2xl mx-auto transform -translate-y-10">
<h1 class="text-4xl font-bold text-violet-700 mb-6">Haiku of the Day</h1> <h1 class="text-4xl font-bold text-violet-700 mb-6">{{ title }}</h1>
<p class="text-2xl italic leading-relaxed"> <p class="text-2xl italic leading-relaxed text-left">
An old silent pond<br> {% for line in context.haiku.lines %}
A frog jumps into the pond—<br> {{ line }}<br>
Splash! Silence again. {% endfor %}
</p> </p>
</div> </div>
<a href="{{ url_for('index_view') }}" class=" inline-block bg-violet-600 hover:bg-violet-700 text-white font-bold py-2 px-4 rounded-lg"> <a href="{{ url_for('index_view') }}"
Back to Home class=" inline-block bg-violet-600 hover:bg-violet-700 text-white font-bold py-2 px-4 rounded-lg">
</a> Back to Home
</div> </a>
</div>
</div> </div>
{% endblock %} {% endblock %}