Skip to content

Commit ef3491b

Browse files
committed
Implemented initial functionality for non-Nova admin pages.
1 parent 909c38a commit ef3491b

26 files changed

+2114
-97
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
@extends (config("genealabs-laravel-governor.layout-view"))
2+
3+
@section ("content")
4+
<div>
5+
<x-governor-menu-bar />
6+
7+
<div class="mt-6 mb-4 md:flex md:items-center md:justify-between">
8+
<div class="min-w-0">
9+
<h1 class="text-2xl font-bold leading-7 text-gray-800 sm:text-3xl sm:truncate">
10+
Assignments
11+
</h1>
12+
</div>
13+
</div>
14+
15+
16+
<x-form
17+
:action="route('genealabs.laravel-governor.assignments.store')"
18+
method="POST"
19+
class="flex flex-col"
20+
>
21+
@errors()
22+
23+
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
24+
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
25+
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
26+
<table class="min-w-full divide-y divide-gray-200">
27+
<thead class="bg-gray-50">
28+
<tr>
29+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
30+
Role
31+
</th>
32+
<th
33+
scope="col"
34+
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
35+
>
36+
Assignees
37+
</th>
38+
</tr>
39+
</thead>
40+
<tbody
41+
class="bg-white divide-y divide-gray-200"
42+
>
43+
44+
@foreach ($roles as $role)
45+
<tr>
46+
<td
47+
class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"
48+
>
49+
{{ $role->name }}
50+
</td>
51+
<td
52+
class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"
53+
>
54+
<x-form-select
55+
name="users[{{ $role->name }}][]"
56+
label=""
57+
class="w-full form-select text-xs py-1 rounded-md border-gray-300"
58+
:options="$users->pluck('id', 'name')"
59+
:selectedValues="$role->users->pluck('id')"
60+
multiple
61+
/>
62+
</td>
63+
</tr>
64+
@endforeach
65+
66+
</tbody>
67+
</table>
68+
</div>
69+
70+
<x-form-submit
71+
class="mt-4 py-1 px-4 bg-blue-600 text-blue-100 rounded-md hover:bg-blue-700"
72+
value="Update Assignments"
73+
/>
74+
</div>
75+
</div>
76+
</x-form>
77+
</div>
78+
@endsection

resources/views/assignments/edit.blade.php

