-
-
Notifications
You must be signed in to change notification settings - Fork 200
/
admin.html
412 lines (373 loc) · 21 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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
{% extends 'base.html' %}
{% block body %}
<!-- UNVALIDATED USERS BLOCK -->
{% if unvalidatedUsersArr|length > 0 %}
<form method='post' action='app/controllers/UsersController.php'>
<input type='hidden' name='usersValidate' value='true' />
{{ FormKey.getFormkey|raw }}
<div class='alert alert-danger'>
<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>
{{ 'There are users waiting for validation of their account:'|trans }}
<ul>
{% for user in unvalidatedUsersArr %}
<li>
<label>
<input type='checkbox' name='usersValidateIdArr[]'
value='{{ user.userid }}'> {{ user.fullname|raw }} ({{ user.email }})
</label>
</li>
{% endfor %}
</ul>
<div class='submitButtonDiv'>
<button class='button' type='submit'>{{ 'Validate'|trans }}</button>
</div>
</div>
</form>
{% endif %}
<!-- ADMIN PANEL MAIN MENU -->
<menu>
<ul>
<li class='tabhandle' id='tab1'>{{ 'Team'|trans }}</li>
<li class='tabhandle' id='tab2'>{{ 'Users'|trans }}</li>
<li class='tabhandle' id='tab3'>{{ 'Groups'|trans }}</li>
<li class='tabhandle' id='tab4'>{% trans %}Status{% plural 2 %}Status{% endtrans %}</li>
<li class='tabhandle' id='tab5'>{{ 'Types of items'|trans }}</li>
<li class='tabhandle' id='tab6'>{{ 'Experiments template'|trans }}</li>
<li class='tabhandle' id='tab7'>{{ 'Import CSV'|trans }}</li>
<li class='tabhandle' id='tab8'>{{ 'Import ZIP'|trans }}</li>
</ul>
</menu>
<!-- TAB 1 TEAM CONFIG -->
<div class='divhandle' id='tab1div'>
<div class='box'>
<h3>{{ 'Configure your Team'|trans }}</h3>
<hr>
<form method='post' action='app/controllers/AdminController.php' autocomplete='off'>
<input type='hidden' value='true' name='teamsUpdateFull' />
<p>
<label for='deletable_xp'>{{ 'Users can delete experiments:'|trans }}</label>
<select class='clean-form' name='deletable_xp' id='deletable_xp'>
<option value='1'{{ App.teamConfigArr.deletable_xp ? " selected='selected'" }}>{{ 'Yes'|trans }}</option>
<option value='0'{{ not App.teamConfigArr.deletable_xp ? " selected='selected'" }}>{{ 'No'|trans }}</option>
</select>
<span class='smallgray'>{{ 'An admin account will always be able to delete experiments.'|trans }}</span>
</p>
<p>
<label for='public_db'>{{ 'Anonymous visitors can see database items:'|trans }}</label>
<select class='clean-form' name='public_db' id='public_db'>
<option value='1'{{ App.teamConfigArr.public_db ? " selected='selected'" }}>{{ 'Yes'|trans }}</option>
<option value='0'{{ not App.teamConfigArr.public_db ? " selected='selected'" }}>{{ 'No'|trans }}</option>
</select>
</p>
<p>
<label class="block" for='link_name'>{{ 'Name of the link in the top menu:'|trans }}</label>
<input class="clean-form col-3-form" type='text' value='{{ App.teamConfigArr.link_name }}' name='link_name' id='link_name' />
</p>
<p>
<label class="block" for='link_href'>{{ 'Address where this link should point:'|trans }}</label>
<input class="clean-form col-3-form" type='text' value='{{ App.teamConfigArr.link_href }}' name='link_href' id='link_href' />
</p>
<br>
<span class='button button-neutral togglable-next'>{{ 'Override general timestamping config'|trans }}</span>
<div class='togglable-hidden'>
<p>
<br>
<label class='block' for='stampprovider'>{{ 'URL for external timestamping service:'|trans }}</label>
<input class='clean-form col-3-form' type='url' placeholder='http://zeitstempel.dfn.de/' value='{{ App.teamConfigArr.stampprovider }}' name='stampprovider' id='stampprovider' />
<span class='smallgray'>{{ 'This should be the URL used for %sRFC 3161%s-compliant timestamping requests.'|trans|format("<a href='https://tools.ietf.org/html/rfc3161'>", "</a>")|raw }}</span>
</p>
<p>
<label class='block' for='stampcert'>{{ 'Chain of certificates of the external timestamping service:'|trans }}</label>
<input class='clean-form col-3-form' type='text' placeholder='app/dfn-cert/pki.dfn.pem' value='{{ App.teamConfigArr.stampcert }}' name='stampcert' id='stampcert' />
<span class='smallgray'>{{ "This should point to the chain of certificates used by your external timestamping provider to sign the timestamps.%sLocal path relative to eLabFTW installation directory. You should add it in the 'uploads' folder. The file needs to be in %sPEM-encoded (ASCII)%s format!"|trans|format("<br>", "<a href='https://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail'>", "</a>")|raw }}</span>
</p>
<label class='block' for='stamplogin'>{{ 'Login for external timestamping service:'|trans }}</label>
<input class='clean-form col-3-form' autocomplete='off' type='text' value='{{ App.teamConfigArr.stamplogin }}' name='stamplogin' id='stamplogin' />
<span class='smallgray'>{{ 'This should be the login associated with your timestamping service provider'|trans }}</span>
</p>
<p>
<label class='block' for='stamppass'>{{ 'Password for external timestamping service:'|trans }}</label>
{% if App.teamConfigArr.stamppass|length > 1 %}
<p>{{ 'A password is already set.'|trans }}
{{ '%sClear it%s or change it below:'|trans|format("
<a href='app/controllers/AdminController.php?clearStamppass=1'>",
"</a>"
)|raw }}
</p>
{% endif %}
<input class='clean-form col-3-form' autocomplete='off' type='password' name='stamppass' id='stamppass' />
<span class='smallgray'>{{ 'Your timestamping service provider password'|trans }}</span>
</p>
</div>
<div class='submitButtonDiv'>
<button type='submit' class='button'>Save</button>
</div>
</form>
</div>
</div>
<!-- TAB 2 USERS -->
<div class='divhandle' id='tab2div'>
{{ include('editusers.html') }}
<!-- DELETE USER -->
<ul class='list-group'>
<li class='list-group-item danger-zone-area'>
<p>{{ 'DANGER ZONE'|trans }}</p><hr>
<p><strong>{{ 'Delete an account'|trans }}</strong></p>
<form action='app/controllers/UsersController.php' method='post'>
<!-- form key -->
{{ FormKey.getFormkey|raw }}
<input type='hidden' name='usersDestroy' value='true' />
<label class='block' for='usersDestroyEmail'>{{ 'Type EMAIL ADDRESS of a member to delete this user and all their experiments/files forever:'|trans }}</label>
<input class='clean-form col-3-form' autocomplete='off' type='email' placeholder='Email Address' name='usersDestroyEmail' id='usersDestroyEmail' required />
<label class='block' for='usersDestroyPassword'>{{ 'Type your password:'|trans }}</label>
<input class='clean-form col-3-form' autocomplete='off' type='password' placeholder='Your Password' name='usersDestroyPassword' id='usersDestroyPassword' required />
<div class='center'>
<button type='submitButtonDiv' class='button button-delete'>{{ 'Delete this user!'|trans }}</button>
</div>
</form>
</li>
</ul>
</div>
<!-- TAB 3 TEAM GROUPS -->
<div class='divhandle' id='tab3div'>
<div class='box tooltip-box'>
<h3>{{ 'Manage Groups of Users'|trans }}</h3>
<hr>
<!-- CREATE A GROUP -->
<label class='block' for='teamGroupCreate'>{{ 'Create a group'|trans }}</label>
<input class='clean-form col-3-form' id='teamGroupCreate' type='text' />
<button type='submit' id='teamGroupCreateBtn' class='button'>{{ 'Create'|trans }}</button>
<!-- END CREATE GROUP -->
<div id='team_groups_div'>
<div>
<hr>
<section>
<!-- ADD USER TO GROUP -->
<label class='block' for='teamGroupUserAdd'>{{ 'Add this user'|trans }}</label>
<select class='clean-form col-3-form' id='teamGroupUserAdd'>
{% for user in usersArr %}
<option value='{{ user.userid }}'>{{ user.fullname|raw }}</option>
{% endfor %}
</select>
<label class='block' for='teamGroupGroupAdd'>{{ 'to this group'|trans }}</label>
<select class="clean-form col-3-form" id='teamGroupGroupAdd'>
{% for teamGroup in teamGroupsArr %}
<option value='{{ teamGroup.id }}'>{{ teamGroup.name }}</option>
{% endfor %}
</select>
<button type='submit' id='teamGroupGroupAddBtn' class='button'>{{ 'Add'|trans }}</button>
</section>
<section>
<hr>
<!-- RM USER FROM GROUP -->
<label class='block' for='teamGroupUserRm'>{{ 'Remove this user'|trans }}</label>
<select class="clean-form col-3-form" id='teamGroupUserRm'>
{% for user in usersArr %}
<option value='{{ user.userid }}'>{{ user.fullname|raw }}</option>
{% endfor %}
</select>
<label class='block' for='teamGroupGroupRm'>{{ 'from this group'|trans }}</label>
<select class='clean-form col-3-form' id='teamGroupGroupRm'>
{% for teamGroup in teamGroupsArr %}
<option value='{{ teamGroup.id }}'>{{ teamGroup.name }}</option>
{% endfor %}
</select>
<button type='submit' id='teamGroupGroupRmBtn' class='button button-delete'>{{ 'Remove'|trans }}</button>
</section>
</div>
<!-- SHOW EXISTING GROUPS -->
<hr>
<h3>{{ 'Existing groups'|trans }}</h3>
{% for teamGroup in teamGroupsArr %}
<div class='well'>
<a class='elab-tooltip' style='float:right;' href='#'>
<span>{{ 'Remove this Group'|trans }}</span>
<img class='teamGroupDelete' data-id='{{ teamGroup.id }}' data-confirm="{{ 'Delete this?'|trans }}" src='app/img/small-trash.png' style='float:right' alt='trash' /></a>
<h3 title='Click to Edit' class='inline editable teamgroup_name' id='teamgroup_{{ teamGroup.id }}'>{{ teamGroup.name }}</h3>
<ul class='group-list'>
{% for user in teamGroup.users %}
<li>{{ user.fullname|raw }}</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- END TEAM GROUPS -->
<!-- TAB 4 STATUS -->
<div class='divhandle' id='tab4div'>
<div class='box'>
<h3>{{ 'Add a New Status'|trans }}</h3>
<hr>
<ul class='list-group'>
<li>
<ul class='list-inline'>
<li>{{ 'Name'|trans }} <input type='text' id='statusName' /></li>
<li>{{ 'Color'|trans }} <input class='colorpicker' type='text' id='statusColor' value='000000' /></li>
<li>{{ 'Allow timestamp'|trans }} <input type='checkbox' id='statusTimestamp' /></li>
<li><button class='button' id='statusCreate'>{{ 'Save'|trans }}</button></li>
</ul>
</li>
</ul>
</div>
<div class='box'>
<h3>{{ 'Edit an Existing Status'|trans }}</h3>
<hr>
<ul class='draggable sortable_status list-group'>
{% for status in statusArr %}
<li id='status_{{ status.category_id }}' class='list-group-item'>
<ul class='list-inline'>
<li>{{ 'Name'|trans }} <input required type='text' id='statusName_{{ status.category_id }}' value='{{ status.category }}' /></li>
<li style='color:#{{ status.color }}'>{{ 'Color'|trans }} <input class='colorpicker' type='text' maxlength='6' id='statusColor_{{ status.category_id }}' value='{{ status.color }}' />
</li>
<li>{{ 'Allow timestamp'|trans }} <input type='checkbox' id='statusTimestamp_{{ status.category_id }}' {{ status.is_timestampable ? " checked" }} /></li>
<li><input type='radio' name='defaultRadio' id='statusDefault_{{ status.category_id }}' {{ status.is_default ? " checked" }} />
{{ 'Default status'|trans }}</li>
<li><button data-id='{{ status.category_id }}' class='button statusSave'>{{ 'Save'|trans }}</button></li>
<li><button data-id='{{ status.category_id }}' class='button button-delete statusDestroy' >{{ 'Delete'|trans }}</button></li>
</ul>
</li>
{% endfor %}
</ul>
</div>
</div>
<!-- TAB 5 ITEMS TYPES-->
<div class='divhandle' id='tab5div'>
<div class='box'>
<h3>{{ 'Add a new type of item'|trans }}</h3>
<hr>
<ul class='list-inline'>
<li>{{ 'Name'|trans }} <input type='text' id='itemsTypesName' /></li>
<li>{{ 'Color'|trans }} <input class='colorpicker' type='text' id='itemsTypesColor' value='29AEB9' /></li>
<li><input type='checkbox' id='itemsTypesBookable'> <label for='itemsTypesBookable'>{{ 'Bookable'|trans }} {{ 'in the %sscheduler%s'|trans|format("<a href='team.php'>", "</a>")|raw }}</label></li>
</ul>
<textarea class='mceditable' id='itemsTypesTemplate' /></textarea>
<div class='submitButtonDiv'>
<button id='itemsTypesCreate' class='button'>{{ 'Save'|trans }}</button>
</div>
</div>
<div class='box'>
<h3>{{ 'Database Items Types'|trans }}</h3>
<hr>
<ul class='list-group'>
{% for itemType in itemsTypesArr %}
<li id='itemstypes_{{ itemType.category_id }}' class='list-group-item'>
<ul class='list-inline'>
<li>
{{ 'Name'|trans }} <input type='text' id='itemsTypesName_{{ itemType.category_id }}' value='{{ itemType.category }}' />
</li>
<li style='color:#{{ itemType.color }}'>
{{ 'Color'|trans }} <input class='colorpicker' type='text' style='display:inline' id='itemsTypesColor_{{ itemType.category_id }}' value='{{ itemType.color }}' />
</li>
<li>
<input id='itemsTypesBookable_{{ itemType.category_id }}' type='checkbox' {{ itemType.bookable ? " checked" }} />
<label for='itemsTypesBookable_{{ itemType.category_id }}'>{{ 'Bookable'|trans }}</label>
</li>
<li>
<button data-id='{{ itemType.category_id }}' class='button button-neutral itemsTypesShowEditor'>{{ 'Edit the template'|trans }}</button>
</li>
<li>
<button data-id='{{ itemType.category_id }}' class='button itemsTypesUpdate'>{{ 'Save'|trans }}</button>
</li>
<li>
<button data-id='{{ itemType.category_id }}' class='button button-delete itemsTypesDestroy'>{{ 'Delete'|trans }}</button>
</li>
<!--/li -->
<li class='itemsTypesEditor' id='itemsTypesEditor_{{ itemType.category_id }}'>
<textarea class='mceditable' id='itemsTypesTemplate_{{ itemType.category_id }}' />{{ itemType.template }}</textarea>
</li>
</ul>
{% endfor %}
</ul>
</div>
<div class='box'>
<h3>{{ 'Modify ordering'|trans }}</h3>
<hr>
<ul class='draggable sortable_itemstypes list-group'>
{% for itemType in itemsTypesArr %}
<li class='list-group-item' id='itemstypesOrder_{{ itemType.category_id }}'>{{ itemType.ordering }}
<span style='color:#{{ itemType.color }}'>{{ itemType.category }}</span>
</li>
{% endfor %}
</ul>
</div>
</div>
<!-- TAB 6 COMMON EXPERIMENT TEMPLATE -->
<div class='divhandle' id='tab6div'>
<div class='box'>
<h3>{{ 'Common Experiment Template'|trans }}</h3><hr>
<p>{{ 'This is the default text when someone creates an experiment.'|trans }}</p>
<textarea style='height:400px' data-lang='{{ App.Users.userData.lang }}' class='mceditable' id='commonTplTemplate' />
{{ commonTplBody|raw }}
</textarea>
<div class='submitButtonDiv'>
<button type='submit' class='button'>{{ 'Save'|trans }}</button>
</div>
</div>
</div>
<!-- TAB 7 IMPORT CSV -->
<div class='divhandle' id='tab7div'>
<div class='box'>
<h3>{{ 'Import a CSV File'|trans }}</h3>
<hr>
<p style='text-align:justify'>
{{ "This page will allow you to import a .csv (Excel spreadsheet) file into the database.<br>First you need to open your .xls/.xlsx file in Excel or Libreoffice and save it as .csv.<br>In order to have a good import, the first row should be the column's field names. You can make a tiny import of 3 lines to see if everything works before you import a big file. The third column should be the title."|trans|raw }}
<span class='strong'>{{ "You should make a backup of your database before importing thousands of items!"|trans }}</span>
</p>
<label class='block' for='item_selector_csv'>{{ '1. Select a type of item to import to:'|trans }}</label>
<select class='clean-form col-3-form item-selector' id='item_selector_csv'>
<option selected disabled>--------</option>
{% for itemsType in itemsTypesArr %}
<option value='{{ itemsType.category_id }}' name='type'>{{ itemsType.category }}</option>
{% endfor %}
</select>
<div class='import_block'>
<form enctype='multipart/form-data' action='app/controllers/ImportController.php' method='post'>
<label class='block' for='uploader'>{{ '2. Select a CSV file to import:'|trans }}</label>
<input id='uploader' name='file' type='file' accept='.csv' />
<input name='type' type='hidden' value='csv' />
<div class='submitButtonDiv'>
<button type='submit' class='button'>{{ 'Import CSV'|trans }}</button>
</div>
</form>
</div>
</div>
</div>
<!-- TAB 8 IMPORT ZIP -->
<div class='divhandle' id='tab8div'>
<div class='box'>
<h3>{{ 'Import a ZIP File'|trans }}</h3>
<hr>
<p>
{{ "This page will allow you to import a .elabftw.zip archive."|trans }}
<br><span class='strong'>{{ 'You should make a backup of your database before importing thousands of items!'|trans }}</span>
</p>
<label class='block' for='item_selector_zip'>{{ '1. Select where to import:'|trans }}</label>
<select class='clean-form col-3-form item-selector' id='item_selector_zip'>
<option selected disabled>-------</option>
<option class='disabled-input' disabled>Import items</option>
{% for itemsType in itemsTypesArr %}
<option value='{{ itemsType.category_id }}' name='type'>{{ itemsType.category }}</option>
{% endfor %}
<option class='disabled-input' disabled>Import experiments</option>
{% for user in usersArr %}
<option value='{{ user.userid }}' name='type'>{{ user.fullname|raw }}</option>
{% endfor %}
</select><br>
<div class='import_block'>
<form enctype='multipart/form-data' action='app/controllers/ImportController.php' method='post'>
<label class='block' for='uploader'>{{ '2. Select a ZIP file to import:'|trans }}</label>
<input id='uploader' name='file' type='file' accept='.elabftw.zip' />
<input name='type' type='hidden' value='zip' />
<div class='submitButtonDiv'>
<button type='submit' class='button'>{{ 'Import ZIP'|trans }}</button>
</div>
</form>
</div>
</div>
</div>
<script src='app/js/tinymce-dropzone.min.js'></script>
<script src='app/js/admin.min.js'></script>
<script src='app/js/tabs.min.js'></script>
{% endblock body %}