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