From 1ae070a4dd89a474a5691a38ab92a945315bb30b Mon Sep 17 00:00:00 2001 From: Jose Palazon Date: Tue, 17 Sep 2024 10:34:59 +0100 Subject: [PATCH] Collapsable posts --- flaskr/static/style.css | 14 ++++++++++++++ flaskr/templates/blog/index.html | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/flaskr/static/style.css b/flaskr/static/style.css index f01a22c8..ce2e755b 100644 --- a/flaskr/static/style.css +++ b/flaskr/static/style.css @@ -226,3 +226,17 @@ body.dark-mode .content textarea { color: #e0e0e0; border: 1px solid #555; } + +.toggle-content { + background: none; + border: none; + color: #377ba8; + cursor: pointer; + font-size: 0.85em; + margin-left: 1em; + transition: color 0.3s; +} + +.toggle-content:hover { + color: #2c5f8a; +} diff --git a/flaskr/templates/blog/index.html b/flaskr/templates/blog/index.html index 4658b876..db320ba4 100644 --- a/flaskr/templates/blog/index.html +++ b/flaskr/templates/blog/index.html @@ -18,11 +18,24 @@ {% if g.user['id'] == post['author_id'] %} Edit {% endif %} + -

{{ post['body'] }}

+ {% if not loop.last %}
{% endif %} {% endfor %} + {% endblock %}