blob: 89cb4bc6c9922dc8d6e8b1dae98a23a513ff7ee9 (
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
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ideas</title>
<style>
.idea {
border: solid 2px black;
border-radius: 5px;
padding: 4px;
margin-bottom: 1em;
width: 50%;
}
.title {
margin-left: 1em;
margin-bottom: 0;
display: inline;
}
.rating {
display: inline;
margin-left: 1em;
}
.description {
margin-left: .5em;
margin-top: .5em;
font-family: monospace;
font-size: 1.25em;
}
.creation {
margin-bottom: 0;
}
.author {
font-style: italic;
}
.date {
color: #bcbcbc;
}
.error {
color: red;
}
</style>
</head>
<body>
{{ with .Error }}
<p class="error">{{.}}</p>
{{ end}}
<form action="/create/" method="post">
<input name="title" type="text" placeholder="Title"></br>
<input name="text" type="text" placeholder="Idea description..."></br>
<input name="author" type="text" placeholder="Your Name"></br>
<input type="submit" value="Post">
</form>
<hr>
<form action="/delete/" method="post">
<input type="text" placeholder="Title" name="title"></br>
<input type="submit" value="Delete">
</form>
<hr>
<ul>
{{ range .Ideas }}
<div class="idea">
<h2 class="title">{{.Title}}</h2>
<p class="text">{{.Text}}</p>
<p class="creation">by <span class="author">{{.Author}}</span> on <span class="date">{{.CreatedAt}}</span></p>
</div>
{{ end }}
</ul>
<!--template-->
</body>
</html>
|