-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-user.js
More file actions
132 lines (124 loc) · 4.68 KB
/
add-user.js
File metadata and controls
132 lines (124 loc) · 4.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
132
class AddUser {
constructor(containerSelector) {
this.container = document.body.querySelector(containerSelector);
this.pageName = 'Keypad';
this.users = users;
}
createHeaderSource(){
return `
<header class="header">
<div class="container top-radius">
<h2>${this.pageName}</h2>
</div>
</header>
`;
}
createMainSource(){
return `
<main class="main">
<div class="container">
<div class="edit-main-info">
<div class="edit-foto">
<button class="add-foto-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add foto</span></button>
</div>
<div class="main-info-holder">
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>First Name</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>Last Name</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>Company</span>
</button>
</div>
</div>
</div>
<div class="scroll-holder">
<div class="edit-info">
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add mobile phone</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add home phone</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add email</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add address</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add birthday</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add social profile</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add field</span>
</button>
</div>
<div class="edit-field">
<button href="#" class="delete-contact">delete contact</button>
</div>
</div>
</div>
</div>
</main>
`;
}
_createFooterIcon(iconData){
return `
<a href="${iconData.href}" class="tab ${(iconData.active?'active':'')}">
<span class="glyphicon glyphicon-${iconData.icon}" aria-hidden="true"></span>
<span class = "tab-text">${iconData.title}</span>
</a>`
}
createFooterSource(){
return `
<footer class="footer">
<div class="container bottom-radius">
<nav class="main-nav">
${this._createFooterIcon( { href: "index.html",title: "Contacts",icon: "search"})}
${this._createFooterIcon( { href: "keypad.html",title: "Keypad",icon: "th"})}
${this._createFooterIcon( { href: "edit-contact.html",title: "Edit contact",icon: "pencil"})}
${this._createFooterIcon( { href: "user.html",title: "User",icon: "user"})}
${this._createFooterIcon( { href: "add-user.html",title: "Add user",icon: "plus", active: true})}
</nav>
</div>
</footer>
`;
}
createPhoneSource(){
return `
${this.createHeaderSource()}
${this.createMainSource()}
${this.createFooterSource()}
`;
}
render(){
const phoneSource = this.createPhoneSource();
this.container.innerHTML = phoneSource;
}
}
const addUser = new AddUser('.container-holder');
addUser.render();