File size: 969 Bytes
e1cbacd
 
 
8caa36e
6af59d7
 
 
 
8caa36e
 
 
 
6af59d7
8caa36e
e1cbacd
8caa36e
 
 
 
 
e1cbacd
6af59d7
 
 
 
 
 
e1cbacd
8caa36e
6af59d7
e1cbacd
 
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
{% extends "base.html" %}

{% block content %}
  <article>
    <header><h2>Create a New Post</h2></header>
    <form method="POST" action="{{ url_for('index') }}">
      <textarea name="content" placeholder="Start a new conversation..." required></textarea>
      <button type="submit">Post</button>
    </form>
  </article>

  <hr>
  <h2>Latest Posts</h2>

  {% for post in posts %}
    <article class="post">
        <p>
            <strong class="post-author">{{ post.username }}</strong>
            <small class="post-date"> - {{ post.timestamp.strftime('%b %d, %H:%M') }} UTC</small>
        </p>
        <p>{{ post.content }}</p>
        <footer>
            <!-- Link to the full thread view -->
            <a href="{{ url_for('view_chirp', chirp_id=post.id) }}">
                View Thread ({{ post.children|length }} replies)
            </a>
        </footer>
    </article>
  {% else %}
    <p>No posts yet. Be the first!</p>
  {% endfor %}
{% endblock %}