From b1d6fbc4d740324d96d7fe2677fb15b9b59d20ea Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 16 Jan 2025 20:21:42 +0000 Subject: follow requests --- templates/actor_profile.php | 10 +++++++++- templates/actor_profile_pending_follow.php | 21 +++++++++++++++++++++ templates/follow_requests_page.php | 9 +++++++++ templates/side_navigation.php | 13 +++++++++++++ templates/skeleton.php | 11 +++++++++++ templates/unread_indicator.php | 1 + 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 templates/actor_profile_pending_follow.php create mode 100644 templates/follow_requests_page.php create mode 100644 templates/side_navigation.php create mode 100644 templates/unread_indicator.php (limited to 'templates') diff --git a/templates/actor_profile.php b/templates/actor_profile.php index c480d21..0dc3ccd 100644 --- a/templates/actor_profile.php +++ b/templates/actor_profile.php @@ -5,7 +5,13 @@ $user = UserAccount::findByCurrentSession(); ?>
- $actor]); ?> + + + + $actor]); ?> + + +
displayName ?>
@getFullHandle() ?>
@@ -26,6 +32,8 @@ $user = UserAccount::findByCurrentSession(); id != $user->actor->id): ?>
+ followsPending($user->actor)) + call_template('actor_profile_pending_follow', ['subject' => $actor, 'object' => $user->actor]); ?> follows($user->actor)): ?> diff --git a/templates/actor_profile_pending_follow.php b/templates/actor_profile_pending_follow.php new file mode 100644 index 0000000..2f49fcd --- /dev/null +++ b/templates/actor_profile_pending_follow.php @@ -0,0 +1,21 @@ + + +
+ +
+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/templates/follow_requests_page.php b/templates/follow_requests_page.php new file mode 100644 index 0000000..f93601c --- /dev/null +++ b/templates/follow_requests_page.php @@ -0,0 +1,9 @@ + __('followRequests.pageTitle')], function () { + global $actors; + if (count($actors) == 0) { + call_template('placeholder_text'); + } + foreach ($actors as $actor) { + call_template('actor_profile', ['actor' => $actor, 'addLink' => true]); + } +}); \ No newline at end of file diff --git a/templates/side_navigation.php b/templates/side_navigation.php new file mode 100644 index 0000000..d9a2dfd --- /dev/null +++ b/templates/side_navigation.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/templates/skeleton.php b/templates/skeleton.php index 6eb6bd1..fced6b8 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -1,4 +1,6 @@ @@ -44,6 +46,15 @@ $user = Digitigrade\Model\UserAccount::findByCurrentSession(); [ + [ + 'href' => '/followrequests', + 'icon' => 'person_add', + 'label' => __('navigation.followRequests'), + 'unreadCount' => FollowRelation::countWhere("object = ? AND status = 'pending'", [$user->actor->id]) + ], + ['href' => '/logout', 'icon' => 'logout', 'label' => __('navigation.logout')] + ]]); } ?> diff --git a/templates/unread_indicator.php b/templates/unread_indicator.php new file mode 100644 index 0000000..bacacc3 --- /dev/null +++ b/templates/unread_indicator.php @@ -0,0 +1 @@ + \ No newline at end of file -- cgit v1.3