Whitespace-only changes.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
@extends (config("genealabs-laravel-governor.layout-view"))
2+
3+
@section ("content")
4+
<div>
5+
<x-governor-menu-bar />
6+
7+
<div class="mt-6 mb-4 md:flex md:items-center md:justify-between">
8+
<div class="flex-1 min-w-0">
9+
<h1 class="text-2xl font-bold leading-7 text-gray-800 sm:text-3xl sm:truncate">
10+
Create a new Group
11+
</h1>
12+
</div>
13+
</div>
14+
15+
16+
17+
<x-form
18+
:action="route('genealabs.laravel-governor.groups.store')"
19+
method="POST"
20+
class=""
21+
>
22+
<div class="hidden sm:block" aria-hidden="true">
23+
<div class="py-5">
24+
<div class="border-t border-gray-200"></div>
25+
</div>
26+
</div>
27+
<div
28+
class="md:grid md:grid-cols-3 md:gap-6"
29+
>
30+
<div class="md:col-span-1">
31+
<div class="px-4 sm:px-0">
32+
<h3 class="text-lg font-medium leading-6 text-gray-900">General</h3>
33+
<p class="mt-1 text-sm text-gray-600">
34+
Name your group according to the purpose it will fulfill.
35+
</p>
36+
</div>
37+
</div>
38+
<div class="mt-5 md:mt-0 md:col-span-2">
39+
<div class="shadow sm:rounded-md sm:overflow-hidden">
40+
<div class="px-4 py-5 bg-white space-y-6 sm:p-6">
41+
<div class="grid grid-cols-3 gap-6">
42+
<div class="col-span-6">
43+
<x-form-text
44+
class="w-1/2 rounded-md border-gray-300"
45+
name="name"
46+
labelClasses="block"
47+
/>
48+
</div>
49+
</div>
50+
</div>
51+
</div>
52+
</div>
53+
</div>
54+
<div class="hidden sm:block" aria-hidden="true">
55+
<div class="py-5">
56+
<div class="border-t border-gray-200"></div>
57+
</div>
58+
</div>
59+
<div class="mt-10 sm:mt-0">
60+
<div class="md:grid md:grid-cols-3 md:gap-6">
61+
<div class="md:col-span-1">
62+
<div class="px-4 sm:px-0">
63+
<h3 class="text-lg font-medium leading-6 text-gray-900">Entities</h3>
64+
<p class="mt-1 text-sm text-gray-600">
65+
Select all entities that are part of this functional grouping.
66+
</p>
67+
</div>
68+
</div>
69+
<div class="mt-5 md:mt-0 md:col-span-2">
70+
<div class="shadow overflow-hidden sm:rounded-md">
71+
<div class="px-4 py-5 bg-white sm:p-6">
72+
<div class="grid grid-cols-6 gap-6">
73+
<div class="col-span-6">
74+
<x-form-select
75+
class="w-full rounded-md border-gray-300"
76+
name="entity_names[]"
77+
:multiple="true"
78+
:options="$entities->pluck('name', 'name')"
79+
/>
80+
</div>
81+
</div>
82+
</div>
83+
</div>
84+
<x-form-submit
85+
class="mt-4 py-1 px-4 bg-blue-600 text-blue-100 rounded-md hover:bg-blue-700"
86+
value="Update Permissions"
87+
/>
88+
</div>
89+
</div>
90+
</div>
91+
</x-form>
92+
</div>
93+
@endsection
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
@extends (config("genealabs-laravel-governor.layout-view"))
2+
3+
@section ("content")
4+
<div>
5+
<x-governor-menu-bar />
6+
7+
<div class="mt-6 mb-4 md:flex md:items-center md:justify-between">
8+
<div class="flex-1 min-w-0">
9+
<h1 class="text-2xl font-bold leading-7 text-gray-800 sm:text-3xl sm:truncate">
10+
Edit "{{ $group->name }}" Group
11+
</h1>
12+
</div>
13+
<div class="mt-4 lex-shrink-0 flex md:mt-0 md:ml-4">
14+
<x-form
15+
:action="route('genealabs.laravel-governor.groups.destroy', $group)"
16+
:model="$group"
17+
method="DELETE"
18+
>
19+
<x-form-submit
20+
class="ml-3 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-red-500 hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-red-500"
21+
value="Delete"
22+
/>
23+
</x-form>
24+
</div>
25+
</div>
26+
27+
28+
29+
<x-form
30+
:action="route('genealabs.laravel-governor.groups.store')"
31+
:model="$group"
32+
method="POST"
33+
class=""
34+
>
35+
<div class="hidden sm:block" aria-hidden="true">
36+
<div class="py-5">
37+
<div class="border-t border-gray-200"></div>
38+
</div>
39+
</div>
40+
<div
41+
class="md:grid md:grid-cols-3 md:gap-6"
42+
>
43+
<div class="md:col-span-1">
44+
<div class="px-4 sm:px-0">
45+
<h3 class="text-lg font-medium leading-6 text-gray-900">General</h3>
46+
<p class="mt-1 text-sm text-gray-600">
47+
Name your group according to the purpose it will fulfill.
48+
</p>
49+
</div>
50+
</div>
51+
<div class="mt-5 md:mt-0 md:col-span-2">
52+
<div class="shadow sm:rounded-md sm:overflow-hidden">
53+
<div class="px-4 py-5 bg-white space-y-6 sm:p-6">
54+
<div class="grid grid-cols-3 gap-6">
55+
<div class="col-span-6">
56+
<x-form-text
57+
class="w-1/2 rounded-md border-gray-300"
58+
name="name"
59+
labelClasses="block"
60+
/>
61+
</div>
62+
</div>
63+
</div>
64+
</div>
65+
</div>
66+
</div>
67+
<div class="hidden sm:block" aria-hidden="true">
68+
<div class="py-5">
69+
<div class="border-t border-gray-200"></div>
70+
</div>
71+
</div>
72+
<div class="mt-10 sm:mt-0">
73+
<div class="md:grid md:grid-cols-3 md:gap-6">
74+
<div class="md:col-span-1">
75+
<div class="px-4 sm:px-0">
76+
<h3 class="text-lg font-medium leading-6 text-gray-900">Entities</h3>
77+
<p class="mt-1 text-sm text-gray-600">
78+
Select all entities that are part of this functional grouping.
79+
</p>
80+
</div>
81+
</div>
82+
<div class="mt-5 md:mt-0 md:col-span-2">
83+
<div class="shadow overflow-hidden sm:rounded-md">
84+
<div class="px-4 py-5 bg-white sm:p-6">
85+
<div class="grid grid-cols-6 gap-6">
86+
<div class="col-span-6">
87+
<x-form-select
88+
class="w-full rounded-md border-gray-300"
89+
name="entity_names[]"
90+
:multiple="true"
91+
:options="$entities->pluck('name', 'name')"
92+
:selectedValues="$group->entities->pluck('name', 'name')"
93+
/>
94+
</div>
95+
</div>
96+
</div>
97+
</div>
98+
<x-form-submit
99+
class="mt-4 py-1 px-4 bg-blue-600 text-blue-100 rounded-md hover:bg-blue-700"
100+
value="Update Permissions"
101+
/>
102+
</div>
103+
</div>
104+
</div>
105+
</x-form>
106+
</div>
107+
@endsection
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
@extends (config("genealabs-laravel-governor.layout-view"))
2+
3+
@section ("content")
4+
<div>
5+
<x-governor-menu-bar />
6+
7+
<div class="mt-6 mb-4 md:flex md:items-center md:justify-between">
8+
<div class="flex-1 min-w-0">
9+
<h1 class="text-2xl font-bold leading-7 text-gray-800 sm:text-3xl sm:truncate">
10+
Groups
11+
</h1>
12+
</div>
13+
<div class="mt-4 lex-shrink-0 flex md:mt-0 md:ml-4">
14+
<a
15+
href="{{ route("genealabs.laravel-governor.groups.create") }}"
16+
class="ml-3 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-500 hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-indigo-500"
17+
>
18+
Create Group
19+
</a>
20+
</div>
21+
</div>
22+
23+
<div class="flex flex-col">
24+
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
25+
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
26+
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
27+
<table class="min-w-full divide-y divide-gray-200">
28+
<thead>
29+
<tr>
30+
<th
31+
scope="col"
32+
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
33+
>
34+
Name
35+
</th>
36+
<th
37+
scope="col"
38+
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
39+
>
40+
Assigned Entities
41+
</th>
42+
</tr>
43+
</thead>
44+
<tbody class="bg-white divide-y divide-gray-200">
45+
46+
@if ($groups->isEmpty())
47+
<tr>
48+
<td
49+
colspan="2"
50+
class="py-3 text-sm text-gray-400 text-center"
51+
>
52+
We don't seem to have any groups yet. Why not create one?
53+
</td>
54+
</tr>
55+
@endif
56+
57+
@foreach ($groups as $group)
58+
<tr>
59+
<td>
60+
<a
61+
class="px-6 py-4 block whitespace-nowrap block text-sm font-medium text-gray-900"
62+
href="{{ route("genealabs.laravel-governor.groups.edit", $group) }}"
63+
>
64+
{{ $group->name }}
65+
</span>
66+
</a>
67+
</td>
68+
<td>
69+
<a
70+
class="px-6 py-4 block whitespace-nowrap block text-sm font-medium text-gray-900"
71+
href="{{ route("genealabs.laravel-governor.groups.edit", $group) }}"
72+
>
73+
74+
@foreach ($group->entities as $entity)
75+
<span
76+
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800"
77+
>
78+
{{ $entity->name }}
79+
</span>
80+
@endforeach
81+
</a>
82+
</td>
83+
</tr>
84+
@endforeach
85+
86+
</tbody>
87+
</table>
88+
</div>
89+
</div>
90+
</div>
91+
</div>
92+
</div>
93+
@endsection

0 commit comments

Comments
 (0)