xref: /webtrees/resources/views/admin/control-panel.phtml (revision 33c343964203a24deeb34413eac7f48bee172865)
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                    <li>
67                        <span class="fa-li"><?= view('icons/wizard') ?></span>
68                        <a href="<?= e(route('analytics')) ?>">
69                            <?= I18N::translate('Tracking and analytics') ?>
70                        </a>
71                    </li>
72                </ul>
73            </div>
74            <div class="col-sm-6">
75                <ul class="fa-ul">
76                    <li>
77                        <span class="fa-li"><?= view('icons/preferences') ?></span>
78                        <a href="<?= e(route('admin-site-logs')) ?>">
79                            <?= I18N::translate('Website logs') ?>
80                        </a>
81                    </li>
82                    <li>
83                        <span class="fa-li"><?= view('icons/preferences') ?></span>
84                        <a href="<?= e(route('admin-clean-data')) ?>">
85                            <?= I18N::translate('Clean up data folder') ?>
86                        </a>
87                    </li>
88                    <li>
89                        <span class="fa-li"><?= view('icons/preferences') ?></span>
90                        <a href="<?= e(route('admin-site-information')) ?>">
91                            <?= I18N::translate('Server information') ?>
92                        </a>
93                    </li>
94                </ul>
95            </div>
96        </div>
97    </div>
98</div>
99
100<!-- FAMILY TREES -->
101<div class="card mb-4 <?= array_sum($changes) ? 'card-outline-danger' : '' ?>">
102    <div class="card-header">
103        <h2 class="mb-0">
104            <?= I18N::translate('Family trees') ?>
105            <span class="badge badge-secondary">
106                    <?= I18N::number(count($all_trees)) ?>
107                </span>
108        </h2>
109    </div>
110    <div class="card-body">
111        <table class="table table-sm">
112            <caption class="sr-only">
113                <?= I18N::translate('Family trees') ?>
114            </caption>
115            <thead>
116                <tr>
117                    <th><?= I18N::translate('Family tree') ?></th>
118                    <th><span class="sr-only"><?= I18N::translate('Manage family trees') ?></span></th>
119                    <th class="text-right"><?= I18N::translate('Pending changes') ?></th>
120                    <th class="d-none d-sm-table-cell text-right"><?= I18N::translate('Individuals') ?></th>
121                    <th class="d-none d-lg-table-cell text-right"><?= I18N::translate('Families') ?></th>
122                    <th class="d-none d-sm-table-cell text-right"><?= I18N::translate('Sources') ?></th>
123                    <th class="d-none d-lg-table-cell text-right"><?= I18N::translate('Repositories') ?></th>
124                    <th class="d-none d-sm-table-cell text-right"><?= I18N::translate('Media') ?></th>
125                    <th class="d-none d-lg-table-cell text-right"><?= I18N::translate('Notes') ?></th>
126                </tr>
127            </thead>
128            <tbody>
129                <?= view('admin/control-panel-tree-list', [
130                    'all_trees'    => $all_trees,
131                    'changes'      => $changes,
132                    'individuals'  => $individuals,
133                    'families'     => $families,
134                    'sources'      => $sources,
135                    'repositories' => $repositories,
136                    'media'        => $media,
137                    'notes'        => $notes,
138                ]); ?>
139            </tbody>
140            <tfoot>
141                <tr>
142                    <th scope="row">
143                        <?= I18N::translate('Total') ?>
144                    </th>
145                    <td></td>
146                    <td class="text-right">
147                        <?= I18N::number(array_sum($changes)) ?>
148                    </td>
149                    <td class="d-none d-sm-table-cell text-right">
150                        <?= I18N::number($individuals->sum()) ?>
151                    </td>
152                    <td class="d-none d-lg-table-cell text-right">
153                        <?= I18N::number($families->sum()) ?>
154                    </td>
155                    <td class="d-none d-sm-table-cell text-right">
156                        <?= I18N::number($sources->sum()) ?>
157                    </td>
158                    <td class="d-none d-lg-table-cell text-right">
159                        <?= I18N::number($repositories->sum()) ?>
160                    </td>
161                    <td class="d-none d-sm-table-cell text-right">
162                        <?= I18N::number($media->sum()) ?>
163                    </td>
164                    <td class="d-none d-lg-table-cell text-right">
165                        <?= I18N::number($notes->sum()) ?>
166                    </td>
167                </tr>
168            </tfoot>
169        </table>
170
171        <ul class="fa-ul">
172            <li>
173                <span class="fa-li"><?= view('icons/preferences') ?></span>
174                <a href="<?= e(route('admin-trees', ['ged' => $tree->name()])) ?>">
175                    <?= I18N::translate('Manage family trees') ?>
176                </a>
177            </li>
178            <li>
179                <span class="fa-li"><?= view('icons/preferences') ?></span>
180                <a href="<?= e(route('tree-page-default-edit')) ?>">
181                    <?= I18N::translate('Set the default blocks for new family trees') ?>
182                </a>
183            </li>
184            <?php if (count($all_trees) > 1) : ?>
185                <li>
186                    <span class="fa-li"><?= view('icons/preferences') ?></span>
187                    <a href="<?= e(route('admin-trees-merge')) ?>">
188                        <?= I18N::translate('Merge family trees') ?>
189                    </a>
190                </li>
191            <?php endif ?>
192        </ul>
193    </div>
194</div>
195
196<!-- USERS -->
197<div class="card mb-4 <?= $unapproved || $unverified ? 'card-outline-danger' : '' ?>">
198    <div class="card-header">
199        <h2 class="mb-0">
200            <?= I18N::translate('Users') ?>
201            <span class="badge badge-secondary">
202                    <?= I18N::number(count($all_users)) ?>
203                </span>
204        </h2>
205    </div>
206    <div class="card-body">
207        <dl class="row">
208            <?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) : ?>
209                <?php if (!empty($list)) : ?>
210                    <dt class="col-sm-3">
211                        <?= $label ?>
212                    </dt>
213                    <dd class="col-sm-9">
214                        <?php foreach ($list as $n => $user) : ?>
215                            <?= $n ? I18N::$list_separator : '' ?>
216                            <a href="<?= e(route('admin-users-edit', ['user_id' => $user->id()])) ?>" dir="auto">
217                                <?= e($user->getRealName()) ?>
218                            </a>
219                        <?php endforeach ?>
220                    </dd>
221                <?php endif ?>
222            <?php endforeach ?>
223        </dl>
224
225        <div class="row">
226            <div class="col-sm-6">
227                <ul class="fa-ul">
228                    <li>
229                        <span class="fa-li"><?= view('icons/preferences') ?></span>
230                        <a href="<?= e(route('admin-users', ['ged' => $tree->name()])) ?>">
231                            <?= I18N::translate('User administration') ?>
232                        </a>
233                    </li>
234                    <li>
235                        <span class="fa-li"><?= view('icons/preferences') ?></span>
236                        <a href="<?= e(route('admin-users-create', ['ged' => $tree->name()])) ?>">
237                            <?= I18N::translate('Add a user') ?>
238                        </a>
239                    </li>
240                    <li>
241                        <span class="fa-li"><?= view('icons/preferences') ?></span>
242                        <a href="<?= e(route('admin-users-cleanup')) ?>">
243                            <?= I18N::translate('Delete inactive users') ?>
244                        </a>
245                    </li>
246                    <li>
247                        <span class="fa-li"><?= view('icons/preferences') ?></span>
248                        <a href="<?= e(route('user-page-default-edit')) ?>">
249                            <?= I18N::translate('Set the default blocks for new users') ?>
250                        </a>
251                    </li>
252                </ul>
253            </div>
254            <div class="col-sm-6">
255                <ul class="fa-ul">
256                    <li>
257                        <span class="fa-li"><?= view('icons/email') ?></span>
258                        <a href="<?= e(route('broadcast', ['to' => 'all'])) ?>">
259                            <?= I18N::translate('Send a message to all users') ?>
260                        </a>
261                    </li>
262                    <li>
263                        <span class="fa-li"><?= view('icons/email') ?></span>
264                        <a href="<?= e(route('broadcast', ['to' => 'never_logged'])) ?>">
265                            <?= I18N::translate('Send a message to users who have never signed in') ?>
266                        </a>
267                    </li>
268                    <li>
269                        <span class="fa-li"><?= view('icons/email') ?></span>
270                        <a href="<?= e(route('broadcast', ['to' => 'last_6mo'])) ?>">
271                            <?= I18N::translate('Send a message to users who have not signed in for 6 months') ?>
272                        </a>
273                    </li>
274                </ul>
275            </div>
276        </div>
277    </div>
278</div>
279
280<!-- MODULES -->
281<div class="card mb-4">
282    <div class="card-header">
283        <h2 class="mb-0">
284            <?= I18N::translate('Modules') ?>
285            <span class="badge badge-secondary">
286                <?= I18N::number(count($all_modules)) ?>
287            </span>
288        </h2>
289    </div>
290
291    <div class="card-body">
292        <ul class="fa-ul">
293            <li>
294                <span class="fa-li"><?= view('icons/preferences') ?></span>
295                <a href="<?= e(route('modules')) ?>">
296                    <?= I18N::translate('Module administration') ?>
297                </a>
298            </li>
299        </ul>
300
301        <div class="row">
302            <div class="col-sm-6">
303                <ul class="fa-ul">
304                    <li>
305                        <span class="fa-li"><?= view('icons/menu') ?></span>
306                        <a href="<?= e(route('menus')) ?>">
307                            <?= I18N::translate('Menus') ?>
308                        </a>
309                    </li>
310                    <li>
311                        <span class="fa-li"><?= view('icons/tab') ?></span>
312                        <a href="<?= e(route('tabs')) ?>">
313                            <?= I18N::translate('Tabs') ?>
314                        </a>
315                    </li>
316                    <li>
317                        <span class="fa-li"><?= view('icons/block') ?></span>
318                        <a href="<?= e(route('blocks')) ?>">
319                            <?= I18N::translate('Blocks') ?>
320                        </a>
321                    </li>
322                    <li>
323                        <span class="fa-li"><?= view('icons/sidebar') ?></span>
324                        <a href="<?= e(route('sidebars')) ?>">
325                            <?= I18N::translate('Sidebars') ?>
326                        </a>
327                    </li>
328                    <li>
329                        <span class="fa-li"><?= view('icons/chart') ?></span>
330                        <a href="<?= e(route('charts')) ?>">
331                            <?= I18N::translate('Charts') ?>
332                        </a>
333                    </li>
334                    <li>
335                        <span class="fa-li"><?= view('icons/report') ?></span>
336                        <a href="<?= e(route('reports')) ?>">
337                            <?= I18N::translate('Reports') ?>
338                        </a>
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                    </li>
346                </ul>
347            </div>
348            <div class="col-sm-6">
349                <ul class="fa-ul">
350                    <?php foreach ($config_modules as $module) : ?>
351                        <li>
352                            <span class="fa-li"><?= view('icons/preferences') ?></span>
353                            <a href="<?= e($module->getConfigLink()) ?>">
354                                <?= $module->title() ?>
355                            </a>
356                        </li>
357                    <?php endforeach ?>
358                </ul>
359            </div>
360        </div>
361    </div>
362</div>
363
364<!-- MEDIA -->
365<div class="card mb-4">
366    <div class="card-header">
367        <h2 class="mb-0">
368            <?= I18N::translate('Media') ?>
369        </h2>
370    </div>
371    <div class="card-body">
372        <ul class="fa-ul">
373            <li>
374                <span class="fa-li"><?= view('icons/preferences') ?></span>
375                <a href="<?= e(route('admin-media')) ?>">
376                    <?= I18N::translate('Manage media') ?>
377                </a>
378            </li>
379            <li>
380                <span class="fa-li"><?= view('icons/preferences') ?></span>
381                <a href="<?= e(route('admin-media-upload')) ?>">
382                    <?= I18N::translate('Upload media files') ?>
383                </a>
384            </li>
385            <li>
386                <span class="fa-li"><?= view('icons/preferences') ?></span>
387                <a href="<?= e(route('admin-fix-level-0-media')) ?>">
388                    <?= I18N::translate('Link media objects to facts and events') ?>
389                </a>
390            </li>
391            <li>
392                <span class="fa-li"><?= view('icons/preferences') ?></span>
393                <a href="<?= e(route('admin-webtrees1-thumbs')) ?>">
394                    <?= I18N::translate('Import custom thumbnails from webtrees version 1') ?>
395                </a>
396            </li>
397        </ul>
398    </div>
399</div>
400
401<!-- MAPS -->
402<div class="card mb-4">
403    <div class="card-header">
404        <h2 class="mb-0">
405            <?= I18N::translate('Map') ?>
406        </h2>
407    </div>
408    <div class="card-body">
409        <div class="row">
410            <div class="col-sm-6">
411                <ul class="fa-ul">
412                    <li>
413                        <span class="fa-li"><?= view('icons/location') ?></span>
414                        <a href="<?= e(route('map-data')) ?>">
415                            <?= I18N::translate('Geographic data') ?>
416                        </a>
417                    </li>
418                </ul>
419            </div>
420            <div class="col-sm-6">
421                <ul class="fa-ul">
422                    <li>
423                        <span class="fa-li"><?= view('icons/map') ?></span>
424                        <a href="<?= e(route('map-provider')) ?>">
425                            <?= I18N::translate('Map provider') ?>
426                        </a>
427                    </li>
428                </ul>
429            </div>
430        </div>
431    </div>
432</div>
433
434<!-- OLD FILES -->
435<?php if (!empty($files_to_delete)) : ?>
436    <div class="card mb-4 card-outline-danger">
437        <div class="card-header">
438            <h2 class="mb-0">
439                <?= I18N::translate('Old files found') ?>
440            </h2>
441        </div>
442        <div class="card-body">
443            <p>
444                <?= I18N::translate('Files have been found from a previous version of webtrees. Old files can sometimes be a security risk. You should delete them.') ?>
445            </p>
446            <ul class="list-unstyled">
447                <?php foreach ($files_to_delete as $file_to_delete) : ?>
448                    <li dir="ltr"><code><?= e($file_to_delete) ?></code></li>
449                <?php endforeach ?>
450            </ul>
451        </div>
452    </div>
453<?php endif ?>
454