-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.html
309 lines (294 loc) · 13.2 KB
/
admin.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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.2/TweenMax.min.js"
integrity="sha256-qGOnfp7iY6DsnB55K7M+0PZjWCtzafRyJh33tgQJkMQ=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="system/pell.min.css" />
<title>admin</title>
<style>
.wrapper {
margin: auto;
width: 800px;
}
.tabs .tab a {
color: rgba(38, 166, 154, 0.7) !important;
/*Custom Text Color*/
}
.tabs .tab a:hover {
color: #26a69a;
/*Custom Color On Hover*/
}
.tabs .tab a:focus.active {
color: #26a69a;
/*Custom Text Color While Active*/
background-color: rgba(38, 166, 154, 0.2);
/*Custom Background Color While Active*/
}
.tabs .indicator {
background-color: #26a69a;
/*Custom Color Of Indicator*/
}
</style>
</head>
<body>
<div class="wrapper">
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s4 blue-text"><a href="#feed">Feed</a></li>
<li class="tab col s4"><a href="#event">Event</a></li>
<li class="tab col s4"><a href="#team">Team</a></li>
</ul>
</div>
<div id="feed" class="col s12">
<div class="row">
<form id='blog_create' class="col s12">
<h3>Add Blog</h3>
<div class="row">
<div class="input-field col s8">
<input id="blog_title" type="text" class="validate" required>
<label for="blog_title">title</label>
</div>
</div>
<div class="row">
<div class="file-field input-field col s8">
<div class="btn">
<span>image</span>
<input id='blog_image' type="file" required>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
</div>
<div class="row">
<h6>content</h6>
<div id="blog-editor" class='card-panel'></div>
</div>
<div class="row">
<button class="btn waves-effect blue" type='submit'> Add Feed</button>
</div>
</form>
</div>
</div>
<div id="event" class="col s12">
<div class="row">
<form id='event_create' class="col s12">
<h3>Event</h3>
<div class="row">
<div class="input-field col s8">
<input id="event_title" type="text" class="validate" required>
<label for="event_title">title</label>
</div>
</div>
<div class="row">
<div class="input-field col s12 m6">
<input id="event_venue" type="text" class="validate" required>
<label for="event_venue">venue</label>
</div>
<div class="input-field col s12 m6">
<input id="event_date" type="text" class="validate datepicker" required>
<label for="event_date">date</label>
</div>
</div>
<div class="row">
<div class="file-field input-field col s8">
<div class="btn">
<span>image</span>
<input id='event_image' type="file" required>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
</div>
<div class="row">
<h6>content</h6>
<div id="event-editor" class='card-panel'></div>
</div>
<div class="row">
<button class="btn waves-effect blue" type='submit'> Add Event</button>
</div>
</form>
</div>
</div>
<div id="team" class="col s12">
<div class="row">
<form id='team_create' class="col s12">
<h3>Team</h3>
<div class="row">
<div class="input-field col s8">
<input id="team_name" type="text" class="validate" required>
<label for="team_name">name</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input id="team_git" type="text" class="validate" required>
<label for="team_git">github account</label>
</div>
<div class="input-field col s6">
<input id="team_facebook" type="text" class="validate" required>
<label for="team_facebook">facebook account</label>
</div>
<div class="input-field col s6">
<input id="team_field" type="text" class="validate" required>
<label for="team_field">subject field</label>
</div>
<div class="input-field col s6">
<input id="team_rank" type="text" class="validate" required>
<label for="team_rank">rank</label>
</div>
</div>
<div class="row">
<div class="file-field input-field col s8">
<div class="btn">
<span>image</span>
<input id='team_image' type="file" required>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="team_bio" class="materialize-textarea"></textarea>
<label for="team_bio">biodata</label>
</div>
</div>
<div class="row">
<button class="btn waves-effect blue" type='submit'> Add Member</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/5.10.0/firebase.js"></script>
<script src='system/functions.js'></script>
<script src='system/data.js'></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
//initialize materialize widgets
let tabs = M.Tabs.init(_class('tabs')[0])
M.Datepicker.init(_class('datepicker')[0])
let content = ''
let ev_content = ''
//custom formatting
let fx = function (t) { var e = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : null; return document.execCommand(t, !1, e) }
let pell_actions = [
'bold',
'underline',
'italic',
'strikethrough',
'heading1',
'heading2',
'paragraph',
'quote',
'olist',
'ulist',
'code',
'line',
'link',
'image',
{
name: 'color red',
icon: "<b style='color:#f44336;'>♦</b>",
title: 'color red',
result: () => pell.exec('foreColor', '#f44336')
},
{
name: 'color blue',
icon: "<b style='color:#2196f3;'>♦</b>",
title: 'color blue',
result: () => pell.exec('foreColor', '#2196f3')
},
{
name: 'highlight',
icon: "<b style='background:#f4ff81;'>H</b>",
title: 'highlight',
result: () => pell.exec('backColor', '#f4ff81')
},
{
name: 'align left',
icon: "<i class='fas fa-align-left'></i>",
title: 'align left',
result: () => pell.exec('justifyLeft', true)
},
{
name: 'align center',
icon: "<i class='fas fa-align-center'></i>",
title: 'align center',
result: () => pell.exec('justifyCenter', true)
},
{
name: 'align right',
icon: "<i class='fas fa-align-right'></i>",
title: 'align right',
result: () => pell.exec('justifyRight', true)
},
]
pell.init({
element: document.getElementById('blog-editor'),
onChange: html => { content = html },
defaultParagraphSeparator: 'div',
styleWithCSS: false,
classes: {
actionbar: 'pell-actionbar',
button: 'pell-button',
content: 'pell-content',
selected: 'pell-button-selected'
},
actions: pell_actions
})
pell.init({
element: document.getElementById('event-editor'),
onChange: html => { ev_content = html },
defaultParagraphSeparator: 'div',
styleWithCSS: false,
classes: {
actionbar: 'pell-actionbar',
button: 'pell-button',
content: 'pell-content',
selected: 'pell-button-selected'
},
actions: pell_actions
})
_id('blog_create').addEventListener('submit', async e => {
e.preventDefault()
let image = await storeImage('blog_image')
let title = _id('blog_title').value
addBlog(title, content, image)
})
_id('event_create').addEventListener('submit', async e => {
e.preventDefault()
let image = await storeImage('event_image')
let title = _id('event_title').value,
date = _id('event_date').value,
venue = _id('event_venue').value
addEvent(title, venue, image, ev_content, date)
})
_id('team_create').addEventListener('submit', async e => {
e.preventDefault()
let image = await storeImage('team_image')
let name = _id('team_name').value,
git = _id('team_git').value,
facebook = _id('team_facebook').value
bio = _id('team_bio').value,
rank = _id('team_rank').value,
field = _id('team_field').value
addTeam(name, git, facebook, bio, rank, field, image)
})
})
</script>
<script src="system/pell.min.js"></script>
</body>
</html>