aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/actor_profile.php
blob: c480d21a58a467a53ff6190d336328a12ca03405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
use Digitigrade\Model\UserAccount;

$user = UserAccount::findByCurrentSession();
?>
<div class="fullProfile">
    <div class="basicInfo">
        <?php call_template('actor_avatar', ['actor' => $actor]); ?>
        <div>
            <div class="displayName"><?= $actor->displayName ?></div>
            <div class="handle">@<?= $actor->getFullHandle() ?></div>
            <div class="joinedDate"><?= sprintf(__('user.profile.createdAt'), $actor->created->format('Y-m-d')) ?></div>
        </div>
        <div>
            <?php if (!$actor->isLocal): ?>
                <a class="icon material-symbols-outlined" href="<?= $actor->homepage ?>"
                    title="<?= __('user.profile.openRemote') ?>" target="_blank">open_in_new</a>
            <?php endif; ?>
        </div>
    </div>
    <?php if (isset($actor->bio) && $actor->bio != '') { ?>
        <p class="bio"><?= $actor->bio ?></p>
    <?php } else {
        call_template('placeholder_text', ['message' => __('user.profile.bio.placeholder')]);
    } ?>

    <?php if (isset($user) && $actor->id != $user->actor->id): ?>
        <div class="followInfo">
            <?php if ($actor->follows($user->actor)): ?>
                <?= __('user.profile.followsYou') ?>
            <?php endif; ?>
            <?php call_template('actor_profile_follow_button', ['actor' => $actor, 'user' => $user]); ?>
        </div>
    <?php endif; ?>
</div>