-
Notifications
You must be signed in to change notification settings - Fork 0
/
filteredPosts.html
63 lines (62 loc) · 2.18 KB
/
filteredPosts.html
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
<!DOCTYPE html>
<html>
<head>
<title>my forum</title>
<style>
a {
text-decoration: none;
}
</style>
</head>
<body>
<a href="http://localhost:8080/">
<h1>my forum</h1></a>
<div class="login-regi-container">
<form action="http://localhost:8080/login">
<button class="login-button" type="submit">Login</button>
</form>
<form action="http://localhost:8080/register">
<button class="register-button">Register</button>
</form>
</div>
<!--navigation header-->
<br>
<form action="/filtered-posts" method="GET">
<div class="categories">
<label for="category">Select a category:</label>
<select id="category" name="category">
<option value="lifestyle">Lifestyle</option>
<option value="news">News</option>
<option value="gaming">Gaming</option>
<option value="fashion">Fashion</option>
<option value="music">Music</option>
<option value="tv-movies">TV/Movies</option>
</select>
</div>
<button type="submit">Filter</button>
</form>
<div class="redirect">
<form action="http://localhost:8080/">
<button class="redirect-button" type="submit">Show all posts</button>
</form>
</div>
<br>
<div class="createpostContainer">
<form action="http://localhost:8080/create-post">
<button class="create-button" type="submit">Create post</button>
</form>
</div>
<!--show filtered posts-->
<h1>Filtered Posts - Category: {{.Category}}</h1>
<div class="posts">
{{range .FilteredPosts}}
<div class="post">
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
<p>{{.Content}}</p>
<p>Post created: {{.Time}}</p>
<br>
</div>
{{end}}
</div>
</body>
</html>