aboutsummaryrefslogtreecommitdiff
path: root/ui/html/pages/post.tmpl.html
blob: 26d831aa9d7f2b2bbcfa96ff7103b8159e9aad05 (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
39
40
41
42
43
44
{{define "title"}}{{.Post.Name}} - {{.Post.FormattedTime}}{{end}}
{{define "description"}}{{.Post.Brief}}{{end}}

{{define "main"}}
    <div class="card">
        {{.Post.Content}}
    </div>
    <div class="card">
        <h3>Leave Comment</h3>
        <form action="/comments/post?id={{.Post.Id}}" method="POST">
            <label for="comment"></label>
            <textarea name="comment" id="comment" rows="5" class="w100" required></textarea><br><br>
            <div class="comment_zone">
                <label for="name">Name:</label>
                <input type="text" name="name" id="name" required>
                <input type="submit" value="Post">
            </div>
        </form>
    </div>
    {{range .Comments}}
        {{if .IsVerified}}
            <div class="card">
                <h3>{{.Name}} - {{.FormattedTime}}</h3>
                {{if $.IsAuth}}
                    <div class="nav_tag right">
                        <a href="/comments/delete?id={{.Id}}" class="nav_tag right">Delete</a>
                    </div>
                {{end}}
                <p><pre>{{.Content}}</pre></p>
            </div>
        {{else}}
            {{if $.IsAuth}}
                <div class="card">
                    <h3>{{.Name}} - {{.FormattedTime}}</h3>
                    <div class="nav_tag right">
                        <a href="/comments/verify?id={{.Id}}" class="nav_tag right">Verify</a>
                        <a href="/comments/delete?id={{.Id}}" class="nav_tag right">Delete</a>
                    </div>
                    <p><pre>{{.Content}}</pre></p>
                </div>
            {{end}}
        {{end}}
    {{end}}
{{end}}