-
Notifications
You must be signed in to change notification settings - Fork 25
/
index.html
58 lines (49 loc) · 1.16 KB
/
index.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
@include 'header.html'
@if app.user.is_admin
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<script>
function deletePost(post_id, title) {
if (!confirm('Are you sure you you want to delete post `' + title + '`?')) {
return;
}
$.ajax({
url: '/posts/' + post_id,
type: 'DELETE',
success: function() {
location.reload();
}
});
}
</script>
@end
<div class="center">
<form action="/new/">
<input class="new_button" type="submit" value="New Topic" style="margin-top:30px">
</form>
<br>
<br>
@for post in posts
<div class=post>
@if app.user.is_admin
[ <a>lock</a> | <a onclick="deletePost(@post.id, `@post.title`)">❌</a> ]
@end
@if post.is_locked
🔒
@end
<a class=topic href="@post.url">@post.title</a>
<img class=comment-img>
<span class=nr-comments>@post.nr_comments</span>
<span class=time>@post.time.relative()</span>
</div>
@end
<br>
<br>
<center style="color:#777">Powered by <a target=_blank
href="https://github.com/vlang/vorum">Vorum</a>,
open-source blogging/forum software written in V</center>
<br>
<br>
</div>