Skip to content

Commit 295fa88

Browse files
committed
Adding events to refresh page - #220
1 parent 3280475 commit 295fa88

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/classes/helpers/arr.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public static function map(array $array, ?callable $callback = null): array
149149
*
150150
* @template T
151151
* @param T[] $array Array to search.
152-
* @param callable|null $callback Callback function (should return bool),
152+
* @param callable(T)|null $callback Callback function (should return bool),
153153
* @return T[] Array of matching elements.
154154
*/
155155
public static function match(array $array, ?callable $callback = null): array

src/pages/refresh/index-view.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050
<?php else : ?>
5151
<p>There are no Bible readings for today.</p>
5252
<?php endif; ?>
53+
<h3 class="mt-3">Events &amp; Groups</h3>
54+
<?php if ($model->today->events): ?>
55+
<p class="small text-muted">The following events, groups and ministries are taking place today.</p>
56+
<?php foreach ($model->today->events as $e): ?>
57+
<p><?php _h("%s %s", $e->start->format(C::$formats->display_time), $e->title); ?></p>
58+
<?php endforeach; ?>
59+
<?php elseif ($model->today->date->format("N") == 7) : ?>
60+
<p>Ask God to bless today&rsquo;s services.</p>
61+
<?php else: ?>
62+
<p>There are no groups or events today.</p>
63+
<?php endif; ?>
5364
</div>
5465

5566
<div class="col-12 col-md-4 mb-2">

0 commit comments

Comments
 (0)