Skip to content

Instantly share code, notes, and snippets.

@jongravois
Created May 12, 2021 21:32
Show Gist options
  • Save jongravois/4d409ed4857c57d4b53b373d11139230 to your computer and use it in GitHub Desktop.
Save jongravois/4d409ed4857c57d4b53b373d11139230 to your computer and use it in GitHub Desktop.
@push('pagetitle', 'Workscopes')
<x-workscopes.nav-layout>
<x-page.header title="Workscope Manager" />
<div class="px-8 py-4 space-y-4">
<div class="flex justify-between">
<!-- SEARCH -->
<div class="w-1/2 flex items-center space-x-4">
<x-input.search
wire:model="search"
placeholder="Filter ..."/>
</div>
<div class="space-x-4 flex items-center">
<!-- NEW BUTTON -->
<x-buttons.primary
wire:click="create">
<span class="flex">
<x-icon.plus/>
New
</span>
</x-buttons.primary>
</div>
</div>
<!-- Table -->
<div class="flex-col min-h-1/2 space-y-4">
<x-table header>
<x-slot name="head">
<x-table.heading />
<x-table.heading>Registration</x-table.heading>
<x-table.heading>Aircraft</x-table.heading>
<x-table.heading>Operator</x-table.heading>
<x-table.heading>MSN</x-table.heading>
<x-table.heading>Location</x-table.heading>
<x-table.heading>Owner</x-table.heading>
<x-table.heading>Tot Units</x-table.heading>
<x-table.heading>Units Rcvd</x-table.heading>
<x-table.heading>Start</x-table.heading>
<x-table.heading>Target</x-table.heading>
<x-table.heading class="w-6" />
</x-slot>
<x-slot name="body">
@forelse($workscopes as $wks)
<x-table.row>
<x-table.cell-centered class="bg-tag-{{$wks->workscope_color_id}}" />
<x-table.text-cell bolden :value="$wks->registration" />
<x-table.text-cell :value="$wks->aircraft" />
<x-table.text-cell :value="$wks->operator" />
<x-table.text-cell :value="$wks->msn" />
<x-table.text-cell :value="$wks->location->name" />
<x-table.text-cell :value="$wks->owner" />
@if($wks->units_to_receive)
<x-table.integer-cell :value="$wks->units_to_receive" />
<x-table.integer-cell :value="$wks->units_received" />
@else
<x-table.cell-centered colspan="2">
<livewire:workscopes.import-manifest :dis="$wks->id" />
</x-table.cell-centered>
@endif
<x-table.text-cell :value="substr($wks->start_date,0, 10)" />
<x-table.text-cell :value="substr($wks->completion_date,0, 10)" />
<x-table.cell>
<span class="flex items-center space-x-2">
<span class="cursor-pointer"
data-wenk="On Dashboard"
wire:click="toggleDash('{{$wks->id}}')">
@if($wks->on_dash)
@svg('solid/eye', 'text-orange w-4 h-4')
@else
@svg('solid/eye', 'text-gray w-4 h-4')
@endif
</span>
<a data-wenk="Manifest"
href="/workscopes/manifest/{{$wks->registration}}">
@svg('solid/clipboard-list', 'text-gold w-4 h-4')
</a>
<a data-wenk="TaskCards"
href="/workscopes/tasks/{{$wks->registration}}">
@svg('solid/tasks', 'text-coffee w-4 h-4')
</a>
<a data-wenk="Edit"
href="/workscopes/single/{{$wks->registration}}">
@svg('solid/pencil-alt', 'text-blue w-4 h-4')
</a>
<x-modals.delete-confirm
tooltip="delete"
action="deleteWorkscope('{{$wks->id}}')" />
</span>
</x-table.cell>
</x-table.row>
@empty
<x-table.row>
<td colspan="7">
<strong class="pl-4">No Workscopes Found</strong>
</td>
</x-table.row>
@endforelse
</x-slot>
</x-table>
</div>
</div>
</x-workscopes.nav-layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment