xref: /webtrees/resources/views/modules/stories/list.phtml (revision 84586c024c68dbfa3b15df636ed2b74037428442)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<h2 class="wt-page-title"><?= $title ?></h2>
5
6<table id="story_table" class="w-100">
7    <thead>
8        <tr>
9            <th><?= I18N::translate('Story title') ?></th>
10            <th><?= I18N::translate('Individual') ?></th>
11        </tr>
12    </thead>
13    <tbody>
14        <?php foreach ($stories as $story) : ?>
15            <tr>
16                <td>
17                    <?= e($story->title) ?>
18                </td>
19                <td>
20                    <a href="<?= e($story->individual->url()) ?>#tab-stories">
21                        <?= $story->individual->getFullName() ?>
22                    </a>
23                </td>
24            </tr>
25        <?php endforeach ?>
26    </tbody>
27</table>
28
29<?php View::push('javascript') ?>
30<script>
31  $("#story_table").dataTable({
32    dom: '<"H"pf<"dt-clear">irl>t<"F"pl>',
33    autoWidth: false,
34    paging: true,
35    pagingType: "full_numbers",
36    lengthChange: true,
37    filter: true,
38    info: true,
39    sorting: [[0,"asc"]],
40    columns: [
41        /* 0-name */ null,
42      /* 1-NAME */ null
43    ],
44    <?= I18N::datatablesI18N() ?>
45  });
46
47</script>
48<?php View::endpush() ?>
49