xref: /webtrees/resources/views/individual-page-images.phtml (revision 0f5fd22fb1857ad87285e5357592434d47b1f3bf)
1*0f5fd22fSGreg Roach<?php
2*0f5fd22fSGreg Roach
3*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Auth;
4*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Fact;
5*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
6*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\I18N;
7*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Individual;
8*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Media;
9*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Module\ModuleSidebarInterface;
10*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Module\ModuleTabInterface;
11*0f5fd22fSGreg Roachuse Fisharebest\Webtrees\Tree;
12*0f5fd22fSGreg Roachuse Illuminate\Support\Collection;
13*0f5fd22fSGreg Roach
14*0f5fd22fSGreg Roach/**
15*0f5fd22fSGreg Roach * @var string                             $age
16*0f5fd22fSGreg Roach * @var Collection<Media>                  $individual_media
17*0f5fd22fSGreg Roach * @var Collection<Fact>                   $name_records
18*0f5fd22fSGreg Roach * @var Individual                         $record
19*0f5fd22fSGreg Roach * @var Collection<Fact>                   $sex_records
20*0f5fd22fSGreg Roach * @var Collection<string>                 $shares
21*0f5fd22fSGreg Roach * @var Collection<ModuleSidebarInterface> $sidebars
22*0f5fd22fSGreg Roach * @var Collection<ModuleTabInterface>     $tabs
23*0f5fd22fSGreg Roach * @var Tree                               $tree
24*0f5fd22fSGreg Roach * @var string                             $user_link
25*0f5fd22fSGreg Roach */
26*0f5fd22fSGreg Roach?>
27*0f5fd22fSGreg Roach
28*0f5fd22fSGreg Roach<?php if ($individual_media->isNotEmpty() || $tree->getPreference('USE_SILHOUETTE') === '1') : ?>
29*0f5fd22fSGreg Roach    <div class="col-sm-3">
30*0f5fd22fSGreg Roach        <?php if ($individual_media->isEmpty()) : ?>
31*0f5fd22fSGreg Roach            <div class="img-thumbnail">
32*0f5fd22fSGreg Roach                <i class="wt-individual-silhouette wt-individual-silhouette-<?= strtolower($record->sex()) ?>"></i>
33*0f5fd22fSGreg Roach            </div>
34*0f5fd22fSGreg Roach        <?php elseif ($individual_media->count() === 1) : ?>
35*0f5fd22fSGreg Roach            <?= $individual_media->first()->displayImage(200, 260, 'crop', ['class' => 'img-thumbnail img-fluid w-100']) ?>
36*0f5fd22fSGreg Roach        <?php else : ?>
37*0f5fd22fSGreg Roach            <div id="individual-images" class="carousel slide" data-ride="carousel" data-interval="false">
38*0f5fd22fSGreg Roach                <div class="carousel-inner">
39*0f5fd22fSGreg Roach                    <?php foreach ($individual_media as $n => $media_file) : ?>
40*0f5fd22fSGreg Roach                        <div class="carousel-item <?= $n === 0 ? 'active' : '' ?>">
41*0f5fd22fSGreg Roach                            <?= $media_file->displayImage(200, 260, 'crop', ['class' => 'img-thumbnail img-fluid w-100']) ?>
42*0f5fd22fSGreg Roach                        </div>
43*0f5fd22fSGreg Roach                    <?php endforeach ?>
44*0f5fd22fSGreg Roach                </div>
45*0f5fd22fSGreg Roach                <a class="carousel-control-prev" href="#individual-images" role="button" data-slide="prev">
46*0f5fd22fSGreg Roach                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
47*0f5fd22fSGreg Roach                    <span class="sr-only"><?= I18N::translate('previous') ?></span>
48*0f5fd22fSGreg Roach                </a>
49*0f5fd22fSGreg Roach                <a class="carousel-control-next" href="#individual-images" role="button" data-slide="next">
50*0f5fd22fSGreg Roach                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
51*0f5fd22fSGreg Roach                    <span class="sr-only"><?= I18N::translate('next') ?></span>
52*0f5fd22fSGreg Roach                </a>
53*0f5fd22fSGreg Roach            </div>
54*0f5fd22fSGreg Roach        <?php endif ?>
55*0f5fd22fSGreg Roach
56*0f5fd22fSGreg Roach        <?php if (Auth::isEditor($record->tree())) : ?>
57*0f5fd22fSGreg Roach            <div class="text-center">
58*0f5fd22fSGreg Roach                <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
59*0f5fd22fSGreg Roach                    <?= I18N::translate('Add a media object') ?>
60*0f5fd22fSGreg Roach                </a>
61*0f5fd22fSGreg Roach            </div>
62*0f5fd22fSGreg Roach        <?php endif ?>
63*0f5fd22fSGreg Roach    </div>
64*0f5fd22fSGreg Roach<?php endif ?>
65