xref: /webtrees/resources/views/modules/stories/tab.phtml (revision 24f2a3af38709f9bf0a739b30264240d20ba34e8)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4use Fisharebest\Webtrees\Individual;
5use Fisharebest\Webtrees\Tree;
6
7/**
8 * @var bool            $is_admin
9 * @var Individual      $individual
10 * @var array<stdClass> $stories
11 * @var Tree            $tree
12 */
13
14?>
15
16<div class="wt-tab-stories py-4">
17    <?php foreach ($stories as $story) : ?>
18        <div class="story_title descriptionbox text-center rela">
19            <?= e($story->title) ?>
20        </div>
21        <div class="story_body optionbox">
22            <?= $story->story_body ?>
23        </div>
24        <?php if ($is_admin) : ?>
25            <div class="story_edit">
26                <a href="<?= e(route('module', ['module' => 'stories', 'action' => 'AdminEdit', 'block_id' => $story->block_id, 'tree' => $tree->name(), 'url' => $individual->url()])) ?>">
27                    <?= I18N::translate('Edit the story') ?>
28                </a>
29            </div>
30        <?php endif ?>
31    <?php endforeach ?>
32
33    <?php if ($is_admin && $stories === []) : ?>
34        <div>
35            <a href="<?= e(route('module', ['module' => 'stories', 'action' => 'AdminEdit', 'xref' => $individual->xref(), 'tree' => $tree->name(), 'url' => $individual->url()])) ?>">
36                <?= I18N::translate('Add a story') ?>
37            </a>
38        </div>
39    <?php endif ?>
40</div>
41