2026-09-30 00:49:53 +08:00
|
|
|
<div class="page-head">
|
|
|
|
|
<h1>家庭名册</h1>
|
|
|
|
|
<span class="sub">共 <?= count($people) ?> 人</span>
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<?php if (\App\Auth::isAdmin()): ?>
|
|
|
|
|
<a class="btn btn-sm" href="<?= e(url('people/new')) ?>">添加成员</a>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form class="search" method="get" action="index.php">
|
|
|
|
|
<input type="hidden" name="r" value="people">
|
|
|
|
|
<input class="input" name="q" value="<?= e($q) ?>" placeholder="按姓名、小名或邮箱搜索">
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit">搜索</button>
|
|
|
|
|
<?php if ($q !== ''): ?>
|
|
|
|
|
<a class="link-quiet" href="<?= e(url('people')) ?>">清除</a>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<?php if (!$people): ?>
|
|
|
|
|
<div class="empty">
|
|
|
|
|
<b><?= $q !== '' ? '没有匹配的人' : '名册还是空的' ?></b>
|
|
|
|
|
<?= $q !== '' ? '换个词试试。' : '把家里人加进来,之后观影、旅行的同行人就可以直接从名册里选。' ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<div class="people-grid">
|
|
|
|
|
<?php foreach ($people as $p): ?>
|
|
|
|
|
<a class="person" href="<?= e(url('people/show', ['id' => (int)$p['id']])) ?>">
|
2026-09-30 08:13:07 +08:00
|
|
|
<div class="ph"><img src="<?= e(avatar_url($p['avatar'])) ?>" alt=""></div>
|
2026-09-30 00:49:53 +08:00
|
|
|
<div class="pb">
|
2026-09-30 08:13:07 +08:00
|
|
|
<div class="pname">
|
|
|
|
|
<?= e($p['name']) ?>
|
|
|
|
|
<?php if (!empty($p['is_placeholder'])): ?><span class="badge">待确认</span><?php endif; ?>
|
|
|
|
|
</div>
|
2026-09-30 00:49:53 +08:00
|
|
|
<div class="pmeta">
|
2026-09-30 08:13:07 +08:00
|
|
|
<?php if (!empty($p['label']) && $p['label'] !== '我'): ?>
|
|
|
|
|
<span class="rel-label"><?= e($p['label']) ?></span>
|
2026-09-30 00:49:53 +08:00
|
|
|
<?php endif; ?>
|
2026-09-30 08:13:07 +08:00
|
|
|
<?php
|
|
|
|
|
$r = $p['account_role'] ?? '';
|
|
|
|
|
if ($r === 'admin' && ($p['account_status'] ?? '') === 'active') {
|
|
|
|
|
echo '<span class="badge badge-admin">管理员</span>';
|
|
|
|
|
} elseif ($r === 'guest') {
|
|
|
|
|
echo '<span class="badge">访客</span>';
|
|
|
|
|
} elseif (!empty($p['account_id'])) {
|
|
|
|
|
echo '<span class="badge badge-open">已开通</span>';
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-09-30 00:49:53 +08:00
|
|
|
<?php if (!empty($p['nickname'])): ?> · <?= e($p['nickname']) ?><?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif; ?>
|