summaryrefslogtreecommitdiff
path: root/clams-server/src/main/resources/templates/posts.html
blob: ed15beb1bd11f80f8b670d7b5ad076bb77b3d85f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% extends "templates/layout.html" %}

{% block content %}
<main class="main-container">
    <a href="/" class="back-link-top">&larr; hjem</a>
    <header>
        <h1>Blog</h1>
        <p class="intro-text">Ta en titt på bloggen min da vel.</p>

        <form action="/posts" method="GET" class="search-form">
            <input type="text" name="search" value="{{ search_value }}" placeholder="Søk i innlegg..."
                   aria-label="Search posts">
            <button type="submit" class="pill-button">Søk</button>
        </form>
    </header>

    <section id="all" class="posts-section">
        <h2>Alle Innlegg</h2>
        {% for group in posts_by_year %}
        <details class="year-accordion" {% if loop.first %}open{% endif %}>
            <summary class="year-toggle">{{ group.key }}</summary>
            <ul class="post-list">
                {% for post in group.value %}
                <li class="post-list-item">
                    <span class="post-date">{{ post.formattedDate }}</span>
                    <a href="/posts/{{ post.slug }}">{{ post.title }}</a>
                    {% if post.summary is not empty %}
                    <br>
                    <span class="search-result-summary">-- {{ post.summary }}</span>
                    {% endif %}
                </li>
                {% endfor %}
            </ul>
        </details>
        {% endfor %}
    </section>
</main>
{% endblock %}