xref: /webtrees/resources/views/admin/control-panel.phtml (revision c5e5c1cea5f7d35d6fd56eb77c9a68e91d21befe)
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_errors as $server_error) : ?>
18            <p class="alert alert-danger"><?= $server_error ?></p>
19        <?php endforeach ?>
20
21        <?php foreach ($server_warnings as $server_warning) : ?>
22            <p class="alert alert-warning"><?= $server_warning ?></p>
23        <?php endforeach ?>
24
25        <p class="card-text">
26            <?= /* I18N: %s is a URL/link to the project website */
27            I18N::translate('Support and documentation can be found at %s.', '<a href="https://webtrees.net/">webtrees.net</a>') ?>
28        </p>
29        <p class="card-text ">
30            <?php if ($latest_version === '') : ?>
31                <?= I18N::translate('No upgrade information is available.') ?>
32            <?php elseif (version_compare(Webtrees::VERSION, $latest_version) < 0) : ?>
33                <?= I18N::translate('A new version of webtrees is available.') ?>
34                <a href="<?= e(route('upgrade')) ?>" class="error">
35                    <?= /* I18N: %s is a version number */
36                    I18N::translate('Upgrade to webtrees %s.', e($latest_version)) ?>
37                </a>
38            <?php else : ?>
39                <?= I18N::translate('This is the latest version of webtrees. No upgrade is available.') ?>
40            <?php endif ?>
41        </p>
42
43        <div class="row">
44            <div class="col-sm-6">
45                <ul class="fa-ul">
46                    <li>
47                        <span class="fa-li"><?= view('icons/preferences') ?></span>
48                        <a href="<?= e(route('admin-site-preferences')) ?>">
49                            <?= I18N::translate('Website preferences') ?>
50                        </a>
51                    </li>
52                    <li>
53                        <span class="fa-li"><?= view('icons/preferences') ?></span>
54                        <a href="<?= e(route('admin-site-mail')) ?>">
55                            <?= I18N::translate('Sending email') ?>
56                        </a>
57                    </li>
58                    <li>
59                        <span class="fa-li"><?= view('icons/preferences') ?></span>
60                        <a href="<?= e(route('admin-site-registration')) ?>">
61                            <?= I18N::translate('Sign-in and registration') ?>
62                        </a>
63                    </li>
64                    <li>
65                        <span class="fa-li"><?= view('icons/preferences') ?></span>
66                        <a href="<?= e(route('admin-site-languages')) ?>">
67                            <?= I18N::translate('Languages') ?>
68                        </a>
69                    </li>
70                </ul>
71            </div>
72            <div class="col-sm-6">
73                <ul class="fa-ul">
74                    <li>
75                        <span class="fa-li"><?= view('icons/preferences') ?></span>
76                        <a href="<?= e(route('admin-site-logs')) ?>">
77                            <?= I18N::translate('Website logs') ?>
78                        </a>
79                    </li>
80                    <li>
81                        <span class="fa-li"><?= view('icons/preferences') ?></span>
82                        <a href="<?= e(route('admin-clean-data')) ?>">
83                            <?= I18N::translate('Clean up data folder') ?>
84                        </a>
85                    </li>
86                    <li>
87                        <span class="fa-li"><?= view('icons/preferences') ?></span>
88                        <a href="<?= e(route('admin-site-information')) ?>">
89                            <?= I18N::translate('Server information') ?>
90                        </a>
91                    </li>
92                </ul>
93            </div>
94        </div>
95    </div>
96</div>
97
98<!-- FAMILY TREES -->
99<!-- d-block allows tables in cards in Chrome -->
100<div class="card mb-4 d-block <?= 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            <span class="badge badge-secondary">
285                <?= I18N::number(count($all_modules)) ?>
286            </span>
287        </h2>
288    </div>
289
290    <div class="card-body">
291        <ul class="fa-ul">
292            <li>
293                <span class="fa-li"><?= view('icons/preferences') ?></span>
294                <a href="<?= e(route('modules')) ?>">
295                    <?= I18N::translate('Module administration') ?>
296                </a>
297            </li>
298        </ul>
299
300        <div class="row">
301            <div class="col-sm-6">
302                <ul class="fa-ul">
303                    <li>
304                        <span class="fa-li"><?= view('icons/menu') ?></span>
305                        <a href="<?= e(route('menus')) ?>">
306                            <?= I18N::translate('Menus') ?>
307                        </a>
308                        <?= view('components/badge', ['count' => $menu_modules->count(), 'context' => 'primary']) ?>
309                    </li>
310                    <li>
311                        <span class="fa-li"><?= view('icons/tab') ?></span>
312                        <a href="<?= e(route('tabs')) ?>">
313                            <?= I18N::translate('Tabs') ?>
314                            <?= view('components/badge', ['count' => $tab_modules->count(), 'context' => 'primary']) ?>
315                        </a>
316                    </li>
317                    <li>
318                        <span class="fa-li"><?= view('icons/block') ?></span>
319                        <a href="<?= e(route('blocks')) ?>">
320                            <?= I18N::translate('Blocks') ?>
321                        </a>
322                        <?= view('components/badge', ['count' => $block_modules->count(), 'context' => 'primary']) ?>
323                    </li>
324                    <li>
325                        <span class="fa-li"><?= view('icons/sidebar') ?></span>
326                        <a href="<?= e(route('sidebars')) ?>">
327                            <?= I18N::translate('Sidebars') ?>
328                        </a>
329                        <?= view('components/badge', ['count' => $sidebar_modules->count(), 'context' => 'primary']) ?>
330                    </li>
331                    <li>
332                        <span class="fa-li"><?= view('icons/chart') ?></span>
333                        <a href="<?= e(route('charts')) ?>">
334                            <?= I18N::translate('Charts') ?>
335                        </a>
336                        <?= view('components/badge', ['count' => $chart_modules->count(), 'context' => 'primary']) ?>
337                    </li>
338                    <li>
339                        <span class="fa-li"><?= view('icons/list') ?></span>
340                        <a href="<?= e(route('lists')) ?>">
341                            <?= I18N::translate('Lists') ?>
342                        </a>
343                        <?= view('components/badge', ['count' => $list_modules->count(), 'context' => 'primary']) ?>
344                    </li>
345                    <li>
346                        <span class="fa-li"><?= view('icons/report') ?></span>
347                        <a href="<?= e(route('reports')) ?>">
348                            <?= I18N::translate('Reports') ?>
349                        </a>
350                        <?= view('components/badge', ['count' => $report_modules->count(), 'context' => 'primary']) ?>
351                    </li>
352                    <li>
353                        <span class="fa-li"><?= view('icons/footer') ?></span>
354                        <a href="<?= e(route('footers')) ?>">
355                            <?= I18N::translate('Footers') ?>
356                        </a>
357                        <?= view('components/badge', ['count' => $footer_modules->count(), 'context' => 'primary']) ?>
358                    </li>
359                    <li>
360                        <span class="fa-li"><?= view('icons/analytics') ?></span>
361                        <a href="<?= e(route('analytics')) ?>">
362                            <?= I18N::translate('Tracking and analytics') ?>
363                        </a>
364                        <?= view('components/badge', ['count' => $analytics_modules->count(), 'context' => 'primary']) ?>
365                    </li>
366                    <li>
367                        <span class="fa-li"><?= view('icons/history') ?></span>
368                        <a href="<?= e(route('history')) ?>">
369                            <?= I18N::translate('Historic events') ?>
370                        </a>
371                        <?= view('components/badge', ['count' => $history_modules->count(), 'context' => 'primary']) ?>
372                    </li>
373                    <li>
374                        <span class="fa-li"><?= view('icons/theme') ?></span>
375                        <a href="<?= e(route('themes')) ?>">
376                            <?= I18N::translate('Themes') ?>
377                        </a>
378                        <?= view('components/badge', ['count' => $theme_modules->count(), 'context' => 'primary']) ?>
379                    </li>
380                    <li>
381                        <span class="fa-li"><?= view('icons/language') ?></span>
382                        <a href="<?= e(route('languages')) ?>">
383                            <?= I18N::translate('Languages') ?>
384                        </a>
385                        <?= view('components/badge', ['count' => $language_modules->count(), 'context' => 'primary']) ?>
386                    </li>
387                </ul>
388            </div>
389            <div class="col-sm-6">
390                <ul class="fa-ul">
391                    <?php foreach ($config_modules as $module) : ?>
392                        <li>
393                            <span class="fa-li"><?= view('icons/preferences') ?></span>
394                            <a href="<?= e($module->getConfigLink()) ?>">
395                                <?= $module->title() ?>
396                            </a>
397                        </li>
398                    <?php endforeach ?>
399                </ul>
400            </div>
401        </div>
402    </div>
403</div>
404
405<!-- MEDIA -->
406<div class="card mb-4">
407    <div class="card-header">
408        <h2 class="mb-0">
409            <?= I18N::translate('Media') ?>
410        </h2>
411    </div>
412    <div class="card-body">
413        <ul class="fa-ul">
414            <li>
415                <span class="fa-li"><?= view('icons/preferences') ?></span>
416                <a href="<?= e(route('admin-media')) ?>">
417                    <?= I18N::translate('Manage media') ?>
418                </a>
419            </li>
420            <li>
421                <span class="fa-li"><?= view('icons/preferences') ?></span>
422                <a href="<?= e(route('admin-media-upload')) ?>">
423                    <?= I18N::translate('Upload media files') ?>
424                </a>
425            </li>
426            <li>
427                <span class="fa-li"><?= view('icons/preferences') ?></span>
428                <a href="<?= e(route('admin-fix-level-0-media')) ?>">
429                    <?= I18N::translate('Link media objects to facts and events') ?>
430                </a>
431            </li>
432            <li>
433                <span class="fa-li"><?= view('icons/preferences') ?></span>
434                <a href="<?= e(route('admin-webtrees1-thumbs')) ?>">
435                    <?= I18N::translate('Import custom thumbnails from webtrees version 1') ?>
436                </a>
437            </li>
438        </ul>
439    </div>
440</div>
441
442<!-- MAPS -->
443<div class="card mb-4">
444    <div class="card-header">
445        <h2 class="mb-0">
446            <?= I18N::translate('Map') ?>
447        </h2>
448    </div>
449    <div class="card-body">
450        <div class="row">
451            <div class="col-sm-6">
452                <ul class="fa-ul">
453                    <li>
454                        <span class="fa-li"><?= view('icons/location') ?></span>
455                        <a href="<?= e(route('map-data')) ?>">
456                            <?= I18N::translate('Geographic data') ?>
457                        </a>
458                    </li>
459                </ul>
460            </div>
461            <div class="col-sm-6">
462                <ul class="fa-ul">
463                    <li>
464                        <span class="fa-li"><?= view('icons/map') ?></span>
465                        <a href="<?= e(route('map-provider')) ?>">
466                            <?= I18N::translate('Map provider') ?>
467                        </a>
468                    </li>
469                </ul>
470            </div>
471        </div>
472    </div>
473</div>
474
475<!-- OLD FILES -->
476<?php if (!empty($files_to_delete)) : ?>
477    <div class="card mb-4 card-outline-danger">
478        <div class="card-header">
479            <h2 class="mb-0">
480                <?= I18N::translate('Old files found') ?>
481            </h2>
482        </div>
483        <div class="card-body">
484            <p>
485                <?= I18N::translate('Files have been found from a previous version of webtrees. Old files can sometimes be a security risk. You should delete them.') ?>
486            </p>
487            <ul class="list-unstyled">
488                <?php foreach ($files_to_delete as $file_to_delete) : ?>
489                    <li dir="ltr"><code><?= e($file_to_delete) ?></code></li>
490                <?php endforeach ?>
491            </ul>
492        </div>
493    </div>
494<?php endif ?>
495