about summary refs log tree commit diff
path: root/templates/thread.html
blob: 3c93a524834fa9320cdeba214c963ff13bcdc747 (plain) (blame)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <title>Converse: {{ thread.title }}</title>
  </head>
  <body>
    <header>
      <nav class="navbar navbar-light bg-light justify-content-between mb-3">
        <a class="navbar-brand" href="/">
          <h2>Converse</h2>
        </a>
        <form class="form-inline">
          <a class="btn btn-outline-secondary my-2" href="/">Back to index</a>
        </form>
      </nav>
    </header>

    <div class="container">
      <div class="row">
        <div class="col-12">
          <div class="list-group">
            <div class="list-group-item flex-column">
              <div class="row">
                <div class="col-12">
                  <h3>{{ thread.title }}</h3>
                </div>
              </div>
            </div>
            <div class="list-group-item flex-column align-items-start">
              <div class="row">
                <div class="col-2 border-right">
                  <div class="row">
                    <div class="col-12">
                      <img src="https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50" />
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-12">
                      <strong>{{ thread.author_name }}</strong>
                    </div>
                  </div>
                </div>
                <div class="col-10">
                  {{ thread.body }}
                </div>
                <small class="text muted"> {{ thread.posted }} </small>
              </div>
            </div>

            {% for post in posts -%}
            <div class="list-group-item flex-column align-items-start">
              <div class="row">
                <div class="col-2 border-right">
                  <img src="https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50" />
                  {{ post.author_name }}
                </div>
                <div class="col-10">
                  {{ post.body }}
                </div>
                <small class="text muted"> {{ post.posted }} </small>
              </div>
            </div>
            {%- endfor %}
            <div class="list-group-item flex-column align-items-start">
              <div class="row">
                <div class="col-12">
                  <form action="/thread/reply" method="post">
                    <input type="hidden" id="thread_id" name="thread_id" value="{{ thread.id }}">
                    <label for="body">You can use <strong>Markdown</strong>!</label>
                    <div class="input-group">
                      <textarea class="form-control" id="body" name="body" aria-label="thread response"></textarea>
                      <div class="input-group-append">
                        <button class="btn btn-outline-primary" type="submit">Post!</button>
                      </div>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>