initial commit
This commit is contained in:
commit
1e1aa7d461
215 changed files with 35140 additions and 0 deletions
11
resources/views/auth/login.blade.php
Normal file
11
resources/views/auth/login.blade.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<x-layout name="auth">
|
||||
|
||||
<h1 class="text-gray-500 text-3xl text-center mb-4">Login</h1>
|
||||
|
||||
<x-form action="{{ route('auth.login.store') }}">
|
||||
<x-input name="username" placeholder="{{ __('Username') }}" class="mb-2"/>
|
||||
<x-input-password placeholder="{{ __('Password') }}" class="mb-2" />
|
||||
<x-button element="input" type="submit" name="submit" value="Login" class="w-full" />
|
||||
</x-form>
|
||||
|
||||
</x-layout>
|
||||
9
resources/views/character/create.blade.php
Normal file
9
resources/views/character/create.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">{{ __('Add character') }}</x-slot>
|
||||
|
||||
<div class="p-6 mx-auto max-w-xl">
|
||||
<livewire:form.create-character-form>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
11
resources/views/character/list.blade.php
Normal file
11
resources/views/character/list.blade.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">{{ __('Roster') }}</x-slot>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 p-4 gap-4">
|
||||
@foreach($items as $item)
|
||||
<x-character-card :character="$item" />
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
27
resources/views/character/profession/create.blade.php
Normal file
27
resources/views/character/profession/create.blade.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
<x-class-icon class="w-8 h-8 mr-2" :name="$character->class" />
|
||||
{{ $character->name }}
|
||||
-
|
||||
{{ __('Import Profession') }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="mx-auto max-w-sm p-4">
|
||||
<p>Download this <x-link href="https://www.curseforge.com/wow/addons/professions-exporter" target="_blank">exporter addon</x-link>
|
||||
|
||||
<x-form action="{{ route('character.profession.store', [ 'character' => $character->slug ]) }}">
|
||||
<div class="mb-2">
|
||||
<x-form.label for="data">{{ __('Import string') }}</x-form.label>
|
||||
<x-textarea class="h-64" name="data" />
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<x-button element="input" type="submit" value="{{ __('Import') }}" />
|
||||
</div>
|
||||
</x-form>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
46
resources/views/character/profession/show.blade.php
Normal file
46
resources/views/character/profession/show.blade.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
{{ __('Character') }} -
|
||||
<x-class-icon class="w-8 h-8 mx-2" :name="$ch_prof->character->class" />
|
||||
{{ $ch_prof->character->level }} {{ $ch_prof->character->name }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="p-4">
|
||||
|
||||
<x-section-heading>
|
||||
<div class="flex items-end">
|
||||
<x-profession-icon :name="$ch_prof->profession->name" class="h-8 w-8 mr-2"/>
|
||||
<h2 class="text-3xl">{{ $ch_prof->profession->name }}</h2>
|
||||
<h3 class="text-xl ml-2">{{ $ch_prof->skill }}</h3>
|
||||
</div>
|
||||
</x-section-heading>
|
||||
|
||||
|
||||
@php
|
||||
$recipes = $ch_prof->recipes
|
||||
->sortBy('craft.name')
|
||||
->groupBy('category.name')
|
||||
->sortKeys();
|
||||
@endphp
|
||||
|
||||
@foreach($recipes as $category => $recipes)
|
||||
<span x-data="{ open: true }">
|
||||
<h2 class="flex items-center my-2 text-2xl cursor-pointer hover:text-gray-600" @click="open = ! open">
|
||||
<x-icon name="chevron-right" class="h-6 w-6" x-show="!open" x-cloak />
|
||||
<x-icon name="chevron-down" class="h-6 w-6" x-show="open" />
|
||||
{{ $category }}
|
||||
</h2>
|
||||
<ul class="ml-2 space-y-2" x-show="open" x-transition>
|
||||
@foreach($recipes as $recipe)
|
||||
<li><x-link href="{{ route('recipe.show', [ 'recipe' => $recipe ]) }}">{{ $recipe->name }}</x-link></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</span>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
37
resources/views/character/show.blade.php
Normal file
37
resources/views/character/show.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
{{ __('Character') }} -
|
||||
<x-class-icon class="w-8 h-8 mx-2" :name="$character->class" />
|
||||
{{ $character->level }} {{ $character->name }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="p-4">
|
||||
|
||||
<x-section-heading>
|
||||
<h2 class="text-3xl">Professions</h2>
|
||||
<div>
|
||||
@can('import_profession', $character)
|
||||
<x-button element="a" class="flex items-center" href="{{ route('character.profession.create', [ 'character' => $character->slug ]) }}">
|
||||
<x-icon name="plus" class="h-6 h-6 mr-1"/> {{ __('Import') }}
|
||||
</x-button>
|
||||
@endcan
|
||||
</div>
|
||||
</x-section-heading>
|
||||
|
||||
<ul class="space-y-2">
|
||||
@foreach($character->professions as $profession)
|
||||
<li class="flex items-center">
|
||||
<x-profession-icon :name="$profession->name" class="h-8 w-8 mr-2"/>
|
||||
<x-link href="{{ route('character.profession.show', [ 'character' => $character->slug, 'profession' => $profession->slug ]) }}">
|
||||
{{ $profession->name }}
|
||||
</x-link>
|
||||
<span class="ml-1">@ {{ $profession->skill }}</span>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
5
resources/views/components/alert.blade.php
Normal file
5
resources/views/components/alert.blade.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@props(['type', 'message'])
|
||||
|
||||
<div class="px-4 py-2 rounded border text-{{ $type }}-800 bg-{{ $type }}-200 border-{{ $type }}-300">
|
||||
{!! $message !!}
|
||||
</div>
|
||||
3
resources/views/components/button.blade.php
Normal file
3
resources/views/components/button.blade.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@props(['element' => 'button'])
|
||||
|
||||
<{{ $element }} {{ $attributes->merge(['class' => 'cursor-pointer inline-block text-white bg-indigo-400 px-3 py-1 rounded transition-colors hover:bg-indigo-500']) }}>{{ $slot}}</{{ $element }}>
|
||||
27
resources/views/components/character-card.blade.php
Normal file
27
resources/views/components/character-card.blade.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
@props(['character', 'destroy' => false])
|
||||
|
||||
<div class="flex justify-between rounded p-2 bg-class-{{ $character->class }}">
|
||||
<div>
|
||||
<div class="flex items-center">
|
||||
<x-class-icon class="w-8 h-8" :name="$character->class" />
|
||||
<a href="{{ route('character.show', ['character' => $character ]) }}" class="text-2xl ml-2">{{ $character->level }} {{ $character->name }}</a>
|
||||
</div>
|
||||
<p>{{ Str::ucfirst($character->class) }}</p>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-1">
|
||||
@foreach($character->professions as $ch_prof)
|
||||
<a href="{{ route('character.profession.show', [ 'character' => $character, 'profession' => $ch_prof->profession ]) }}">
|
||||
<x-profession-icon class="border border-black rounded-full w-6 h-6" :name="$ch_prof->name" />
|
||||
</a>
|
||||
@endforeach
|
||||
|
||||
@if ($destroy)
|
||||
<x-form :action="$destroy" method="DELETE">
|
||||
<a href="#" onclick="this.closest('form').submit();return false;">
|
||||
<x-icon name="cross" class="h-6 h-6 text-gray-100 rounded bg-black bg-opacity-25 hover:text-gray-200 hover:bg-opacity-30 "/>
|
||||
</a>
|
||||
</x-form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
6
resources/views/components/character-link.blade.php
Normal file
6
resources/views/components/character-link.blade.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
@props(['href', 'character', 'iconsize' => 5])
|
||||
|
||||
<x-link {{ $attributes->merge(['class' => 'flex items-center', 'href' => $href ]) }}>
|
||||
<x-class-icon class="w-{{ $iconsize }} h-{{ $iconsize }} mr-1" :name="$character->class" />
|
||||
<span>{{ $character->name }}</span>
|
||||
</x-link>
|
||||
1
resources/views/components/class-icon.blade.php
Normal file
1
resources/views/components/class-icon.blade.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<img {{ $attributes->merge(['src' => $url, 'class' => 'border border-black rounded-full']) }}/>
|
||||
7
resources/views/components/empty-result.blade.php
Normal file
7
resources/views/components/empty-result.blade.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@props(['title' => false])
|
||||
<div {{ $attributes->merge(['class' => 'select-none text-center py-6 border rounded text-gray-500 bg-gray-100 border-gray-200']) }}>
|
||||
@if ($title)
|
||||
<h2 class="text-3xl mb-2">{{ $title }}</h2>
|
||||
@endif
|
||||
<p>{{ $slot }}</p>
|
||||
</div>
|
||||
11
resources/views/components/form/form.blade.php
Normal file
11
resources/views/components/form/form.blade.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<form {!! $attributes->merge(['method' => $method]) !!}>
|
||||
@unless(in_array($method, ['HEAD', 'GET', 'OPTIONS']))
|
||||
@csrf
|
||||
@endunless
|
||||
|
||||
@if($spoofMethod)
|
||||
@method($spoofMethod)
|
||||
@endif
|
||||
|
||||
{!! $slot !!}
|
||||
</form>
|
||||
7
resources/views/components/form/inputs/input.blade.php
Normal file
7
resources/views/components/form/inputs/input.blade.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
<input type="{{ $type }}" name="{{ $name }}" value="{{ $value }}"
|
||||
{{ $attributes->merge(['class' => ($errors->has($name) ? 'border-red-400 ' : '') . 'w-full border rounded px-2 py-1 focus:ring-2']) }} {{ $disabled }} />
|
||||
|
||||
@error($name)
|
||||
<p class="ml-2 text-red-400 text-sm">{{ $message }}</p>
|
||||
@enderror
|
||||
9
resources/views/components/form/inputs/select.blade.php
Normal file
9
resources/views/components/form/inputs/select.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<select {!! $attributes->merge(['class' => 'w-full border rounded p-1 focus:ring-2']) !!}>
|
||||
@forelse($options as $key => $option)
|
||||
<option value="{{ $key }}">
|
||||
{{ $option }}
|
||||
</option>
|
||||
@empty
|
||||
{!! $slot !!}
|
||||
@endforelse
|
||||
</select>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
<textarea name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => ($errors->has($name) ? 'border-red-400 ' : '') . 'w-full border rounded px-2 py-1 focus:ring-2']) }} {{ $disabled }}>{{ $value }}</textarea>
|
||||
|
||||
@error($name)
|
||||
<p class="ml-2 text-red-400 text-sm">{{ $message }}</p>
|
||||
@enderror
|
||||
1
resources/views/components/form/label.blade.php
Normal file
1
resources/views/components/form/label.blade.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<label {{ $attributes->merge(['class' => 'text-sm']) }}>{{ $slot }}</label>
|
||||
1
resources/views/components/link.blade.php
Normal file
1
resources/views/components/link.blade.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<a {{ $attributes->merge(['class' => 'text-indigo-400 hover:underline']) }}>{{ $slot}}</a>
|
||||
14
resources/views/components/nav-link.blade.php
Normal file
14
resources/views/components/nav-link.blade.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@props(['active' => false])
|
||||
@php
|
||||
|
||||
$classes = 'cursor-pointer px-2 py-1 rounded xl:flex items-center text-sm tracking-normal hidden';
|
||||
|
||||
if ($active) {
|
||||
$classes .= ' bg-gray-900 text-indigo-300';
|
||||
} else {
|
||||
$classes .= ' text-white hover:text-indigo-300 hover:bg-gray-900';
|
||||
}
|
||||
|
||||
@endphp
|
||||
|
||||
<li><a {{ $attributes->merge(['class' => $classes]) }}>{{ $slot }}</a></li>
|
||||
7
resources/views/components/notifications.blade.php
Normal file
7
resources/views/components/notifications.blade.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@if ($messages)
|
||||
<div class="px-4 pt-4 space-y-2">
|
||||
@foreach($messages as $type => $message)
|
||||
<x-alert :type="$type" :message=$message />
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
3
resources/views/components/profession-icon.blade.php
Normal file
3
resources/views/components/profession-icon.blade.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div>
|
||||
<!-- The only way to do great work is to love what you do. - Steve Jobs -->
|
||||
</div>
|
||||
3
resources/views/components/section-heading.blade.php
Normal file
3
resources/views/components/section-heading.blade.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div class="flex items-end justify-between px-2 py-2 mb-2 border-b">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
8
resources/views/errors/401.blade.php
Normal file
8
resources/views/errors/401.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">shield-exclamation</x-slot>
|
||||
<x-slot name="title">{{ __('Unauthorized') }}</x-slot>
|
||||
|
||||
{{ __($exception->getMessage() ?: 'You are not allowed to access this page.') }}
|
||||
|
||||
</x-layout>
|
||||
8
resources/views/errors/403.blade.php
Normal file
8
resources/views/errors/403.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">shield-exclamation</x-slot>
|
||||
<x-slot name="title">{{ __('Forbidden') }}</x-slot>
|
||||
|
||||
{{ __($exception->getMessage() ?: 'You are not allowed to access this page.') }}
|
||||
|
||||
</x-layout>
|
||||
9
resources/views/errors/404.blade.php
Normal file
9
resources/views/errors/404.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">search</x-slot>
|
||||
<x-slot name="icon_color">text-blue-400</x-slot>
|
||||
<x-slot name="title">{{ __('Page not found') }}</x-slot>
|
||||
|
||||
The page you are trying to access does not exist.
|
||||
|
||||
</x-layout>
|
||||
9
resources/views/errors/419.blade.php
Normal file
9
resources/views/errors/419.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">clock</x-slot>
|
||||
<x-slot name="icon_color">text-blue-400</x-slot>
|
||||
<x-slot name="title">{{ __('Page expired.') }}</x-slot>
|
||||
|
||||
{{ __('The page has expired. Please reload and try again.') }}
|
||||
|
||||
</x-layout>
|
||||
8
resources/views/errors/429.blade.php
Normal file
8
resources/views/errors/429.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">exclamation</x-slot>
|
||||
<x-slot name="title">{{ __('Too Many Requests') }}</x-slot>
|
||||
|
||||
{{ __('You have made too many requests under a short period of time. Please wait abit and try again.') }}
|
||||
|
||||
</x-layout>
|
||||
8
resources/views/errors/500.blade.php
Normal file
8
resources/views/errors/500.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">fire</x-slot>
|
||||
<x-slot name="title">{{ __('Server Error') }}</x-slot>
|
||||
|
||||
{{ __('The server encountered an error, please try again.') }}
|
||||
|
||||
</x-layout>
|
||||
9
resources/views/errors/503.blade.php
Normal file
9
resources/views/errors/503.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<x-layout name="error">
|
||||
|
||||
<x-slot name="icon">exclamation-circle</x-slot>
|
||||
<x-slot name="icon_color">text-blue-400</x-slot>
|
||||
<x-slot name="title">{{ __('Service Unavailable') }}</x-slot>
|
||||
|
||||
{{ __('The service is not available at the moment, please try again later.') }}
|
||||
|
||||
</x-layout>
|
||||
36
resources/views/layouts/app.blade.php
Normal file
36
resources/views/layouts/app.blade.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<x-layout class="bg-gray-200">
|
||||
|
||||
@include('partials.navigation')
|
||||
|
||||
<!-- Page title starts -->
|
||||
<div class="relative z-10 bg-gray-800 pt-8 pb-16">
|
||||
<div class="max-w-7xl px-6 mx-auto flex flex-col lg:flex-row items-start lg:items-center justify-between">
|
||||
<div>
|
||||
<h4 class="text-2xl font-bold leading-tight text-white">
|
||||
{{ $title }}
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
@if (isset($page_links))
|
||||
<div>
|
||||
{{ $page_links }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page title ends -->
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="mx-4">
|
||||
<main class="max-w-7xl min-h-16 mx-auto -mt-8 relative z-10 rounded shadow bg-white">
|
||||
|
||||
<x-notifications />
|
||||
|
||||
{{ $slot }}
|
||||
</main>
|
||||
</div>
|
||||
<!-- Main content ends -->
|
||||
|
||||
@include('partials.footer')
|
||||
|
||||
</x-layout>
|
||||
10
resources/views/layouts/auth.blade.php
Normal file
10
resources/views/layouts/auth.blade.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<x-layout class="bg-gray-100">
|
||||
|
||||
<div class="mx-auto max-w-sm mt-48 border rounded p-4 bg-white">
|
||||
|
||||
<x-notifications />
|
||||
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
22
resources/views/layouts/default.blade.php
Normal file
22
resources/views/layouts/default.blade.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ config('app.name') }}</title>
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
@livewireStyles
|
||||
</head>
|
||||
<body {{ $attributes->merge(['class' => 'antialiased']) }}>
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
<!-- Scripts -->
|
||||
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
|
||||
@livewireScripts
|
||||
|
||||
</body>
|
||||
</html>
|
||||
17
resources/views/layouts/error.blade.php
Normal file
17
resources/views/layouts/error.blade.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
{{ __('Error') }} - {{ $title }}
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12 text-center text-gray-500">
|
||||
|
||||
@if (isset($icon))
|
||||
<x-icon :name="$icon" class="h-24 w-24 mx-auto {{ $icon_color ?? 'text-red-500' }} mb-4" />
|
||||
@endif
|
||||
|
||||
<h1 class="text-3xl mb-4">{{ $title }}</h1>
|
||||
<p>{{ $slot }}</p>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
38
resources/views/livewire/form/character.blade.php
Normal file
38
resources/views/livewire/form/character.blade.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
<x-form wire:submit.prevent="save">
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
|
||||
<div>
|
||||
<x-form.label for="name">{{ __('Name') }}</x-form.label>
|
||||
<x-input wire:model="name" name="name" label="name" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-form.label for="level">{{ __('Level') }}</x-form.label>
|
||||
<x-input wire:model="level" name="level" label="level" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-4 mt-2">
|
||||
<div>
|
||||
<x-form.label for="race">{{ __('Race') }}</x-form.label>
|
||||
<x-select wire:model="race" name="race" :options="$races" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-form.label for="gender">{{ __('Gender') }}</x-form.label>
|
||||
<x-select name="gender" :options="$genders" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<x-form.label for="class" >{{ __('Class') }}</x-form.label>
|
||||
<x-select wire:model="class" name="class" :options="$classes" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<x-button element="input" type="submit" value="Save" />
|
||||
</div>
|
||||
|
||||
</x-form>
|
||||
50
resources/views/livewire/recipes.blade.php
Normal file
50
resources/views/livewire/recipes.blade.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-4 mb-2">
|
||||
<x-input wire:model="name" name="name" placeholder="Recipe" />
|
||||
<x-input wire:model="crafter" name="crafter" placeholder="Crafter" />
|
||||
<x-select wire:model="profession" name="profession" :options="$profession_options" />
|
||||
</div>
|
||||
|
||||
@if ($recipes->count())
|
||||
<table class="w-full whitespace-nowrap">
|
||||
<thead>
|
||||
<tr tabindex="0" class="focus:outline-none w-full text-sm leading-none text-gray-800">
|
||||
<th class="text-left px-3 py-4">Recipe</th>
|
||||
<th class="text-left px-3 py-4">Profession</th>
|
||||
<th class="text-left px-3 py-4">Crafters</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="w-full">
|
||||
@foreach($recipes as $recipe)
|
||||
<tr class="focus:outline-none text-sm leading-none text-gray-800 bg-white hover:bg-gray-100 border-b border-t border-gray-100">
|
||||
<td class="px-3 py-4"><x-link href="{{ route('recipe.show', [ 'recipe' => $recipe ]) }}">{{ $recipe->name }}</x-link></td>
|
||||
<td class="px-3 py-4 flex items-center">
|
||||
<x-profession-icon class="w-4 h-4 mr-1" :name="$recipe->profession->name" />
|
||||
{{ $recipe->profession->name }}
|
||||
</td>
|
||||
<td class="px-3 py-4">
|
||||
@if ($recipe->crafters->count() > 0)
|
||||
<ul class="flex flex-wrap gap-2">
|
||||
@foreach($recipe->crafters as $crafter)
|
||||
<li>
|
||||
<x-character-link :character="$crafter" href="{{ route('character.profession.show', ['character' => $crafter, 'profession' => $recipe->profession ]) }}" />
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<span class="text-gray-400">{{ __('None') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ $recipes->links() }}
|
||||
</div>
|
||||
@else
|
||||
<x-empty-result>No recipes found</x-empty-result>
|
||||
@endif
|
||||
</div>
|
||||
106
resources/views/pagination/default.blade.php
Normal file
106
resources/views/pagination/default.blade.php
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<div>
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
|
||||
<div class="flex justify-between flex-1 md:hidden">
|
||||
<span>
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.previous') !!}
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="previousPage" wire:loading.attr="disabled" dusk="previousPage.before" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-indigo-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-indigo-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.previous') !!}
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<span>
|
||||
@if ($paginator->hasMorePages())
|
||||
<button wire:click="nextPage" wire:loading.attr="disabled" dusk="nextPage.before" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-indigo-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-indigo-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.next') !!}
|
||||
</button>
|
||||
@else
|
||||
<span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.next') !!}
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="hidden md:block md:mx-auto">
|
||||
<div class="mb-2">
|
||||
<p class="text-center text-sm text-gray-700 leading-5">
|
||||
<span>{!! __('Showing') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->firstItem() }}</span>
|
||||
<span>{!! __('to') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->lastItem() }}</span>
|
||||
<span>{!! __('of') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->total() }}</span>
|
||||
<span>{!! __('results') !!}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="relative z-0 inline-flex rounded-md shadow-sm">
|
||||
<span>
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5" aria-hidden="true">
|
||||
<x-icon name="chevron-left" class="w-5 h-5" />
|
||||
</span>
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="previousPage" dusk="previousPage.after" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-indigo-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">
|
||||
<x-icon name="chevron-left" class="w-5 h-5" />
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<span aria-disabled="true">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5">{{ $element }}</span>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
<span wire:key="paginator-page{{ $page }}">
|
||||
@if ($page == $paginator->currentPage())
|
||||
<span aria-current="page">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-indigo-400 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="gotoPage({{ $page }})" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-indigo-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
|
||||
{{ $page }}
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<span>
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<button wire:click="nextPage" dusk="nextPage.after" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-indigo-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">
|
||||
<x-icon name="chevron-right" class="w-5 h-5" />
|
||||
</button>
|
||||
@else
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5" aria-hidden="true">
|
||||
<x-icon name="chevron-right" class="w-5 h-5" />
|
||||
</span>
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
5
resources/views/partials/footer.blade.php
Normal file
5
resources/views/partials/footer.blade.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<footer class="max-w-7xl mx-auto px-8 py-4">
|
||||
<p class="text-center text-gray-500 text-sm">
|
||||
Copyright © 2021 - <x-link href="https://www.shufflingpixels.com" target="_blank">shufflingpixels.com</x-link>
|
||||
</p>
|
||||
</footer>
|
||||
27
resources/views/partials/navigation.blade.php
Normal file
27
resources/views/partials/navigation.blade.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
<!-- Navigation starts -->
|
||||
<nav class="w-full mx-auto bg-gray-800 border-b border-gray-700 shadow relative z-20">
|
||||
<div class="max-w-7xl px-4 mx-auto h-16 flex items-center justify-between">
|
||||
<ul class="flex items-center h-full space-x-2">
|
||||
<!-- Logo -->
|
||||
<!-- <li aria-label="Home" role="img" class="cursor-pointer">
|
||||
<x-icon name="clock" class="text-indigo-400 w-12"/>
|
||||
</li> -->
|
||||
|
||||
<x-nav-link href="{{ route('home') }}">{{ __('Roster') }}</x-nav-link>
|
||||
<x-nav-link href="{{ route('recipe.index') }}">{{ __('Recipes') }}</x-nav-link>
|
||||
</ul>
|
||||
|
||||
<div class="flex justify-end text-white space-x-4">
|
||||
@auth
|
||||
<a href="{{ route('user.index') }}"><strong>{{ auth()->user()->username }}</strong></a>
|
||||
<x-form method="DELETE" action="{{ route('auth.logout') }}">
|
||||
<a href="/" onclick="this.closest('form').submit();return false;">{{ __('Logout') }}</a>
|
||||
</x-form>
|
||||
@else
|
||||
<a href="{{ route('auth.login') }}">{{ __('Login') }}</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Navigation ends -->
|
||||
0
resources/views/partials/page-header.blade.php
Normal file
0
resources/views/partials/page-header.blade.php
Normal file
8
resources/views/recipe/index.blade.php
Normal file
8
resources/views/recipe/index.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">{{ __('Recipes') }}</x-slot>
|
||||
|
||||
<div class="p-4">
|
||||
<livewire:recipes />
|
||||
</div>
|
||||
</x-layout>
|
||||
35
resources/views/recipe/show.blade.php
Normal file
35
resources/views/recipe/show.blade.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
<x-profession-icon class="w-8 h-8 mr-4" :name="$recipe->profession->name" />
|
||||
{{ $recipe->profession->name }} - {{ __('Recipe') }}: {{ $recipe->craft->name }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="p-4">
|
||||
|
||||
<div class="mb-4">
|
||||
<x-section-heading>
|
||||
<h2 class="text-3xl">Reagents</h2>
|
||||
</x-section-heading>
|
||||
<ul class="px-4">
|
||||
@foreach($recipe->reagents as $reagent)
|
||||
<li><strong>{{ $reagent->pivot->quantity }}</strong>x {{ $reagent->name }}</li>
|
||||
@endforeach
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<x-section-heading>
|
||||
<h2 class="text-3xl">Crafters</h2>
|
||||
</x-section-heading>
|
||||
<ul class="mx-4 flex flex-wrap gap-4">
|
||||
@foreach($recipe->crafters as $crafter)
|
||||
<li>
|
||||
<x-character-link class="inline-block" :character="$crafter" href="{{ route('character.profession.show', ['character' => $crafter, 'profession' => $recipe->profession ])}}" />
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
33
resources/views/user/edit.blade.php
Normal file
33
resources/views/user/edit.blade.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
{{ __('Edit User') }} - {{ $user->username }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="mx-auto max-w-sm p-4">
|
||||
|
||||
<x-form action="{{ route('user.update') }}">
|
||||
<div class="mb-2">
|
||||
<x-form.label for="current_password">{{ __('Current Password') }}</x-form.label>
|
||||
<x-input-password name="current_password" />
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<x-form.label for="password">{{ __('New Password') }}</x-form.label>
|
||||
<x-input-password name="password" />
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<x-form.label for="password_confirmation">{{ __('Confirm Password') }}</x-form.label>
|
||||
<x-input-password name="password_confirmation" />
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<x-button element="input" type="submit" value="Save" />
|
||||
</div>
|
||||
</x-form>
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
37
resources/views/user/index.blade.php
Normal file
37
resources/views/user/index.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<x-layout name="app">
|
||||
|
||||
<x-slot name="title">
|
||||
<div class="flex">
|
||||
{{ __('User') }} - {{ $user->username }}
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="page_links">
|
||||
<x-button element="a" class="flex items-center" href="{{ route('user.edit') }}">
|
||||
{{ __('Edit password') }}
|
||||
</x-button>
|
||||
</x-slot>
|
||||
|
||||
<div class="p-4">
|
||||
|
||||
<x-section-heading>
|
||||
<h2 class="text-3xl">{{ __('Characters') }}</h2>
|
||||
<div>
|
||||
<x-button element="a" class="flex items-center" href="{{ route('character.create') }}">
|
||||
<x-icon name="plus" class="h-6 h-6 mr-1"/> {{ __('Add character') }}
|
||||
</x-button>
|
||||
</div>
|
||||
</x-section-heading>
|
||||
|
||||
@if ($user->characters->count())
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
@foreach($user->characters as $character)
|
||||
<x-character-card :character="$character" destroy="{{ route('character.destroy', [ 'character' => $character->slug ])}}"/>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<x-empty-result title="No characters">Please add some of yours!</x-empty-result>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
48
resources/views/vendor/livewire/bootstrap.blade.php
vendored
Normal file
48
resources/views/vendor/livewire/bootstrap.blade.php
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<div>
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||||
<span class="page-link" aria-hidden="true">‹</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<button type="button" dusk="previousPage" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev" aria-label="@lang('pagination.previous')">‹</button>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="page-item active" wire:key="paginator-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
|
||||
@else
|
||||
<li class="page-item" wire:key="paginator-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }})">{{ $page }}</button></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<button type="button" dusk="nextPage" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next" aria-label="@lang('pagination.next')">›</button>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||||
<span class="page-link" aria-hidden="true">›</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
29
resources/views/vendor/livewire/simple-bootstrap.blade.php
vendored
Normal file
29
resources/views/vendor/livewire/simple-bootstrap.blade.php
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<div>
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.previous')</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.next')</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
31
resources/views/vendor/livewire/simple-tailwind.blade.php
vendored
Normal file
31
resources/views/vendor/livewire/simple-tailwind.blade.php
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<div>
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between">
|
||||
<span>
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.previous') !!}
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="previousPage" wire:loading.attr="disabled" rel="prev" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.previous') !!}
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<span>
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<button wire:click="nextPage" wire:loading.attr="disabled" rel="next" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.next') !!}
|
||||
</button>
|
||||
@else
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.next') !!}
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
114
resources/views/vendor/livewire/tailwind.blade.php
vendored
Normal file
114
resources/views/vendor/livewire/tailwind.blade.php
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<div>
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
|
||||
<div class="flex justify-between flex-1 sm:hidden">
|
||||
<span>
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.previous') !!}
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="previousPage" wire:loading.attr="disabled" dusk="previousPage.before" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.previous') !!}
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<span>
|
||||
@if ($paginator->hasMorePages())
|
||||
<button wire:click="nextPage" wire:loading.attr="disabled" dusk="nextPage.before" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
|
||||
{!! __('pagination.next') !!}
|
||||
</button>
|
||||
@else
|
||||
<span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
|
||||
{!! __('pagination.next') !!}
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<p class="text-sm text-gray-700 leading-5">
|
||||
<span>{!! __('Showing') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->firstItem() }}</span>
|
||||
<span>{!! __('to') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->lastItem() }}</span>
|
||||
<span>{!! __('of') !!}</span>
|
||||
<span class="font-medium">{{ $paginator->total() }}</span>
|
||||
<span>{!! __('results') !!}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="relative z-0 inline-flex rounded-md shadow-sm">
|
||||
<span>
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5" aria-hidden="true">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="previousPage" dusk="previousPage.after" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<span aria-disabled="true">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5">{{ $element }}</span>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
<span wire:key="paginator-page{{ $page }}">
|
||||
@if ($page == $paginator->currentPage())
|
||||
<span aria-current="page">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
|
||||
</span>
|
||||
@else
|
||||
<button wire:click="gotoPage({{ $page }})" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
|
||||
{{ $page }}
|
||||
</button>
|
||||
@endif
|
||||
</span>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<span>
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<button wire:click="nextPage" dusk="nextPage.after" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</button>
|
||||
@else
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5" aria-hidden="true">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@endif
|
||||
</div>
|
||||
Reference in a new issue