-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessages.html
More file actions
executable file
·191 lines (173 loc) · 7.05 KB
/
messages.html
File metadata and controls
executable file
·191 lines (173 loc) · 7.05 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Messages</title>
<link rel="stylesheet" type="text/css" href="styles/messages.css" />
<script src="scripts/jquery-3.1.1.min.js"></script>
<script src="scripts/app.js"></script>
</head>
<body onload="startApp()">
<div id="app">
<header id="menu">
<a href="#" class="anonymous" id="linkMenuAppHome">Home</a>
<a href="#" class="anonymous" id="linkMenuLogin">Login</a>
<a href="#" class="anonymous" id="linkMenuRegister">Register</a>
<a href="#" class="useronly" id="linkMenuUserHome">Home</a>
<a href="#" class="useronly" id="linkMenuMyMessages">My Messages</a>
<a href="#" class="useronly" id="linkMenuArchiveSent">Archive (Sent)</a>
<a href="#" class="useronly" id="linkMenuSendMessage">Send Message</a>
<a href="#" class="useronly" id="linkMenuLogout">Logout</a>
<span class="useronly" id="spanMenuLoggedInUser">Welcome, {user}!</span>
</header>
<main>
<div id="loadingBox">Loading ...</div>
<div id="infoBox">Info</div>
<div id="errorBox">Error</div>
<section id="viewAppHome">
<h1>Welcome</h1>
Welcome to our messaging system.
</section>
<section id="viewLogin">
<h1>Please login</h1>
<form id="formLogin">
<label>
<div>Username:</div>
<input type="text" name="username" id="loginUsername" required />
</label>
<label>
<div>Password:</div>
<input type="password" name="password" id="loginPasswd" required />
</label>
<div>
<input type="submit" value="Login" />
</div>
</form>
</section>
<section id="viewRegister">
<h1>Please register here</h1>
<form id="formRegister">
<label>
<div>Username:</div>
<input type="text" name="username" id="registerUsername" required />
</label>
<label>
<div>Password:</div>
<input type="password" name="password" id="registerPasswd" required />
</label>
<label>
<div>Name:</div>
<input type="text" name="name" id="registerName" />
</label>
<div>
<input type="submit" value="Register" />
</div>
</form>
</section>
<section id="viewUserHome">
<h1 id="viewUserHomeHeading">Welcome, {user}!</h1>
<a href="#" id="linkUserHomeMyMessages">My Messages</a>
<a href="#" id="linkUserHomeSendMessage">Send Message</a>
<a href="#" id="linkUserHomeArchiveSent">Archive (Sent)</a>
</section>
<section id="viewMyMessages">
<h1>My Messages</h1>
<div class="messages" id="myMessages">
<table>
<thead>
<tr>
<th>From</th>
<th>Message</th>
<th>Date Received</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maria Ivanova (maria)</td>
<td>Hi, Peter</td>
<td>29.11.2016 9:43:18</td>
</tr>
<tr>
<td>todor</td>
<td>Pesho, how are you?</td>
<td>29.11.2016 11:53:44</td>
</tr>
<tr>
<td>Maria Ivanova (maria)</td>
<td>Peter, please reply.</td>
<td>1.11.2016 14:08:03</td>
</tr>
<tr>
<td>Marin Marinov</td>
<td>Peter, I am Marin from Varna.</td>
<td>1.03.2015 4:18:43</td>
</tr>
<tr>
<td>Kiril (kiro)</td>
<td>Happy new year!</td>
<td>1.1.2017 0:00:01</td>
</tr>
<!-- TODO: more messages will come here -->
</tbody>
</table>
</div>
</section>
<section id="viewArchiveSent">
<h1>Archive (Sent Messages)</h1>
<div class="messages" id="sentMessages">
<table>
<thead>
<tr>
<th>To</th>
<th>Message</th>
<th>Date Sent</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>peter</td>
<td>Hi, Peter</td>
<td>29.11.2016 9:43:18</td>
<td><button>Delete</button></td>
</tr>
<tr>
<td>todor</td>
<td>Todor, how are you?</td>
<td>3.07.2016 8:06:03</td>
<td><button>Delete</button></td>
</tr>
<tr>
<td>maria</td>
<td>Party this evening?</td>
<td>9.06.2016 19:55:59</td>
<td><button>Delete</button></td>
</tr>
<!-- TODO: more messages will come here -->
</tbody>
</table>
</div>
</section>
<section id="viewSendMessage">
<h1>Send Message</h1>
<form id="formSendMessage">
<div>Recipient:</div>
<div>
<select name="recipient" required id="msgRecipientUsername">
<option value="maria">Maria Georgieva (maria)</option>
<option value="guest">guest</option>
<option value="peter">Peter Ivanova (peter)</option>
<option value="todor">todor</option>
<!-- TODO: more users will come here -->
</select>
</div>
<div>Message Text:</div>
<div><input type="text" name="text" required id="msgText" /></div>
<div><input type="submit" value="Send" /></div>
</form>
</section>
</main>
<footer>Messaging System - Simple SPA Application</footer>
</div>
</body>
</html>