-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloft.html
More file actions
61 lines (57 loc) · 1.19 KB
/
loft.html
File metadata and controls
61 lines (57 loc) · 1.19 KB
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
<head>
<title>Loft</title>
<script src="jquery-2.1.1.min.js"></script>
<script>
$(function(){
$("#login").load("login.html");
});
</script>
</head>
<body>
<div class="container">
{{> loginButtons}}
{{#if currentUser}}
<header>
{{#if canPost}}
<form class="new-post">
<textarea name="text" placeholder="What's on your mind?"></textarea>
<input type="submit" value="Submit">
<p>Posts left for this week: {{postsLeft}}</p>
</form>
{{else}}
<p>Ran out of posts for this week.</p>
{{/if}}
</header>
<br>
<h1>Posts</h1>
{{#each posts}}
{{> post}}
{{/each}}
{{else}}
{{> login}}
{{/if}}
</div>
</body>
<template name="post">
<div class="post">
<p>{{name}} ({{trophiesBy.length}})</p>
<p>{{{safeText}}}</p>
{{#if canTrophy}}
<button class="trophy-button">Give Trophy</button>
{{/if}}
<p>Comments:</p>
{{#each comments}}
{{> comment}}
{{/each}}
<form class="new-comment">
<input type="text" name="text" placeholder="Leave a comment..." />
</form>
<br><br>
<hr>
</div>
</template>
<template name="comment">
<div class="comment">
<p><b>{{name}}:</b> {{{safeText}}}</p>
</div>
</template>