-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
meteor-chat.html
79 lines (70 loc) · 2.27 KB
/
meteor-chat.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
<head>
<title>MeteorChat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
{{> chat}}
</body>
<template name="chat">
<div class="container">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<a class="brand" href="#">MeteorChat</a>
<ul class="nav">
<li><a href="https://github.com/dasniko/meteor-chat" target="_blank">Source</a></li>
<li><a href="http://www.n-k.de" target="_blank">Contact</a></li>
</ul>
<ul class="nav pull-right">
<li><a href="http://www.meteor.com" target="_blank">Meteor release {{release}}</a></li>
<li><a>{{> loginButtons align="right"}}</a></li>
</ul>
</div>
</div>
{{#if currentUser}}
<div class="row-fluid">
<div class="span12 well">
{{> input}}
</div>
</div>
<div class="row-fluid">
<div class="span8 well">
{{> messages}}
</div>
<div class="span4 well">
{{> rooms}}
</div>
</div>
{{else}}
<div class="hero-unit">
<h1>Welcome to MeteorChat</h1>
<p>Please login!</p>
</div>
{{/if}}
</div>
</template>
<template name="input">
<input type="text" id="msg" placeholder="Your message goes here..." style="width: 50%; margin-bottom: 0px">
<input type="button" value="Send message" class="btn btn-primary sendMsg">
</template>
<template name="messages">
<h4>Room: {{roomname}}</h4>
<div id="messages" style="background-color: #ffffff; border: 1px solid darkgray; max-height: 200px; overflow: auto">
{{#each messages}}
{{> message}}
{{/each}}
</div>
</template>
<template name="message">
<p><strong>{{user}}</strong> <span style="font-size: 0.7em; color: darkgray">({{timestamp}})</span>: <i>{{msg}}</i></p>
</template>
<template name="rooms">
<h4>Join a room:</h4>
<ul>
{{#each rooms}}
{{> room}}
{{/each}}
</ul>
</template>
<template name="room">
<li style="cursor: pointer; {{roomstyle}}">{{roomname}}</li>
</template>