feat: add message when no posts
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-12-22 02:27:17 +01:00
parent 008ecb7636
commit 4a216d7a81
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 10 additions and 7 deletions

View file

@ -2,6 +2,10 @@ html {
font-family: "Courier New", Courier, monospace; font-family: "Courier New", Courier, monospace;
} }
a {
color: inherit;
}
/* align title with button */ /* align title with button */
header { header {
display: flex; display: flex;
@ -33,7 +37,6 @@ span#login-form button {
/* link stylised as text */ /* link stylised as text */
span#login-form a { span#login-form a {
color: inherit;
text-decoration: none; text-decoration: none;
} }
@ -78,7 +81,3 @@ ul {
li { li {
padding-bottom: 1em; padding-bottom: 1em;
} }
li a {
color: inherit;
}

View file

@ -1,7 +1,7 @@
<header> <header>
<h1>txtdiary{{ " of " + config.user.name if config.user.name else "" }}</h1> <h1>txtdiary{{ " of " + config.user.name if config.user.name else "" }}</h1>
{% if not (login_page or config.is_logged()) -%} {% if not (login_page or config.is_logged()) %}
<a href="/login"> <a href="/login">
<svg width="30px" fill="none" viewBox="0 0 24 24"> <svg width="30px" fill="none" viewBox="0 0 24 24">
<path <path

View file

@ -12,11 +12,15 @@
<p>{{ "".join(get_flashed_messages()) | safe }}</p> <p>{{ "".join(get_flashed_messages()) | safe }}</p>
<h3>posts</h3> <h3>posts</h3>
{% if not posts %}
<p>no posts.</p>
{% else %}
<ul> <ul>
{% for p in posts: %} {% for p in posts: %}
<li><a href="read/{{ p }}">{{ p }}.txt</a></li> <li><a href="read/{{ p }}">{{ p }}.txt</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %}
</main> </main>
</body> </body>
</html> </html>

View file

@ -1,4 +1,4 @@
{% if config.is_logged() -%} {% if config.is_logged() %}
<aside> <aside>
<form action="/" method="post"> <form action="/" method="post">
<textarea name="p"></textarea> <textarea name="p"></textarea>