-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
132 lines (113 loc) · 3.68 KB
/
index.html
File metadata and controls
132 lines (113 loc) · 3.68 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Felicia's Contacts Manager</title>
<script src="javascripts/contacts.js"></script>
<link rel="stylesheet" href="stylesheets/main.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.js"></script>
</head>
<body>
<header>
<a href="#home"><h1>Contacts</h1></a>
<h3></h3>
</header>
<div id="main-page"></div>
<footer>
<p>Developed by <span>Felicia Bacon</span> @ Launch School.</p>
</footer>
</body>
</html>
<script id="main-page" type="text/x-handlebars">
<div class="main-page">
<button class="add-contact-button">Add Contact</button>
<input type="search" name="search" placeholder="Search by Contact Name"></input>
</div>
{{#if contacts}}
{{> contacts }}
{{else}}
{{> no-contacts }}
{{/if}}
</script>
<script id="contacts" data-type="partial" type="text/x-handlebars">
<div class="contacts">
{{#each contacts}}
{{> single-contact}}
{{/each}}
</div>
</script>
<script id="single-contact" data-type="partial" type="text/x-handlebars">
<div class="contact" data_id={{id}}>
<h3>{{full_name}}</h3>
<hr>
<dl>
<dt>Phone Number: </dt>
<dd>{{phone_number}}</dd>
<dt>Email: </dt>
<dd>{{email}}</dd>
<dt>Tags: </dt>
<dd>{{tags}}</dd>
</dl>
<div id="buttons">
<button class="edit-contact-button" data_id={{id}} type="button">Edit</button>
<button class="delete-contact-button" type="button">Delete</button>
</div>
</div>
</script>
<script id="no-contacts" data-type="partial" type="text/x-handlebars">
<div class="no-contacts">
<h2>There are no contacts.</h2>
<button class="add-contact-button">Add Contact</button>
<div>
</script>
<script id="add-contact" type="text/x-handlebars">
<div class="add-contact">
<h2>Create Contact</h2>
<form id="add-contact-form">
<div class="name">
<label for="full_name">Name: </label>
<input type="text" name="full_name" id="full_name" required>
</div>
<div class="email">
<label for="email">Email: </label>
<input type="email" name="email" id="email" required>
</div>
<div class="phone_number">
<label for="phone_number">Phone Number: </label>
<input type="text" name="phone_number" id="phone_number" placeholder="xxx-xxx-xxxx" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}">
</div>
<div class="tags">
<label for="tags"></label>
<button class="submit-tag" type="submit">Add Tag</button>
<input type="text" name="tags" id="tags" value="">
</div>
<button class="submit" type="submit">Submit</button>
<button class="cancel-button" type="button">Cancel</button>
</form>
</div>
</script>
<script id="edit-contact" type="text/x-handlebars">
<div class="edit-contact" data_id={{id}}>
<h2>Edit Contact</h2>
<form id="edit-contact-form">
<div class="name">
<label for="full_name">Name: </label>
<input type="text" name="full_name" id="full_name">
</div>
<div class="email">
<label for="email">Email: </label>
<input type="email" name="email" id="email">
</div>
<div class="phone_number">
<label for="phone_number">Phone Number: </label>
<input type="text" name="phone_number" id="phone_number">
</div>
<div class="tags">
<label for="tags">Tags: </label>
<input type="text" name="tags" id="tags" value="none">
</div>
<button class="submit-button" type="submit">Submit</button>
<button class="cancel-button" type="button">Cancel</button>
</form>
</div>
</script>