diff --git a/src/MyPrayerJournal/Handlers.fs b/src/MyPrayerJournal/Handlers.fs index b6b3792..4d0d9f5 100644 --- a/src/MyPrayerJournal/Handlers.fs +++ b/src/MyPrayerJournal/Handlers.fs @@ -528,7 +528,7 @@ let routes = [ GET_HEAD [ route "journal-items" Components.journalItems // done routef "request/%s/add-notes" Components.addNotes // done - routef "request/%s/item" Components.requestItem // not used + routef "request/%s/item" Components.requestItem routef "request/%s/notes" Components.notes // done routef "request/%s/snooze" Components.snooze // done ] diff --git a/src/lib/UI.php b/src/lib/UI.php index 73302f8..ed34392 100644 --- a/src/lib/UI.php +++ b/src/lib/UI.php @@ -168,6 +168,44 @@ class UI return $dtFrom > $dtTo ? "$value ago" : "in $value"; } + public static function requestItem(Request $req): void + { + $btnClass = "btn btn-light mx-2"; + $restoreBtn = fn(string $id, string $link, string $title) => + ''; ?> +
' . $req->currentText();
+ if ($req->isSnoozed() || $req->isPending() || $req->isAnswered()) { ?>
+
+ isSnoozed():
+ echo 'Snooze expires '; self::relativeDate($req->snoozedUntil);
+ break;
+ case $req->isPending():
+ echo 'Request appears next '; self::relativeDate($req->showAfter);
+ break;
+ default:
+ echo 'Answered '; self::relativeDate($req->history[0]->asOf);
+ } ?>
+
+
' . $req->currentText();
- if ($req->isSnoozed() || $req->isPending() || $req->isAnswered()) { ?>
-
- isSnoozed():
- echo 'Snooze expires '; self::relativeDate($req->snoozedUntil);
- break;
- case $req->isPending():
- echo 'Request appears next '; self::relativeDate($req->showAfter);
- break;
- default:
- echo 'Answered '; self::relativeDate($req->history[0]->asOf);
- } ?>
-
-