Skip to content

Commit

Permalink
Merge pull request #21 from krekas/demo-table
Browse files Browse the repository at this point in the history
Demo table
  • Loading branch information
PovilasKorop authored Nov 4, 2021
2 parents 348b6eb + 26f63a3 commit d5a36df
Show file tree
Hide file tree
Showing 18 changed files with 410 additions and 4 deletions.
7 changes: 4 additions & 3 deletions resources/stubs/breeze/notusjs/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ class="absolute top-0 left-0 z-10 flex items-center w-full p-4 bg-transparent md

<div class="relative pt-12 pb-32 bg-pink-600 md:pt-32">
<div class="w-full px-4 mx-auto md:px-10">
<div class="flex flex-wrap">
{{ $slot }}
</div>
<div class="flex flex-wrap"></div>
</div>
</div>
<div class="w-full px-4 mx-auto -m-24 md:px-10">
{{ $slot }}
</div>
</div>

<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ class="cursor-pointer text-black opacity-50 md:hidden px-3 py-1 text-xl leading-
</x-nav-link>
</li>

<li class="items-center">
<x-nav-link href="{{ route('users.index') }}" :active="request()->routeIs('users.index')">
<x-slot name="icon">
<i class="fas fa-users mr-2 text-sm opacity-75"></i>
</x-slot>
{{ __('Users') }}
</x-nav-link>
</li>

<li class="items-center">
<x-nav-link href="{{ route('about') }}" :active="request()->routeIs('about')">
<x-slot name="icon">
Expand Down
44 changes: 44 additions & 0 deletions resources/stubs/breeze/notusjs/views/users/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<x-app-layout>
<div class="w-full px-4">
<div class="relative flex flex-col min-w-0 break-words w-full mb-6 shadow-lg rounded bg-white">
<div class="rounded-t mb-0 px-4 py-3 border-0">
<div class="flex flex-wrap items-center">
<div class="relative w-full px-4 max-w-full flex-grow flex-1">
<h3 class="font-semibold text-lg text-blueGray-700">
{{ __('Users') }}
</h3>
</div>
</div>
</div>
<div class="block w-full overflow-x-auto">
<table class="items-center w-full bg-transparent border-collapse">
<thead>
<tr>
<th class="px-6 align-middle border border-solid py-3 text-xs uppercase border-l-0 border-r-0 whitespace-nowrap font-semibold text-left bg-blueGray-50 text-blueGray-500 border-blueGray-100">
Name
</th>
<th class="px-6 align-middle border border-solid py-3 text-xs uppercase border-l-0 border-r-0 whitespace-nowrap font-semibold text-left bg-blueGray-50 text-blueGray-500 border-blueGray-100">
Email
</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
{{ $user->name }}
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
{{ $user->email }}
</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</div>

{{ $users->links() }}

</div>
</x-app-layout>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ class="fixed z-30 inset-y-0 left-0 w-64 transition duration-300 transform bg-gra
{{ __('Dashboard') }}
</x-nav-link>

<x-nav-link href="{{ route('users.index') }}" :active="request()->routeIs('users.index')">
<x-slot name="icon">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"></path>
</svg>
</x-slot>
{{ __('Users') }}
</x-nav-link>

<x-nav-link href="{{ route('about') }}" :active="request()->routeIs('about')">
<x-slot name="icon">
<svg class="w-5 h-5" aria-hidden="true" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<x-app-layout>
<x-slot name="header">
{{ __('Users') }}
</x-slot>

<div class="inline-block min-w-full shadow rounded-lg overflow-hidden">

<table class="min-w-full leading-normal">
<thead>
<tr>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Name
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Email
</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">{{ $user->name }}</p>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">{{ $user->email }}</p>
</td>
</tr>
@endforeach
</tbody>
</table>

<div class="px-5 py-5 bg-white border-t flex flex-col xs:flex-row items-center xs:justify-between">
{{ $users->links() }}
</div>
</div>

</x-app-layout>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ class="fixed inset-y-0 z-20 flex-shrink-0 w-64 mt-16 overflow-y-auto bg-white md
</x-nav-link>
</li>

<li class="relative px-6 py-3">
<x-nav-link href="{{ route('users.index') }}" :active="request()->routeIs('users.index')">
<x-slot name="icon">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"></path>
</svg>
</x-slot>
{{ __('Users') }}
</x-nav-link>
</li>

