-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-panel.php
292 lines (278 loc) · 12.6 KB
/
admin-panel.php
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
<div id="dashboard-form">
<h1>ACLED dashboard</h1>
<div class="tabs">
<a class="tab" data-target="#crisis-profile-report">Crisis Profile</a>
<a class="tab" data-target="#country-reports">Country Report</a>
<a class="tab" data-target="#timeline">Timeline</a>
</div>
<section id="crisis-profile-report">
<header>
<h2>Crisis profile</h2>
<button onclick="showModal('#add-crisis-modal');">Add crisis</button>
</header>
<div id="crisis-profile-list">
<header>
<label class="crisis-title">Title</label>
<label class="crisis-date">Date</label>
<label class="crisis-country">Country</label>
<label class="crisis-description">Description</label>
<label class="criris-recent-event">Recent Event</label>
<label class="actions">Actions</label>
</header>
<div class="content">
</div>
</div>
<div class="save-button-container">
<i class="fa fa-save"></i>
<i class="fa fa-spin fa-circle-o-notch" hidden></i>
<button onclick="submitCrisisProfiles(this);">Save</button>
</div>
</section>
<section id="country-reports">
<header>
<h2>Country reports</h2>
</header>
<div class="content">
<div class="input">
<label>Country</label>
<select id="report-country-select" data-target="<?php echo get_home_url().'/?pagename=report_country__'; ?>">
<option value="">Select country</option>
</select>
</div>
<div class="input">
<label>Title</label>
<input type="text" id="report-title-input">
</div>
<div class="input">
<label>Summary</label>
<input type="text" id="report-summary-input">
</div>
<div class="input">
<label>Date</label>
<input type="date" id="report-date-input">
</div>
<div class="input">
<label>Url</label>
<input type="text" id="report-url-input" placeholder="eg: https://www.example.com/report">
</div>
<div class="input">
<label>Image</label>
<input type="file" accept="image/*" id="report-image-input">
</div>
<button id="clear-report-img-preview-button" disabled>Clear preview</button>
<img id="report-img-preview" class="preview" alt="no preview available">
<div class="save-button-container" style="margin-top: 16px">
<i class="fa fa-save"></i>
<i class="fa fa-spin fa-circle-o-notch" hidden></i>
<button onclick="submitReportCountry(this)">Save</button>
</div>
</div>
</section>
<section id="timeline">
<header>
<h2>Timeline</h2>
</header>
<div class="content">
<div class="input">
<label>Select country:</label>
<select id="timeline-country-select" data-target="<?php echo get_home_url().'/?pagename=timeline_country__'; ?>">
<option value="">Select country</option>
</select>
</div>
<label id="timeline-use-static-check-container"><input type="checkbox" id="timeline-use-static-check">Use static image</label>
<div id="timeline-static-image">
<input type="file" accept="image/*" id="timeline-static-image-input">
<img class="preview" id="timeline-static-image-preview" alt="no preview available">
</div>
<div id="timeline-elements">
</div>
<button id="add-timeline-element-btn" onclick="addTimelineElement()">Add timeline element</button>
<div class="timeline-element-template" hidden>
<div class="number"><span contenteditable="true">00</span></div>
<div class="description">
<h5 contenteditable="true">Title</h5>
<p contenteditable="true">Description</p>
</div>
<img alt="click to add image">
<input type="file" accept="image/*" hidden>
<button><i class="fa fa-times"></i></button>
</div>
<div class="save-button-container">
<i class="fa fa-save"></i>
<i class="fa fa-spin fa-circle-o-notch" hidden></i>
<button onclick="submitTimelineCountry(this);">Save</button>
</div>
</div>
</section>
<form id="crisis-profiles-form" method="POST" data-target="<?php echo get_home_url().'/?pagename=post__crisis_profiles'; ?>">
<input type="text" value="" name="crisis-profiles" id="crisis-profiles-input" hidden>
</form>
<form id="recent-event-form" method="POST" data-target="<?php echo get_home_url().'/?pagename=post__recent_event'; ?>">
<input type="text" value="" name="recent-event-data" id="recent-event-data-input" hidden>
</form>
<form id="report-country-form" method="POST" data-target="<?php echo get_home_url().'/?pagename=post__report_country___'; ?>">
<input type="text" value="" name="report-country-data" id="report-country-data-input" hidden>
<input type="text" value="" name="report-country-name" id="report-country-name-input" hidden>
</form>
<form id="timeline-country-form" method="POST" data-target="<?php echo get_home_url().'/?pagename=post__timeline_country___'; ?>">
<input type="text" value="" name="timeline-country-data" id="timeline-country-data-input" hidden>
<input type="text" value="" name="timeline-country-name" id="timeline-country-name-input" hidden>
</form>
</div>
<div class="crisis-profile-template" hidden>
<div class="crisis-title"></div>
<date class="crisis-date"></date>
<div class="crisis-country"></div>
<div class="crisis-description"></div>
<div class="crisis-recent-event"><a><img></a></div>
<div class="actions">
<button class="btn-edit"><i class="fa fa-edit"></i></button>
<button class="btn-delete"><i class="fa fa-trash"></i></button>
</div>
</div>
<div id="modal-container" hidden>
<div id="add-crisis-modal" class="modal" hidden>
<header>
<h3>Add new crisis</h3>
</header>
<div class="content">
<div class="input">
<label>Title</label>
<input type="text" name="crisis-title" class="crisis-title">
</div>
<div class="input">
<label>Country</label>
<select name="crisis-country" class="crisis-country" id="add-crisis-country-select">
<option value="">Select country</option>
</select>
</div>
<div class="input">
<label>Start Date</label>
<input type="date" name="crisis-date" class="crisis-date">
</div>
<div class="input">
<label>End Date</label>
<input type="date" name="crisis-end-date" class="crisis-end-date">
</div>
<div class="input">
<label>Description</label>
<input type="text" name="crisis-description" class="crisis-description">
</div>
<div class="input">
<label>Number of events</label>
<input type="text" name="crisis-number-of-events" class="crisis-number-of-events">
</div>
<div class="input">
<label>Fatalities</label>
<input type="text" name="crisis-fatalities" class="crisis-fatalities">
</div>
<div class="input">
<label>Civilian deaths</label>
<input type="text" name="crisis-number-of-civilian-deaths" class="crisis-number-of-civilian-deaths">
</div>
<div class="input">
<label>Armed active agents</label>
<input type="text" name="crisis-number-of-armed-active-agents" class="crisis-number-of-armed-active-agents">
</div>
<div class="input recent-event-input">
<label>Recent event</label>
<div>
<input type="text" class="crisis-recent-event-url" placeholder="Url (eg: http://www.example.com)">
<input type="file" accept="image/*" id="add-crisis-recent-event-image-input">
</div>
<img class="preview" id="add-crisis-recent-event-image-preview" alt="no preview available">
</div>
<div class="action-buttons">
<button onclick="hideModal()">Cancel</button>
<button id="add-crisis-btn">Add crisis</button>
</div>
</div>
</div>
<div id="edit-crisis-modal" class="modal" hidden>
<header>
<h3>Edit crisis</h3>
</header>
<div class="content">
<div class="input">
<label>Title</label>
<input type="text" name="crisis-title" class="crisis-title">
</div>
<div class="input">
<label>Country</label>
<select name="crisis-country" class="crisis-country" id="edit-crisis-country-select">
<option value="">Select country</option>
</select>
</div>
<div class="input">
<label>Start Date</label>
<input type="date" name="crisis-date" class="crisis-date">
</div>
<div class="input">
<label>End Date</label>
<input type="date" name="crisis-end-date" class="crisis-end-date">
</div>
<div class="input">
<label>Description</label>
<input type="text" name="crisis-description" class="crisis-description">
</div>
<div class="input">
<label>Number of events</label>
<input type="text" name="crisis-number-of-events" class="crisis-number-of-events">
</div>
<div class="input">
<label>Fatalities</label>
<input type="text" name="crisis-fatalities" class="crisis-fatalities">
</div>
<div class="input">
<label>Civilian deaths</label>
<input type="text" name="crisis-number-of-civilian-deaths" class="crisis-number-of-civilian-deaths">
</div>
<div class="input">
<label>Armed active agents</label>
<input type="text" name="crisis-number-of-armed-active-agents" class="crisis-number-of-armed-active-agents">
</div>
<div class="input recent-event-input">
<label>Recent event</label>
<div>
<input type="text" class="crisis-recent-event-url" placeholder="Url (eg: http://www.example.com)">
<input type="file" accept="image/*" id="edit-crisis-recent-event-image-input">
</div>
<img class="preview" id="edit-crisis-recent-event-image-preview" alt="no preview available">
</div>
<div class="action-buttons">
<button onclick="hideModal()">Cancel</button>
<button id="edit-crisis-btn">Save</button>
</div>
</div>
</div>
<div id="add-timeline-country-modal" class="modal" hidden>
<header>
<h3>Add country</h3>
</header>
<div class="content">
<div class="input">
<label>Name</label>
<input type="text" name="timeline-country" id="timeline-country-input">
</div>
<div class="action-buttons">
<button onclick="hideModal()">Cancel</button>
<button id="add-timeline-country-btn">Add</button>
</div>
</div>
</div>
<div id="add-report-country-modal" class="modal" hidden>
<header>
<h3>Add country</h3>
</header>
<div class="content">
<div class="input">
<label>Name</label>
<input type="text" name="report-country" id="report-country-input">
</div>
<div class="action-buttons">
<button onclick="hideModal()">Cancel</button>
<button id="add-report-country-btn">Add</button>
</div>
</div>
</div>
</div>