users buttons

This commit is contained in:
Александр Бабкин
2022-06-29 08:56:33 +03:00
parent a2b909e3da
commit 90de0d96f3
7 changed files with 101 additions and 47 deletions

View File

@@ -17,7 +17,7 @@ class UserController extends Controller
*/ */
public function index() public function index()
{ {
$users = User::all(); $users = User::all()->sortBy('id');
return view('admin.users.list',['users'=>$users]); return view('admin.users.list',['users'=>$users]);
// //
} }

View File

@@ -716,9 +716,6 @@ select {
.mt-4 { .mt-4 {
margin-top: 1rem; margin-top: 1rem;
} }
.ml-4 {
margin-left: 1rem;
}
.ml-1 { .ml-1 {
margin-left: 0.25rem; margin-left: 0.25rem;
} }
@@ -731,6 +728,9 @@ select {
.ml-2 { .ml-2 {
margin-left: 0.5rem; margin-left: 0.5rem;
} }
.ml-4 {
margin-left: 1rem;
}
.mt-8 { .mt-8 {
margin-top: 2rem; margin-top: 2rem;
} }
@@ -797,6 +797,9 @@ select {
.w-5 { .w-5 {
width: 1.25rem; width: 1.25rem;
} }
.w-96 {
width: 24rem;
}
.w-full { .w-full {
width: 100%; width: 100%;
} }
@@ -806,9 +809,6 @@ select {
.w-auto { .w-auto {
width: auto; width: auto;
} }
.w-96 {
width: 24rem;
}
.w-4 { .w-4 {
width: 1rem; width: 1rem;
} }
@@ -901,6 +901,9 @@ select {
.rounded-md { .rounded-md {
border-radius: 0.375rem; border-radius: 0.375rem;
} }
.rounded-full {
border-radius: 9999px;
}
.rounded-lg { .rounded-lg {
border-radius: 0.5rem; border-radius: 0.5rem;
} }
@@ -964,6 +967,14 @@ select {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity)); background-color: rgb(243 244 246 / var(--tw-bg-opacity));
} }
.bg-blue-500 {
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
}
.bg-gray-500 {
--tw-bg-opacity: 1;
background-color: rgb(107 114 128 / var(--tw-bg-opacity));
}
.bg-gray-800 { .bg-gray-800 {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(31 41 55 / var(--tw-bg-opacity)); background-color: rgb(31 41 55 / var(--tw-bg-opacity));
@@ -1017,18 +1028,24 @@ select {
padding-left: 0.25rem; padding-left: 0.25rem;
padding-right: 0.25rem; padding-right: 0.25rem;
} }
.pr-2 {
padding-right: 0.5rem;
}
.pl-2 {
padding-left: 0.5rem;
}
.pt-8 { .pt-8 {
padding-top: 2rem; padding-top: 2rem;
} }
.pt-4 {
padding-top: 1rem;
}
.pt-2 { .pt-2 {
padding-top: 0.5rem; padding-top: 0.5rem;
} }
.pb-3 { .pb-3 {
padding-bottom: 0.75rem; padding-bottom: 0.75rem;
} }
.pt-4 {
padding-top: 1rem;
}
.pb-1 { .pb-1 {
padding-bottom: 0.25rem; padding-bottom: 0.25rem;
} }
@@ -1076,6 +1093,9 @@ select {
.font-semibold { .font-semibold {
font-weight: 600; font-weight: 600;
} }
.font-bold {
font-weight: 700;
}
.uppercase { .uppercase {
text-transform: uppercase; text-transform: uppercase;
} }
@@ -1106,6 +1126,14 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(31 41 55 / var(--tw-text-opacity)); color: rgb(31 41 55 / var(--tw-text-opacity));
} }
.text-red-500 {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
}
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-gray-200 { .text-gray-200 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity)); color: rgb(229 231 235 / var(--tw-text-opacity));
@@ -1126,10 +1154,6 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity)); color: rgb(17 24 39 / var(--tw-text-opacity));
} }
.text-red-500 {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
}
.text-green-500 { .text-green-500 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(34 197 94 / var(--tw-text-opacity)); color: rgb(34 197 94 / var(--tw-text-opacity));
@@ -1142,10 +1166,6 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(22 163 74 / var(--tw-text-opacity)); color: rgb(22 163 74 / var(--tw-text-opacity));
} }
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-red-600 { .text-red-600 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity)); color: rgb(220 38 38 / var(--tw-text-opacity));
@@ -9046,14 +9066,18 @@ readers do not read off random characters that represent icons */
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity)); border-color: rgb(209 213 219 / var(--tw-border-opacity));
} }
.hover\:bg-gray-100:hover { .hover\:bg-blue-700:hover {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity)); background-color: rgb(29 78 216 / var(--tw-bg-opacity));
} }
.hover\:bg-gray-700:hover { .hover\:bg-gray-700:hover {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(55 65 81 / var(--tw-bg-opacity)); background-color: rgb(55 65 81 / var(--tw-bg-opacity));
} }
.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.hover\:bg-gray-50:hover { .hover\:bg-gray-50:hover {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity)); background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -9066,6 +9090,18 @@ readers do not read off random characters that represent icons */
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity)); color: rgb(156 163 175 / var(--tw-text-opacity));
} }
.hover\:text-green-700:hover {
--tw-text-opacity: 1;
color: rgb(21 128 61 / var(--tw-text-opacity));
}
.hover\:text-blue-700:hover {
--tw-text-opacity: 1;
color: rgb(29 78 216 / var(--tw-text-opacity));
}
.hover\:text-red-700:hover {
--tw-text-opacity: 1;
color: rgb(185 28 28 / var(--tw-text-opacity));
}
.hover\:text-gray-700:hover { .hover\:text-gray-700:hover {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity)); color: rgb(55 65 81 / var(--tw-text-opacity));