<li class="relative px-6 py-3">
<x-nav-link href="{{ route('about') }}" :active="request()->routeIs('about')">
<x-slot name="icon">
Expand Down
11 changes: 11 additions & 0 deletions resources/stubs/breeze/windmill/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
</x-nav-link>
</li>

<li class="relative px-6 py-3">
<x-nav-link href="{{ route('users.index') }}" :active="request()->routeIs('users.index')">
<x-slot name="icon">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"></path>
</svg>
</x-slot>
{{ __('Users') }}
</x-nav-link>
</li>

<li class="relative px-6 py-3">
<x-nav-link href="{{ route('about') }}" :active="request()->routeIs('about')">
<x-slot name="icon">
Expand Down
37 changes: 37 additions & 0 deletions resources/stubs/breeze/windmill/views/users/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<x-app-layout>
<x-slot name="header">
{{ __('Users') }}
</x-slot>

<div class="p-4 bg-white rounded-lg shadow-xs">

<div class="overflow-hidden mb-8 w-full rounded-lg border shadow-xs">
<div class="overflow-x-auto w-full">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase bg-gray-50 border-b">
<th class="px-4 py-3">Name</th>
<th class="px-4 py-3">Email</th>
</tr>
</thead>
<tbody class="bg-white divide-y">
@foreach($users as $user)
<tr class="text-gray-700">
<td class="px-4 py-3 text-sm">
{{ $user->name }}
</td>
<td class="px-4 py-3 text-sm">
{{ $user->email }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase bg-gray-50 border-t sm:grid-cols-9">
{{ $users->links() }}
</div>
</div>

</div>
</x-app-layout>
15 changes: 15 additions & 0 deletions resources/stubs/controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Http\Controllers;

use App\Models\User;

class UserController extends Controller
{
public function index()
{
$users = User::paginate();

return view('users.index', compact('users'));
}
}
2 changes: 2 additions & 0 deletions resources/stubs/routes.stub
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

Route::view('about', 'about')->name('about')->middleware('auth');

Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');
29 changes: 29 additions & 0 deletions resources/stubs/ui/AppServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Providers;

use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Paginator::useBootstrap();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('users.index') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>
{{ __('Users') }}
</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('about') }}" class="nav-link">
<i class="nav-icon far fa-address-card"></i>
Expand Down
54 changes: 54 additions & 0 deletions resources/stubs/ui/adminlte/views/users/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@extends('layouts.app')

@section('content')
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">{{ __('Users') }}</h1>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->

<!-- Main content -->
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">

<div class="card">
<div class="card-body p-0">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->

<div class="card-footer clearfix">
{{ $users->links() }}
</div>
</div>

</div>
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
@endsection
10 changes: 9 additions & 1 deletion resources/stubs/ui/coreui/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
{{ __('Dashboard') }}
</a>
</li>
<li class="nav-item">
<li class="nav-item">
<a class="nav-link" href="{{ route('users.index') }}">
<svg class="nav-icon">
<use xlink:href="{{ asset('icons/coreui.svg#cil-user') }}"></use>
</svg>
{{ __('Users') }}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('about') }}">
<svg class="nav-icon">
<use xlink:href="{{ asset('icons/coreui.svg#cil-speedometer') }}"></use>
Expand Down
33 changes: 33 additions & 0 deletions resources/stubs/ui/coreui/views/users/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@extends('layouts.app')

@section('content')
<div class="card mb-4">
<div class="card-header">
{{ __('Users') }}
</div>
<div class="card-body">

<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
</tr>
@endforeach
</tbody>
</table>

</div>

<div class="card-footer">
{{ $users->links() }}
</div>
</div>
@endsection
11 changes: 11 additions & 0 deletions resources/stubs/ui/plainadmin/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
</a>
</li>

<li class="nav-item @if(request()->routeIs('users.index')) active @endif">
<a href="{{ route('users.index') }}">
<span class="icon">
<svg width="22" height="22" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"></path>
</svg>
</span>
<span class="text">{{ __('Users') }}</span>
</a>
</li>

<li class="nav-item @if(request()->routeIs('about')) active @endif">
<a href="{{ route('about') }}">
<span class="icon">
Expand Down
Loading

0 comments on commit d5a36df

Please sign in to comment.