-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
86 lines (84 loc) · 2.87 KB
/
home.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!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>
{{if .IsLoggedIn}}
<!-- Render the logout button if the user is logged in -->
<form action="/logout" method="post">
<button type="submit">Logout</button>
</form>
{{end}}
<!--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>
<br>
<div class="createpostContainer">
<form action="http://localhost:8080/create-post">
<button class="create-button" type="submit">Create post</button>
</form>
</div>
<!--differentiate between post title and post body, and separate posts-->
<h2>All Posts</h2>
<div class="posts">
{{range .Posts}}
<div class="post">
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
<p>{{.Content}}</p>
<p>Post created: {{.Time}}</p>
<br>
</div>
{{end}}
</div>
<h2>Liked Posts</h2>
<div class="posts">
{{range .LikedPosts}}
<div class="post">
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
<p>{{.Content}}</p>
<p>Post created: {{.Time}}</p>
<br>
</div>
{{end}}
</div>
<h2>Your Posts</h2>
<div class="posts">
{{range .YourPosts}}
<div class="post">
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
<p>{{.Content}}</p>
<p>Post created: {{.Time}}</p>
<br>
</div>
{{end}}
</div>
</body>
</html>