171378461SGreg Roach<?php 271378461SGreg Roach 310e06497SGreg Roachdeclare(strict_types=1); 410e06497SGreg Roach 571378461SGreg Roachuse Fisharebest\Webtrees\Auth; 671378461SGreg Roachuse Fisharebest\Webtrees\I18N; 7dc270d8cSGreg Roachuse Fisharebest\Webtrees\Tree; 8dc270d8cSGreg Roachuse Illuminate\Support\Collection; 9dc270d8cSGreg Roach 10dc270d8cSGreg Roach/** 1136779af1SGreg Roach * @var Collection<int,object> $articles 12dc270d8cSGreg Roach * @var int $block_id 13dc270d8cSGreg Roach * @var int $limit 14dc270d8cSGreg Roach * @var Tree $tree 15dc270d8cSGreg Roach */ 1671378461SGreg Roach 1771378461SGreg Roach?> 18dd6b2bfcSGreg Roach 1954c1ab5eSGreg Roach<?php if ($articles->isEmpty()) : ?> 20dd6b2bfcSGreg Roach <?= I18N::translate('No news articles have been submitted.') ?> 21dd6b2bfcSGreg Roach<?php endif ?> 22dd6b2bfcSGreg Roach 23dd6b2bfcSGreg Roach<?php foreach ($articles as $n => $article) : ?> 247c2c99faSGreg Roach <?php if ($n === $limit && count($articles) > $limit) : ?> 25dd6b2bfcSGreg Roach <p> 26315eb316SGreg Roach <button class="btn btn-sm btn-secondary" data-bs-toggle="collapse" data-bs-target="#more-news-<?= e($block_id) ?>" role="button" aria-expanded="false" aria-controls="more-news-<?= e($block_id) ?>"> 27d09f5bccSGreg Roach <?= view('icons/add') ?> 28d09f5bccSGreg Roach <?= I18N::translate('show more') ?> 29d09f5bccSGreg Roach </button> 30dd6b2bfcSGreg Roach </p> 31dd6b2bfcSGreg Roach <div class="collapse" id="more-news-<?= e($block_id) ?>"> 32dd6b2bfcSGreg Roach <?php endif ?> 33dd6b2bfcSGreg Roach 34dd6b2bfcSGreg Roach <div class="news_box"> 3551aa34daSGreg Roach <div class="news_title" dir="auto"><?= $article->subject ?></div> 364459dc9aSGreg Roach <div class="news_date"><?= view('components/datetime', ['timestamp' => $article->updated]) ?></div> 3751aa34daSGreg Roach <div dir="auto"><?= $article->body ?></div> 38dd6b2bfcSGreg Roach 39dd6b2bfcSGreg Roach <?php if (Auth::isManager($tree)) : ?> 40dd6b2bfcSGreg Roach <hr> 41d72b284aSGreg Roach <form method="post" action="<?= e(route('module', ['module' => 'user_blog', 'action' => 'DeleteJournal', 'news_id' => $article->news_id, 'tree' => $tree->name()])) ?>"> 42d72b284aSGreg Roach <a class="btn btn-link" href="<?= e(route('module', ['module' => 'user_blog', 'action' => 'EditJournal', 'news_id' => $article->news_id, 'tree' => $tree->name()])) ?>"> 43dd6b2bfcSGreg Roach <?= I18N::translate('Edit') ?> 44dd6b2bfcSGreg Roach </a> 45dd6b2bfcSGreg Roach | 46*1270d276SGreg Roach <button class="btn btn-link" type="submit" data-wt-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($article->subject)) ?>"> 47dd6b2bfcSGreg Roach <?= I18N::translate('Delete') ?> 48dd6b2bfcSGreg Roach </button> 4981443e3cSGreg Roach 5081443e3cSGreg Roach <?= csrf_field() ?> 51dd6b2bfcSGreg Roach </form> 52dd6b2bfcSGreg Roach <?php endif ?> 53dd6b2bfcSGreg Roach </div> 54dd6b2bfcSGreg Roach<?php endforeach ?> 55dd6b2bfcSGreg Roach 567c2c99faSGreg Roach<?php if (count($articles) > $limit) : ?> 57dd6b2bfcSGreg Roach </div> 58dd6b2bfcSGreg Roach<?php endif ?> 59dd6b2bfcSGreg Roach 60dd6b2bfcSGreg Roach<p> 61d72b284aSGreg Roach <a class="btn btn-link" href="<?= e(route('module', ['module' => 'user_blog', 'action' => 'EditJournal', 'tree' => $tree->name()])) ?>"> 62fdd33a18SGreg Roach <?= I18N::translate('Add a journal entry') ?> 63dd6b2bfcSGreg Roach </a> 64dd6b2bfcSGreg Roach</p> 65