xref: /webtrees/resources/views/admin/control-panel.phtml (revision 0c0910bf0f275a14f35d2ccdf698f91f79e269d4)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\CreateTreePage;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\Module\ModuleConfigInterface;
6use Fisharebest\Webtrees\Module\ModuleCustomInterface;
7use Fisharebest\Webtrees\Webtrees;
8use Illuminate\Support\Collection;
9
10/**
11 * @var string     $latest_version
12 * @var string     $title
13 * @var Collection $server_errors
14 * @var Collection $server_warnings
15 */
16
17?>
18
19<h1><?= $title ?></h1>
20
21<!-- WEBSITE / WEBTREES -->
22<div class="card mb-4">
23    <div class="card-header">
24        <h2 class="mb-0">
25            <?= I18N::translate('Website') ?>
26            <span class="badge badge-secondary" dir="ltr">
27                <?= e(Webtrees::VERSION) ?>
28            </span>
29        </h2>
30    </div>
31    <div class="card-body">
32        <?php foreach ($server_errors as $server_error) : ?>
33            <p class="alert alert-danger"><?= $server_error ?></p>
34        <?php endforeach ?>
35
36        <?php foreach ($server_warnings as $server_warning) : ?>
37            <p class="alert alert-warning"><?= $server_warning ?></p>
38        <?php endforeach ?>
39
40        <p class="card-text">
41            <?= /* I18N: %s is a URL/link to the project website */
42            I18N::translate('Support and documentation can be found at %s.', '<a href="https://webtrees.net/">webtrees.net</a>') ?>
43        </p>
44        <p class="card-text ">
45            <?php if ($latest_version === '') : ?>
46                <?= I18N::translate('No upgrade information is available.') ?>
47            <?php elseif (version_compare(Webtrees::VERSION, $latest_version) < 0) : ?>
48                <?= I18N::translate('A new version of webtrees is available.') ?>
49                <a href="<?= e(route('upgrade')) ?>" class="error">
50                    <?= /* I18N: %s is a version number */
51                    I18N::translate('Upgrade to webtrees %s.', e($latest_version)) ?>
52                </a>
53            <?php else : ?>
54                <?= I18N::translate('This is the latest version of webtrees. No upgrade is available.') ?>
55            <?php endif ?>
56        </p>
57
58        <div class="row">
59            <div class="col-sm-6">
60                <ul class="fa-ul">
61                    <li>
62                        <span class="fa-li"><?= view('icons/preferences') ?></span>
63                        <a href="<?= e(route('admin-site-preferences')) ?>">
64                            <?= I18N::translate('Website preferences') ?>
65                        </a>
66                    </li>
67                    <li>
68                        <span class="fa-li"><?= view('icons/preferences') ?></span>
69                        <a href="<?= e(route('admin-site-mail')) ?>">
70                            <?= I18N::translate('Sending email') ?>
71                        </a>
72                    </li>
73                    <li>
74                        <span class="fa-li"><?= view('icons/preferences') ?></span>
75                        <a href="<?= e(route('admin-site-registration')) ?>">
76                            <?= I18N::translate('Sign-in and registration') ?>
77                        </a>
78                    </li>
79                </ul>
80            </div>
81            <div class="col-sm-6">
82                <ul class="fa-ul">
83                    <li>
84                        <span class="fa-li"><?= view('icons/preferences') ?></span>
85                        <a href="<?= e(route('admin-site-logs')) ?>">
86                            <?= I18N::translate('Website logs') ?>
87                        </a>
88                    </li>
89                    <li>
90                        <span class="fa-li"><?= view('icons/preferences') ?></span>
91                        <a href="<?= e(route('admin-clean-data')) ?>">
92                            <?= I18N::translate('Clean up data folder') ?>
93                        </a>
94                    </li>
95                    <li>
96                        <span class="fa-li"><?= view('icons/preferences') ?></span>
97                        <a href="<?= e(route('admin-site-information')) ?>">
98                            <?= I18N::translate('Server information') ?>
99                        </a>
100                    </li>
101                </ul>
102            </div>
103        </div>
104    </div>
105</div>
106
107<!-- FAMILY TREES -->
108<div class="card mb-4 <?= array_sum($changes) ? 'card-outline-danger' : '' ?>">
109    <div class="card-header">
110        <h2 class="mb-0">
111            <?= I18N::translate('Family trees') ?>
112            <span class="badge badge-secondary">
113                    <?= I18N::number(count($all_trees)) ?>
114                </span>
115        </h2>
116    </div>
117    <div class="card-body">
118        <ul class="fa-ul">
119            <li>
120                <span class="fa-li"><?= view('icons/add') ?></span>
121                <a href="<?= e(route(CreateTreePage::class)) ?>">
122                    <?= I18N::translate('Create a family tree') ?>
123                </a>
124            </li>
125            <li>
126                <span class="fa-li"><?= view('icons/preferences') ?></span>
127                <a href="<?= e(route('manage-trees')) ?>">
128                    <?= I18N::translate('Manage family trees') ?>
129                </a>
130            </li>
131            <li>
132                <span class="fa-li"><?= view('icons/block') ?></span>
133                <a href="<?= e(route('tree-page-default-edit')) ?>">
134                    <?= I18N::translate('Set the default blocks for new family trees') ?>
135                </a>
136            </li>
137            <?php if (count($all_trees) > 1) : ?>
138                <li>
139                    <span class="fa-li"><?= view('icons/merge') ?></span>
140                    <a href="<?= e(route('admin-trees-merge')) ?>">
141                        <?= I18N::translate('Merge family trees') ?>
142                    </a>
143                </li>
144            <?php endif ?>
145        </ul>
146
147        <table class="table table-sm">
148            <caption class="sr-only">
149                <?= I18N::translate('Family trees') ?>
150            </caption>
151            <thead>
152                <tr>
153                    <th><?= I18N::translate('Family tree') ?></th>
154                    <th>
155                        <span class="sr-only"><?= I18N::translate('Manage family trees') ?></span>
156                    </th>
157                    <th><?= I18N::translate('Pending changes') ?></th>
158                    <th class="d-none d-sm-table-cell"><?= I18N::translate('Individuals') ?></th>
159                    <th class="d-none d-lg-table-cell"><?= I18N::translate('Families') ?></th>
160                    <th class="d-none d-sm-table-cell"><?= I18N::translate('Sources') ?></th>
161                    <th class="d-none d-lg-table-cell"><?= I18N::translate('Repositories') ?></th>
162                    <th class="d-none d-sm-table-cell"><?= I18N::translate('Media') ?></th>
163                    <th class="d-none d-lg-table-cell"><?= I18N::translate('Notes') ?></th>
164                </tr>
165            </thead>
166            <tbody>
167                <?= view('admin/control-panel-tree-list', [
168                    'all_trees'              => $all_trees,
169                    'changes'                => $changes,
170                    'families'               => $families,
171                    'individuals'            => $individuals,
172                    'media'                  => $media,
173                    'notes'                  => $notes,
174                    'repositories'           => $repositories,
175                    'sources'                => $sources,
176                    'family_list_module'     => $family_list_module,
177                    'individual_list_module' => $individual_list_module,
178                    'media_list_module'      => $media_list_module,
179                    'note_list_module'       => $note_list_module,
180                    'repository_list_module' => $repository_list_module,
181                    'source_list_module'     => $source_list_module,
182                ]) ?>
183            </tbody>
184            <tfoot>
185                <tr>
186                    <th scope="row">
187                        <?= I18N::translate('Total') ?>
188                    </th>
189                    <td></td>
190                    <td class="align-digits">
191                        <?= I18N::number(array_sum($changes)) ?>
192                    </td>
193                    <td class="d-none d-sm-table-cell align-digits">
194                        <?= I18N::number($individuals->sum()) ?>
195                    </td>
196                    <td class="d-none d-lg-table-cell align-digits">
197                        <?= I18N::number($families->sum()) ?>
198                    </td>
199                    <td class="d-none d-sm-table-cell align-digits">
200                        <?= I18N::number($sources->sum()) ?>
201                    </td>
202                    <td class="d-none d-lg-table-cell align-digits">
203                        <?= I18N::number($repositories->sum()) ?>
204                    </td>
205                    <td class="d-none d-sm-table-cell align-digits">
206                        <?= I18N::number($media->sum()) ?>
207                    </td>
208                    <td class="d-none d-lg-table-cell align-digits">
209                        <?= I18N::number($notes->sum()) ?>
210                    </td>
211                </tr>
212            </tfoot>
213        </table>
214    </div>
215</div>
216
217<!-- USERS -->
218<div class="card mb-4 <?= $unapproved || $unverified ? 'card-outline-danger' : '' ?>">
219    <div class="card-header">
220        <h2 class="mb-0">
221            <?= I18N::translate('Users') ?>
222            <span class="badge badge-secondary">
223                    <?= I18N::number(count($all_users)) ?>
224                </span>
225        </h2>
226    </div>
227    <div class="card-body">
228        <dl class="row">
229            <?php foreach ([I18N::translate('Administrators') => $administrators, I18N::translate('Managers') => $managers, I18N::translate('Moderators') => $moderators, I18N::translate('Not verified by the user') => $unverified, I18N::translate('Not approved by an administrator') => $unapproved] as $label => $list) : ?>
230                <?php if (!empty($list)) : ?>
231                    <dt class="col-sm-3">
232                        <?= $label ?>
233                    </dt>
234                    <dd class="col-sm-9">
235                        <?php foreach ($list as $n => $user) : ?>
236                            <?= $n ? I18N::$list_separator : '' ?>
237                            <a href="<?= e(route('admin-users-edit', ['user_id' => $user->id()])) ?>" dir="auto">
238                                <?= e($user->realName()) ?>
239                            </a>
240                        <?php endforeach ?>
241                    </dd>
242                <?php endif ?>
243            <?php endforeach ?>
244        </dl>
245
246        <div class="row">
247            <div class="col-sm-6">
248                <ul class="fa-ul">
249                    <li>
250                        <span class="fa-li"><?= view('icons/preferences') ?></span>
251                        <a href="<?= e(route('admin-users')) ?>">
252                            <?= I18N::translate('User administration') ?>
253                        </a>
254                    </li>
255                    <li>
256                        <span class="fa-li"><?= view('icons/preferences') ?></span>
257                        <a href="<?= e(route('admin-users-create')) ?>">
258                            <?= I18N::translate('Add a user') ?>
259                        </a>
260                    </li>
261                    <li>
262                        <span class="fa-li"><?= view('icons/preferences') ?></span>
263                        <a href="<?= e(route('admin-users-cleanup')) ?>">
264                            <?= I18N::translate('Delete inactive users') ?>
265                        </a>
266                    </li>
267                    <li>
268                        <span class="fa-li"><?= view('icons/preferences') ?></span>
269                        <a href="<?= e(route('user-page-default-edit')) ?>">
270                            <?= I18N::translate('Set the default blocks for new users') ?>
271                        </a>
272                    </li>
273                </ul>
274            </div>
275            <div class="col-sm-6">
276                <ul class="fa-ul">
277                    <li>
278                        <span class="fa-li"><?= view('icons/email') ?></span>
279                        <a href="<?= e(route('broadcast', ['to' => 'all'])) ?>">
280                            <?= I18N::translate('Send a message to all users') ?>
281                        </a>
282                    </li>
283                    <li>
284                        <span class="fa-li"><?= view('icons/email') ?></span>
285                        <a href="<?= e(route('broadcast', ['to' => 'never_logged'])) ?>">
286                            <?= I18N::translate('Send a message to users who have never signed in') ?>
287                        </a>
288                    </li>
289                    <li>
290                        <span class="fa-li"><?= view('icons/email') ?></span>
291                        <a href="<?= e(route('broadcast', ['to' => 'last_6mo'])) ?>">
292                            <?= I18N::translate('Send a message to users who have not signed in for 6 months') ?>
293                        </a>
294                    </li>
295                </ul>
296            </div>
297        </div>
298    </div>
299</div>
300
301<!-- MODULES -->
302<div class="card mb-4">
303    <div class="card-header">
304        <h2 class="mb-0">
305            <?= I18N::translate('Modules') ?>
306            <?= view('components/badge', ['count' => $all_modules_enabled->count(), 'total' => $all_modules_disabled->count(), 'context' => 'secondary']) ?>
307        </h2>
308    </div>
309
310    <div class="card-body">
311        <ul class="fa-ul">
312            <li>
313                <span class="fa-li"><?= view('icons/module') ?></span>
314                <a href="<?= e(route('modules')) ?>">
315                    <?= I18N::translate('All modules') ?>
316                </a>
317                <?= view('components/badge', ['count' => $all_modules_enabled->count(), 'total' => $all_modules_disabled->count(), 'context' => 'primary']) ?>
318            </li>
319        </ul>
320
321        <div class="row">
322            <div class="col-sm-4">
323                <h3>
324                    <?= I18N::translate('Genealogy') ?>
325                </h3>
326
327                <ul class="fa-ul">
328                    <li>
329                        <span class="fa-li"><?= view('icons/menu') ?></span>
330                        <a href="<?= e(route('menus')) ?>">
331                            <?= I18N::translate('Menus') ?>
332                        </a>
333                        <?= view('components/badge', ['count' => $menu_modules_enabled->count(), 'total' => $menu_modules_disabled->count(), 'context' => 'primary']) ?>
334                    </li>
335                    <li>
336                        <span class="fa-li"><?= view('icons/chart') ?></span>
337                        <a href="<?= e(route('charts')) ?>">
338                            <?= I18N::translate('Charts') ?>
339                        </a>
340                        <?= view('components/badge', ['count' => $chart_modules_enabled->count(), 'total' => $chart_modules_disabled->count(), 'context' => 'primary']) ?>
341                    </li>
342                    <li>
343                        <span class="fa-li"><?= view('icons/list') ?></span>
344                        <a href="<?= e(route('lists')) ?>">
345                            <?= I18N::translate('Lists') ?>
346                        </a>
347                        <?= view('components/badge', ['count' => $list_modules_enabled->count(), 'total' => $list_modules_disabled->count(), 'context' => 'primary']) ?>
348                    </li>
349                    <li>
350                        <span class="fa-li"><?= view('icons/report') ?></span>
351                        <a href="<?= e(route('reports')) ?>">
352                            <?= I18N::translate('Reports') ?>
353                        </a>
354                        <?= view('components/badge', ['count' => $report_modules_enabled->count(), 'total' => $report_modules_disabled->count(), 'context' => 'primary']) ?>
355                    </li>
356                </ul>
357
358                <h3>
359                    <?= I18N::translate('Website') ?>
360                </h3>
361
362                <ul class="fa-ul">
363                    <li>
364                        <span class="fa-li"><?= view('icons/footer') ?></span>
365                        <a href="<?= e(route('footers')) ?>">
366                            <?= I18N::translate('Footers') ?>
367                        </a>
368                        <?= view('components/badge', ['count' => $footer_modules_enabled->count(), 'total' => $footer_modules_disabled->count(), 'context' => 'primary']) ?>
369                    </li>
370                    <li>
371                        <span class="fa-li"><?= view('icons/analytics') ?></span>
372                        <a href="<?= e(route('analytics')) ?>">
373                            <?= I18N::translate('Tracking and analytics') ?>
374                        </a>
375                        <?= view('components/badge', ['count' => $analytics_modules_enabled->count(), 'total' => $analytics_modules_disabled->count(), 'context' => 'primary']) ?>
376                    </li>
377                    <li>
378                        <span class="fa-li"><?= view('icons/theme') ?></span>
379                        <a href="<?= e(route('themes')) ?>">
380                            <?= I18N::translate('Themes') ?>
381                        </a>
382                        <?= view('components/badge', ['count' => $theme_modules_enabled->count(), 'total' => $theme_modules_disabled->count(), 'context' => 'primary']) ?>
383                    </li>
384                    <li>
385                        <span class="fa-li"><?= view('icons/language') ?></span>
386                        <a href="<?= e(route('languages')) ?>">
387                            <?= I18N::translate('Languages') ?>
388                        </a>
389                        <?= view('components/badge', ['count' => $language_modules_enabled->count(), 'total' => $language_modules_disabled->count(), 'context' => 'primary']) ?>
390                    </li>
391                </ul>
392
393            </div>
394
395            <div class="col-sm-4">
396
397                <h3>
398                    <?= I18N::translate('Home page') ?>
399                </h3>
400
401                <ul class="fa-ul">
402                    <li>
403                        <span class="fa-li"><?= view('icons/block') ?></span>
404                        <a href="<?= e(route('blocks')) ?>">
405                            <?= I18N::translate('Blocks') ?>
406                        </a>
407                        <?= view('components/badge', ['count' => $block_modules_enabled->count(), 'total' => $block_modules_disabled->count(), 'context' => 'primary']) ?>
408                    </li>
409                </ul>
410
411                <h3>
412                    <?= I18N::translate('Individual page') ?>
413                </h3>
414
415                <ul class="fa-ul">
416                    <li>
417                        <span class="fa-li"><?= view('icons/tab') ?></span>
418                        <a href="<?= e(route('tabs')) ?>">
419                            <?= I18N::translate('Tabs') ?>
420                            <?= view('components/badge', ['count' => $tab_modules_enabled->count(), 'total' => $tab_modules_disabled->count(), 'context' => 'primary']) ?>
421                        </a>
422                    </li>
423                    <li>
424                        <span class="fa-li"><?= view('icons/sidebar') ?></span>
425                        <a href="<?= e(route('sidebars')) ?>">
426                            <?= I18N::translate('Sidebars') ?>
427                        </a>
428                        <?= view('components/badge', ['count' => $sidebar_modules_enabled->count(), 'total' => $sidebar_modules_disabled->count(), 'context' => 'primary']) ?>
429                    </li>
430                    <li>
431                        <span class="fa-li"><?= view('icons/history') ?></span>
432                        <a href="<?= e(route('history')) ?>">
433                            <?= I18N::translate('Historic events') ?>
434                        </a>
435                        <?= view('components/badge', ['count' => $history_modules_enabled->count(), 'total' => $history_modules_disabled->count(), 'context' => 'primary']) ?>
436                    </li>
437                </ul>
438
439            </div>
440
441            <div class="col-sm-4">
442
443                <h3>
444                    <?= I18N::translate('Other') ?>
445                </h3>
446
447                <ul class="fa-ul">
448                    <?php foreach ($other_modules as $module) : ?>
449                        <li>
450                            <span class="fa-li"><?= view('icons/module') ?></span>
451
452                            <?php if ($module->isEnabled()): ?>
453                                <?php if ($module instanceof ModuleConfigInterface): ?>
454                                    <a href="<?= e($module->getConfigLink()) ?>">
455                                    <?= $module->title() ?>
456                                    <span class="fa"><?= view('icons/preferences') ?></span>
457                                    </a>
458                                <?php else : ?>
459                                    <?= $module->title() ?>
460                                <?php endif ?>
461                            <?php else : ?>
462                                <span class="text-muted">
463                                    <span class="fa-li"><?= view('icons/module') ?></span>
464                                     <?= $module->title() ?>
465                                    <?php if ($module instanceof ModuleConfigInterface): ?>
466                                        <span class="fa"><?= view('icons/preferences') ?></span>
467                                    <?php endif ?>
468                                    </span>
469                                </span>
470                            <?php endif ?>
471
472                            <?php if ($module instanceof ModuleCustomInterface): ?>
473                                <?= view('admin/custom-module-info', ['module' => $module]) ?>
474                            <?php endif ?>
475                        </li>
476                    <?php endforeach ?>
477                </ul>
478            </div>
479        </div>
480    </div>
481</div>
482
483<!-- MEDIA -->
484<div class="card mb-4">
485    <div class="card-header">
486        <h2 class="mb-0">
487            <?= I18N::translate('Media') ?>
488        </h2>
489    </div>
490    <div class="card-body">
491        <ul class="fa-ul">
492            <li>
493                <span class="fa-li"><?= view('icons/preferences') ?></span>
494                <a href="<?= e(route('admin-media')) ?>">
495                    <?= I18N::translate('Manage media') ?>
496                </a>
497            </li>
498            <li>
499                <span class="fa-li"><?= view('icons/preferences') ?></span>
500                <a href="<?= e(route('admin-media-upload')) ?>">
501                    <?= I18N::translate('Upload media files') ?>
502                </a>
503            </li>
504            <li>
505                <span class="fa-li"><?= view('icons/preferences') ?></span>
506                <a href="<?= e(route('admin-fix-level-0-media')) ?>">
507                    <?= I18N::translate('Link media objects to facts and events') ?>
508                </a>
509            </li>
510            <li>
511                <span class="fa-li"><?= view('icons/preferences') ?></span>
512                <a href="<?= e(route('admin-webtrees1-thumbs')) ?>">
513                    <?= I18N::translate('Import custom thumbnails from webtrees version 1') ?>
514                </a>
515            </li>
516        </ul>
517    </div>
518</div>
519
520<!-- MAPS -->
521<div class="card mb-4">
522    <div class="card-header">
523        <h2 class="mb-0">
524            <?= I18N::translate('Map') ?>
525        </h2>
526    </div>
527    <div class="card-body">
528        <div class="row">
529            <div class="col-sm-6">
530                <ul class="fa-ul">
531                    <li>
532                        <span class="fa-li"><?= view('icons/location') ?></span>
533                        <a href="<?= e(route('map-data')) ?>">
534                            <?= I18N::translate('Geographic data') ?>
535                        </a>
536                    </li>
537                </ul>
538            </div>
539            <div class="col-sm-6">
540                <ul class="fa-ul">
541                    <li>
542                        <span class="fa-li"><?= view('icons/map') ?></span>
543                        <a href="<?= e(route('map-provider')) ?>">
544                            <?= I18N::translate('Map provider') ?>
545                        </a>
546                    </li>
547                </ul>
548            </div>
549        </div>
550    </div>
551</div>
552
553<!-- OLD FILES -->
554<?php if (!empty($files_to_delete)) : ?>
555    <div class="card mb-4 card-outline-danger">
556        <div class="card-header">
557            <h2 class="mb-0">
558                <?= I18N::translate('Old files found') ?>
559            </h2>
560        </div>
561        <div class="card-body">
562            <p>
563                <?= I18N::translate('Files have been found from a previous version of webtrees. Old files can sometimes be a security risk. You should delete them.') ?>
564            </p>
565            <ul class="list-unstyled">
566                <?php foreach ($files_to_delete as $file_to_delete) : ?>
567                    <li dir="ltr">
568                        <code><?= e($file_to_delete) ?></code>
569                    </li>
570                <?php endforeach ?>
571            </ul>
572        </div>
573    </div>
574<?php endif ?>
575