-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (60 loc) · 2.14 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lucca Chat</title>
<!-- Bootstrap and custom CSS. -->
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
</head>
<body>
<script type="text/x-handlebars" data-template-name="users">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">Lucca Chat</a>
</div>
</div>
</nav>
<div class="container content">
<div class="row">
{{! Render each of our users as a column. }}
{{#each user in controller}}
<div class="col-md-6">
<div class="column">
<h2>{{user.name}}</h2>
<hr>
<h3>Conversation</h3>
<div class="conversation scroll-container">
{{! Render the messages collection for this user. }}
{{#each message in user.messages itemController="message"}}
<div {{bind-attr class=":row :scroll-item message.fromMe:from-me:not-from-me"}}>
{{scroll-bottom}}
<div class="col-xs-4 sender"><div>{{message.user.name}}</div></div>
<div class="col-xs-8 message"><div>{{message.text}}</div></div>
</div>
{{/each}}
</div>
<h3>New message</h3>
{{! This form binds to properties and actions on the UserController. }}
<div class="row">
<div class="col-xs-10">
{{input type="text" class="form-control" placeholder="Message" value=user.newMessage action="newMessage"}}
</div>
<div class="col-xs-2">
<button type="button" class="btn btn-info" {{action "newMessage"}}>Send</button>
</div>
</div>
</div>
</div>
{{/each}}
</div>
</div>
</script>
<!-- Dependencies and App. -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/handlebars/handlebars.js"></script>
<script src="bower_components/ember/ember.js"></script>
<script src="js/app.js"></script>
</body>
</html>