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