myPrayerJournal/src/public/journal.php

58 lines
2.3 KiB
PHP

<?php
/**
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
*/
declare(strict_types=1);
use MyPrayerJournal\Auth;
use MyPrayerJournal\UI\{Component, Layout};
require '../start.php';
if ($_SERVER['REQUEST_METHOD'] <> 'GET') not_found();
Auth::requireUser();
$user = Auth::user();
$name = $user['given_name'] ?? 'Your';
Layout::pageHead('Journal'); ?>
<article class="container-fluid mt-3">
<h2 class=pb-3><?=$name?><?=$name == 'Your' ? '' : '&rsquo;s'?> Prayer Journal</h2>
<p class="pb-3 text-center">
<?=Component::pageLink('/request/edit?id=new', Component::icon('add_box') . ' Add a Prayer Request',
['class' => 'btn btn-primary'])?>
<p hx-get=/components/journal-items hx-swap=outerHTML hx-trigger=load hx-target=this>
Loading your prayer journal&hellip;
<div id=notesModal class="modal fade" tabindex=-1 aria-labelledby=nodesModalLabel aria-hidden=true>
<div class="modal-dialog modal-dialog-scrollable">
<div class=modal-content>
<div class=modal-header>
<h5 class=modal-title id=nodesModalLabel>Add Notes to Prayer Request</h5>
<button type=button class=btn-close data-bs-dismiss=modal aria-label=Close></button>
</div>
<div class=modal-body id=notesBody></div>
<div class=modal-footer>
<button type=button id=notesDismiss class="btn btn-secondary" data-bs-dismiss=modal>Close</button>
</div>
</div>
</div>
</div>
<div id=snoozeModal class="modal fade" tabindex=-1 aria-labelledby=snoozeModalLabel aria-hidden=true>
<div class="modal-dialog modal-sm">
<div class=modal-content>
<div class=modal-header>
<h5 class=modal-title id=snoozeModalLabel>Snooze Prayer Request</h5>
<button type=button class=btn-close data-bs-dismiss=modal aria-label=Close></button>
</div>
<div class=modal-body id=snoozeBody></div>
<div class=modal-footer>
<button type=button id=snoozeDismiss class="btn btn-secondary" data-bs-dismiss=modal>Close</button>
</div>
</div>
</div>
</div>
</article><?php
Layout::pageFoot();