add new frontend

This commit is contained in:
TimmensOne
2023-04-06 12:17:42 +02:00
parent 50acb5fd41
commit 64c64c001b
18 changed files with 887 additions and 398 deletions

View File

@ -1,37 +1,99 @@
@props(['device'])
<div>
<h3>Device Detail</h3>
<ul>
<!--li>device_id: {{ $device['device_id'] }}</li-->
<li>title: {{ $device['title'] }}</li>
<li>device_type: {{ $device['device_type'] }}</li>
<li>description: {{ $device['description'] }}</li>
<li>accessories: {{ $device['accessories'] }}</li>
<li>rz_username_buyer: {{ $device['rz_username_buyer'] }}</li>
<li>serial_number: {{ $device['serial_number'] }}</li>
<li>image_url: {{ $device['image_url'] }}</li>
</ul>
@can('admin-only')
<button><a href="{{ $device->device_id }}/edit">Edit</a></button>
<form method="POST" action="{{ $device->device_id }}">
@method('DELETE')
@csrf
<button>Delete</button>
</form>
@endcan
<x-purchasing-information :device="$device" />
@php
$locationTransactions = $device->locations;
$ownerTransactins = $device->owners;
@endphp
<h3>Location Transactions</h3>
<button><a href="{{ $device->device_id }}/locations/create">New Location</a></button>
@foreach ($locationTransactions as $location)
<x-location-transaction :location="$location" />
@endforeach
<h3>Owner Transactions</h3>
<button><a href="{{ $device->device_id }}/owners/create">New Owner</a></button>
@foreach ($ownerTransactins as $owner)
<x-owner-transaction :owner="$owner" />
@endforeach
<h3 class="title is-3 has-text-centered">Device Detail</h3>
<div class="table-container">
<table class="table is-narrow is-fullwidth">
<thead>
<tr>
<th>Ttile</th>
<th>device_type</th>
<th>description</th>
<th>accessories</th>
<th>rz_username_buyer</th>
<th>serial_number</th>
<th>image_url</th>
@can('admin-only')
<th class="is-narrow">Action</th>
@endcan
</tr>
</thead>
<tbody>
<tr>
<td>{{ $device['title'] }}</td>
<td>{{ $device['device_type'] }}</td>
<td>{{ $device['description'] }}</td>
<td>{{ $device['accessories'] }}</td>
<td>{{ $device['rz_username_buyer'] }}</td>
<td>{{ $device['serial_number'] }}</td>
<td>{{ $device['image_url'] }}</td>
@can('admin-only')
<td>
<button><a href="{{ $device->device_id }}/edit">Edit</a></button>
<form method="POST" action="{{ $device->device_id }}">
@method('DELETE')
@csrf
<button>Delete</button>
</form>
</td>
@endcan
</tr>
</tbody>
</table>
</div>
<h3 class="title is-3 has-text-centered">Purchasing Information</h3>
<x-purchasing-information :device="$device" />
<h3 class="title is-3 has-text-centered">Location Transactions</h3>
<div class="buttons is-right">
<a class="button is-small" href="{{ $device->device_id }}/locations/create">New Location</a>
</div>
@php
$locationTransactions = $device->locations;
$ownerTransactins = $device->owners;
@endphp
<div class="table-container">
<table class="table is-narrow is-fullwidth is-striped is-hoverable">
<thead>
<tr>
<th>room_code</th>
<th>timestamp_located_since</th>
@can('admin-only')
<th class="is-narrow">Action</th>
@endcan
</tr>
</thead>
<tbody>
@foreach ($locationTransactions as $location)
<x-location-transaction :location="$location" />
@endforeach
</tbody>
</table>
</div>
<h3 class="title is-3 has-text-centered">Owner Transactions</h3>
<div class="buttons is-right">
<a class="button is-small" href="{{ $device->device_id }}/owners/create">New Owner</a>
</div>
<div class="table-container">
<table class="table is-narrow is-fullwidth is-striped is-hoverable">
<thead>
<tr>
<th>rz_username</th>
<th>timestamp_owner_since</th>
@can('admin-only')
<th class="is-narrow">Action</th>
@endcan
</tr>
</thead>
<tbody>
@foreach ($ownerTransactins as $owner)
<x-owner-transaction :owner="$owner" />
@endforeach
</tbody>
</table>
</div>

View File

