-
Notifications
You must be signed in to change notification settings - Fork 0
/
juzKarmaChat.html
64 lines (57 loc) · 1.46 KB
/
juzKarmaChat.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
<head>
<title>juzKarmaChat</title>
</head>
<body>
<h1>Welcome to Karma Chat!</h1>
{{> loginButtons}}
{{> usersOnline}}
{{#if currentUser}}
<div class="karma">My Karma is: {{karma}}</div>
{{> chatInput}}
{{/if}}
<div class="messages">
{{#each messages}}
{{> message}}
{{/each}}
</div>
</body>
<template name="message">
<div class="message"><a class="username">{{username}}</a>({{formatDate createdAt}}):<span class="{{#if toMe}} toMe{{/if}}">{{text}}</span>
{{#if currentUser}}
<div class="thumbsUp{{#if isVoted.up}} voted{{/if}}"></div>{{thumbsUp}}
<div class="thumbsDown{{#if isVoted.down}} voted{{/if}}"></div>{{thumbsDown}}
{{#if isOwner}}
<div class="delete"></div>
{{/if}}
{{/if}}
</div>
</template>
<template name="chatInput">
<footer class="chat-input">
<form class="new-message">
<input class="inputText" type="text" name="text" placeholder="Type message here" >
</form>
</footer>
</template>
<template name="usersOnline">
<div>
There are currently {{usersOnline.count}} users online{{#if usersOnline.exists}}:
<table>
<thead>
<tr>
<th>Username</th>
<th>Karma</th>
</tr>
</thead>
<tbody>
{{#each usersOnline.list}}
{{> onlineUser}}
{{/each}}
</tbody>
</table>
{{else}}.{{/if}}
</div>
</template>
<template name="onlineUser">
<tr><td class="td1"><a class="username">{{getName}}</a></td><td class="td2">{{getKarma}}</td></tr>
</template>