View File

@@ -57,9 +57,14 @@
</div> </div>
<div class="flex items-center justify-end mt-4"> <div class="flex items-center justify-end mt-4">
<x-button class="ml-4"> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
{{ __('Register') }} <i class="fa fa-add pr-2"></i>{{ __('Create user') }}
</x-button> </button>
<div class="pl-2">
<a href="{{ route('users.index') }}" class="btn bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-cancel pr-2"></i>{{__('Cancel')}}
</a>
</div>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -45,15 +45,15 @@
</div> </div>
<div class="flex items-center justify-end mt-4"> <div class="flex items-center justify-end mt-4">
<!-- <button type="submit" class="btn">{{ __('Save') }}</button> --> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
<x-button class="ml-4"> <i class="fa fa-save pr-2"></i>{{ __('Save') }}
{{ __('Save') }} </button>
</x-button> <div class="pl-2">
<!-- <a href="{{ route('users.index') }}"> <a href="{{ route('users.index') }}" class="btn bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded-full">
<x-button class="ml-4"> <i class="fa fa-cancel pr-2"></i>{{__('Cancel')}}
{{ __('Cancel') }} </a>
</x-button> </div>
</a> -->
</div> </div>
</form> </form>
</div> </div>

View File

@@ -11,10 +11,12 @@
<div class="p-6 bg-white border-b border-gray-200"> <div class="p-6 bg-white border-b border-gray-200">
<a href="{{ route('users.create')}}"> <a href="{{ route('users.create')}}">
<x-button class="m-2">{{__('Create user')}}</x-button> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-add pr-2"></i>{{__('Create user')}}
</button>
</a> </a>
<div align="center"> <div align="center" class="pt-4">
<table class="table table-sm border-b border-gray-200"> <table class="table table-sm border-b border-gray-200">
<tr class="border border-gray-200"> <tr class="border border-gray-200">
<th class="p-2 border border-gray-200"> <th class="p-2 border border-gray-200">
@@ -32,12 +34,23 @@
</tr> </tr>
@foreach ( $users as $user) @foreach ( $users as $user)
<tr class="border border-gray-200"> <tr class="border border-gray-200">
<td class="p-2 border border-gray-200"><a href="{{ route('users.show',$user->id)}}" class="underline">{{ $user->username }}</a></td> <td class="p-2 border border-gray-200">{{ $user->username }}</td>
<td class="p-2 border border-gray-200">{{ $user->name }}</td> <td class="p-2 border border-gray-200">{{ $user->name }}</td>
<td class="p-2 border border-gray-200">{{ $user->email }}</td> <td class="p-2 border border-gray-200">{{ $user->email }}</td>
<td class="p-2 border border-gray-200">&nbsp;</td> <td class="p-2 border border-gray-200">
<div class="text-center">
<a href="{{ route('users.show',$user->id) }}">
<i class="fa fa-eye text-green-500 hover:text-green-700 px-2 text-lg"></i>
</a>
<a href="{{ route('users.edit',$user->id) }}">
<i class="fa fa-edit text-blue-500 hover:text-blue-700 px-2 text-lg"></i>
</a>
<a href="{{ route('users.destroy',$user->id) }}">
<i class="fa fa-trash text-red-500 hover:text-red-700 px-2 text-lg"></i>
</a>
</div>
</td>
</tr> </tr>
@endforeach @endforeach
</table> </table>
</div> </div>

View File

@@ -35,16 +35,17 @@
<div class="flex items-center justify-end mt-4"> <div class="flex items-center justify-end mt-4">
<a href="{{ route('users.edit',$user->id) }}"> <a href="{{ route('users.edit',$user->id) }}">
<x-button class="ml-4"> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
{{ __('Edit user') }} <i class="fa fa-edit pr-2"></i>{{__('Edit user')}}
</x-button> </button>
</a> </a>
<a href="{{ route('users.index') }}"> <div class="pl-2">
<x-button class="ml-4"> <a href="{{ route('users.index') }}" class="btn bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded-full">
{{ __('Cancel') }} <i class="fa fa-cancel pr-2"></i>{{__('Cancel')}}
</x-button>
</a> </a>
</div> </div>
</div>
<!-- </form> --> <!-- </form> -->
</div> </div>
</div> </div>

View File

@@ -37,7 +37,6 @@
<td class="p-2 border border-gray-200">{{ $project->mmc_path }}</td> <td class="p-2 border border-gray-200">{{ $project->mmc_path }}</td>
<td class="p-2 border border-gray-200"> <td class="p-2 border border-gray-200">
<div class="text-center"> <div class="text-center">
<!-- Regular -->
<a href="{{ route('projects.show',$project->id) }}"> <a href="{{ route('projects.show',$project->id) }}">
<i class="fa fa-eye text-green-500 px-2 text-lg"></i> <i class="fa fa-eye text-green-500 px-2 text-lg"></i>
</a> </a>