Download this file
| 1 | {{define "content"}} |
| 2 | <h1>The board</h1> |
| 3 | <form method="post" action="/posts"> |
| 4 | <label>Say something<br><textarea name="body" rows="3" required></textarea></label> |
| 5 | <button type="submit">Post</button> |
| 6 | </form> |
| 7 | <ul> |
| 8 | {{range .Content.Posts}} |
| 9 | <li> |
| 10 | <p>{{.Body}}</p> |
| 11 | <p><small>{{.Author}}</small></p> |
| 12 | {{if $.Content.CanDelete}} |
| 13 | <form method="post" action="/posts/{{.ID}}/delete"><button type="submit">Delete</button></form> |
| 14 | {{end}} |
| 15 | </li> |
| 16 | {{else}} |
| 17 | <li>Nothing here yet.</li> |
| 18 | {{end}} |
| 19 | </ul> |
| 20 | {{end}} |
| 21 | |