-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (148 loc) · 6.92 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
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
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="Simple Contacts App">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body>
<div class="container">
<div class="left-pane">
<div id="contact-list"></div>
</div>
<div class="right-pane">
<div id="json"></div>
<div id="action-list"></div>
</div>
</div>
<!-- Templates -->
<script type="text/template" class="template" id="contact-list-template">
<div class="contact-list-container">
<div class="contact-list-header">
<h1>
My Contacts
</h1>
<button class="export-btn" title="Export Contacts">
Export Contacts
<i class="fa fa-arrow-right"></i>
</button>
</div>
<ul class="contact-list-ul">
<% each model %>
<li data-idx="<% print index %>">
<div class="contact-list-item-container slide<% print slide %>" >
<div class="contact-img">
<i class="fa fa-user" style="color: <% print color %>"></i>
</div>
<div class="contact-info">
<div class="contact-info-name">
<% print firstName %> <% print lastName %>
</div>
<div class="contact-info-phone">
<a href="tel: <% print phoneNumber %> " > <% print phoneNumber %></a>
</div>
</div>
<div class="contact-actions">
<button class="remove-contact-btn" data-idx="<% print index %>" title="Remove <% print firstName %>">
<i data-idx="<% print index %>" class="fa fa-trash-o"></i>
</button>
</div>
</div>
</li>
<% end %>
<% empty model %>
<li class="no-contacts">
<div class="no-contacts-container">
<i class="fa fa-phone"></i>
<p>You haven't added any contacts yet! <strong>Add one</strong> below or <strong>import</strong> from the JSON textarea on the right.</p>
</div>
</li>
<% end %>
</ul>
<div class="contact-list-footer">
<h3 class="contact-list-add-title">
Add New Contact:
</h3>
<form id="contact-list-add-form">
<div class="form-block">
<label for="firstname">First Name</label>
<input type="text" required name="firstname" data-formattedname="FirstName" placeholder="Brett">
</div>
<div class="form-block">
<label for="lastname">Last Name</label>
<input type="text" required name="lastname" data-formattedname="LastName" placeholder="Hellman">
</div>
<div class="form-block">
<label for="phonenumber">Phone #</label>
<!-- The regex below was taken from http://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation -->
<input type="tel" required name="phonenumber" pattern="(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$" data-formattedname="PhoneNumber" placeholder="555-555-5555">
</div>
<button type="submit" class="submit-btn" title="Add Contact">
<i class="fa fa-user-plus"></i>
Add Contact
</button>
</form>
</div>
</div>
</script>
<script type="text/template" class="template" id="json-template">
<div class="json-container">
<h3 class="json-title">
Import JSON Contacts
</h3>
<form id="json-import-form">
<div class="form-block">
<textarea name="json" id="json-area">
[{
"First Name": "Brett",
"Last Name": "Hellman",
"Phone Number": "555-555-5555"
},
{
"First Name": "Ron",
"Last Name": "Adams",
"Phone Number": "666-666-6666"
}]
</textarea>
</div>
<div class="form-block form-controls">
<button type="submit" class="submit-btn" title="Add Contact">
<i class="fa fa-arrow-left"></i>
Import to Contacts
</button>
</div>
</form>
</div>
</script>
<script type="text/template" class="template" id="action-list-template">
<div class="action-container">
<h3 class="action-title">
Tracked User Actions
</h3>
<div class="action-list-container">
<ul>
<% eachreverse model %>
<li "action-list-item">
<% print title %>
<span class="timestamp"> (timestamp: <% print timestamp %>)</span>
</li>
<% end %>
</ul>
</div>
</div>
</script>
<!-- End Templates -->
<script src="js/tinymvc.js"></script>
<script src="js/app.js"></script>
<script src="js/models/contact.js"></script>
<script src="js/models/action.js"></script>
<script src="js/views/contactView.js"></script>
<script src="js/views/actionView.js"></script>
<script src="js/views/jsonView.js"></script>
<script src="js/main.js"></script>
</body>
</html>