38 lines
3.0 KiB
PHP
38 lines
3.0 KiB
PHP
<x-layouts.admin>
|
|
<x-slot name="title">用户分组</x-slot>
|
|
<x-slot name="buttons"><a href="{{ route('system-settings.groups.create') }}" class="settings-primary">创建分组</a></x-slot>
|
|
<x-slot name="content">
|
|
<div class="my-6" data-settings-workspace>
|
|
@include('system_settings.partials.navigation')
|
|
<nav class="mb-4 text-sm" aria-label="页面位置"><a class="settings-accent" href="{{ route('system-settings.users.index') }}">用户管理</a><span class="mx-2">/</span><span aria-current="page">用户分组</span></nav>
|
|
<p class="mb-4 text-sm text-gray-600">用户可加入多个分组,获得各组页面权限的并集。分组不授予管理员身份;用户单独配置优先。</p>
|
|
@if ($errors->any())<div role="alert" class="mb-4 text-sm text-red-700">{{ $errors->first() }}</div>@endif
|
|
<div class="overflow-x-auto rounded-xl border border-gray-200 bg-white">
|
|
<table class="min-w-full text-sm text-left">
|
|
<thead class="bg-gray-50"><tr><th class="px-5 py-3 whitespace-nowrap">分组名称</th><th class="px-5 py-3 whitespace-nowrap">成员</th><th class="px-5 py-3 whitespace-nowrap">页面权限</th><th class="px-5 py-3 text-right whitespace-nowrap">操作</th></tr></thead>
|
|
<tbody>
|
|
@forelse ($groups as $group)
|
|
<tr class="border-t border-gray-200">
|
|
<td class="px-5 py-4 break-words">{{ $group->name }}</td>
|
|
<td class="px-5 py-4">{{ $group->users_count }}</td>
|
|
<td class="px-5 py-4">{{ empty($group->page_permissions) ? '未开放页面' : '已配置' }}</td>
|
|
<td class="px-5 py-4 text-right whitespace-nowrap">
|
|
<a class="settings-accent mr-3" href="{{ route('system-settings.groups.edit', $group->id) }}">管理成员</a>
|
|
<a class="settings-accent mr-3" href="{{ route('system-settings.sidebar.edit', ['subject' => 'group_'.$group->id]) }}">设置页面权限</a>
|
|
@if ($group->users_count === 0)
|
|
<form class="inline" method="POST" action="{{ route('system-settings.groups.destroy', $group->id) }}" onsubmit="return confirm('确定删除此空分组吗?')">
|
|
@csrf @method('DELETE')<button type="submit" class="text-red-700">删除</button>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="4" class="px-5 py-10 text-center text-gray-600">还没有用户分组。创建分组后,添加成员并统一设置页面权限。</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
</x-layouts.admin>
|