@ -1,16 +1,13 @@
@props(['device'])
<div>
<a href="/devices/{{ $device['device_id'] }}">{{ $device->title }}</a>
<ul>
<!--li>{{ $device['device_id'] }}</li-->
<!--li>title:{{ $device['title'] }}</li-->
<li>device_type: {{ $device['device_type'] }}</li>
<li>description: {{ $device['description'] }}</li>
<li>accessories: {{ $device['accessories'] }}</li>
<li>rz_username_buyer: {{ $device['rz_username_buyer'] }}</li>
<li>serial_number: {{ $device['serial_number'] }}</li>
<li>image_url: {{ $device['image_url'] }}</li>
<li>room_code: {{ $device->locations->last()['room_code'] }}</li>
<li>rz_username: {{ $device->owners->last()['rz_username'] }}</li>
</ul>
</div>
<tr>
<td><a href="/devices/{{ $device['device_id'] }}">{{ $device->title }}</a></td>
<td>{{ $device['device_type'] }}</td>
<td>{{ $device['description'] }}</td>
<td>{{ $device['accessories'] }}</td>
<td>{{ $device['rz_username_buyer'] }}</td>
<td>{{ $device['serial_number'] }}</td>
<td>{{ $device['image_url'] }}</td>
{{-- TODO: Nicht null --}}
<td>{{ $device->locations->last()['room_code'] ?? ''}}</td>
<td>{{ $device->owners->last()['rz_username'] ?? ''}}</td>
</tr>

View File

@ -1,14 +1,14 @@
<div>
<ul>
<li>room_code: {{ $location->room_code }}</li>
<li>timestamp_located_since: {{ $location->timestamp_located_since }}</li>
</ul>
<tr>
<td>{{ $location->room_code }}</td>
<td>{{ $location->timestamp_located_since }}</td>
@can('admin-only')
<button><a href="locations/{{ $location->location_transaction_id }}/edit">Edit</a></button>
<form method="POST" action="locations/{{ $location->location_transaction_id }}">
@method('DELETE')
@csrf
<button>Delete</button>
</form>
<td>
<button><a href="locations/{{ $location->location_transaction_id }}/edit">Edit</a></button>
<form method="POST" action="locations/{{ $location->location_transaction_id }}">
@method('DELETE')
@csrf
<button>Delete</button>
</form>
</td>
@endcan
</div>
</tr>

View File

@ -1,14 +1,14 @@
<div>
<ul>
<li>rz_username: {{ $owner->rz_username }}</li>
<li>timestamp_owner_since: {{ $owner->timestamp_owner_since }}</li>
</ul>
<tr>
<td>{{ $owner->rz_username }}</td>
<td>{{ $owner->timestamp_owner_since }}</td>
@can('admin-only')
<button><a href="owners/{{ $owner->owner_transaction_id }}/edit">Edit</a></button>
<td>
<button><a href="owners/{{ $owner->owner_transaction_id }}/edit">Edit</a></button>
<form method="POST" action="owners/{{ $owner->owner_transaction_id }}">
@method('DELETE')
@csrf
<button>Delete</button>
</form>
</td>
@endcan
</div>
</tr>

View File

@ -1,16 +1,34 @@
<div>
@php
$purchasing = $device->purchasing;
@endphp
<h3>Purchasing Information</h3>
<ul>
<li>price: {{ $purchasing->price }}</li>
<li>timestamp_warranty_end: {{ $purchasing->timestamp_warranty_end }}</li>
<li>timestamp_purchase: {{ $purchasing->timestamp_purchase }}</li>
<li>cost_centre: {{ $purchasing->cost_centre }}</li>
<li>seller: {{ $purchasing->seller }}</li>
</ul>
@can('admin-only')
<button><a href="{{ $device->device_id }}/purchasing/edit">Edit</a></button>
@endcan
</div>
@php
$purchasing = $device->purchasing;
@endphp
<div class="table-container">
<table class="table is-narrow is-fullwidth">
<thead>
<tr>
<th>price</th>
<th>timestamp_warranty_end</th>
<th>timestamp_purchase</th>
<th>cost_centre</th>
<th>seller</th>
@can('admin-only')
<th class="is-narrow">Action</th>
@endcan
</tr>
</thead>
<tbody>
<tr>
<td>{{ $purchasing->price }}</td>
<td>{{ $purchasing->timestamp_warranty_end }}</td>
<td>{{ $purchasing->timestamp_purchase }}</td>
<td>{{ $purchasing->cost_centre }}</td>
<td>{{ $purchasing->seller }}</td>
@can('admin-only')
<td>
<button><a href="{{ $device->device_id }}/purchasing/edit">Edit</a></button>
</td>
@endcan
</tr>
</tbody>
</table>
</div>