From 64c64c001b215983843c1d10757960de74652a38 Mon Sep 17 00:00:00 2001 From: TimmensOne Date: Thu, 6 Apr 2023 12:17:42 +0200 Subject: [PATCH] add new frontend --- README.md | 2 +- .../views/components/device-detail.blade.php | 132 +++++++++++---- .../views/components/device-simple.blade.php | 27 ++-- .../components/location-transaction.blade.php | 24 +-- .../components/owner-transaction.blade.php | 14 +- .../purchasing-information.blade.php | 50 ++++-- .../resources/views/devices/create.blade.php | 153 ++++++++++++------ .../resources/views/devices/edit.blade.php | 153 +++++++++++------- .../resources/views/devices/index.blade.php | 40 +++-- device-app/resources/views/layout.blade.php | 118 +++++++++++--- .../views/locations/create.blade.php | 65 ++++++-- .../resources/views/locations/edit.blade.php | 66 +++++--- .../resources/views/owners/create.blade.php | 65 ++++++-- .../resources/views/owners/edit.blade.php | 66 +++++--- .../views/purchasings/edit.blade.php | 118 +++++++++----- .../resources/views/users/login.blade.php | 68 +++++--- .../resources/views/users/register.blade.php | 114 ++++++++----- device-app/resources/views/welcome.blade.php | 10 +- 18 files changed, 887 insertions(+), 398 deletions(-) diff --git a/README.md b/README.md index 2118715..c1dae27 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ php artisan test Timon Lorenz (lot17014) ## 6 License -This project is licensed with the MIT license. The used framework [Laravel](https://laravel.com/) and the imported [Log-Viewer](https://github.com/opcodesio/log-viewer/discussions) are also licensed with the MIT license. +This project is licensed with the MIT license. The used framework [Laravel](https://laravel.com/) and the imported [Log-Viewer](https://github.com/opcodesio/log-viewer/discussions) as well as the CSS framework [Bulma](https://bulma.io/) are also licensed with the MIT license. ## Releasedate latest: 15.04.2023 diff --git a/device-app/resources/views/components/device-detail.blade.php b/device-app/resources/views/components/device-detail.blade.php index c5e467c..4007473 100644 --- a/device-app/resources/views/components/device-detail.blade.php +++ b/device-app/resources/views/components/device-detail.blade.php @@ -1,37 +1,99 @@ @props(['device']) -
-

Device Detail

- - @can('admin-only') - -
- @method('DELETE') - @csrf - -
- @endcan - - @php - $locationTransactions = $device->locations; - $ownerTransactins = $device->owners; - @endphp -

Location Transactions

- - @foreach ($locationTransactions as $location) - - @endforeach -

Owner Transactions

- - @foreach ($ownerTransactins as $owner) - - @endforeach +

Device Detail

+
+ + + + + + + + + + + @can('admin-only') + + @endcan + + + + + + + + + + + + @can('admin-only') + + @endcan + + +
Ttiledevice_typedescriptionaccessoriesrz_username_buyerserial_numberimage_urlAction
{{ $device['title'] }}{{ $device['device_type'] }}{{ $device['description'] }}{{ $device['accessories'] }}{{ $device['rz_username_buyer'] }}{{ $device['serial_number'] }}{{ $device['image_url'] }} + +
+ @method('DELETE') + @csrf + +
+
+
+ +

Purchasing Information

+ + + + +

Location Transactions

+ +@php + $locationTransactions = $device->locations; + $ownerTransactins = $device->owners; +@endphp + +
+ + + + + + @can('admin-only') + + @endcan + + + + @foreach ($locationTransactions as $location) + + @endforeach + +
room_codetimestamp_located_sinceAction
+
+ + + +

Owner Transactions

+ +
+ + + + + + @can('admin-only') + + @endcan + + + + @foreach ($ownerTransactins as $owner) + + @endforeach + +
rz_usernametimestamp_owner_sinceAction
diff --git a/device-app/resources/views/components/device-simple.blade.php b/device-app/resources/views/components/device-simple.blade.php index 9f1b171..17434d0 100644 --- a/device-app/resources/views/components/device-simple.blade.php +++ b/device-app/resources/views/components/device-simple.blade.php @@ -1,16 +1,13 @@ @props(['device']) -
- {{ $device->title }} -
    - - -
  • device_type: {{ $device['device_type'] }}
  • -
  • description: {{ $device['description'] }}
  • -
  • accessories: {{ $device['accessories'] }}
  • -
  • rz_username_buyer: {{ $device['rz_username_buyer'] }}
  • -
  • serial_number: {{ $device['serial_number'] }}
  • -
  • image_url: {{ $device['image_url'] }}
  • -
  • room_code: {{ $device->locations->last()['room_code'] }}
  • -
  • rz_username: {{ $device->owners->last()['rz_username'] }}
  • -
-
\ No newline at end of file + + {{ $device->title }} + {{ $device['device_type'] }} + {{ $device['description'] }} + {{ $device['accessories'] }} + {{ $device['rz_username_buyer'] }} + {{ $device['serial_number'] }} + {{ $device['image_url'] }} + {{-- TODO: Nicht null --}} + {{ $device->locations->last()['room_code'] ?? ''}} + {{ $device->owners->last()['rz_username'] ?? ''}} + \ No newline at end of file diff --git a/device-app/resources/views/components/location-transaction.blade.php b/device-app/resources/views/components/location-transaction.blade.php index a5db6ea..e22ea91 100644 --- a/device-app/resources/views/components/location-transaction.blade.php +++ b/device-app/resources/views/components/location-transaction.blade.php @@ -1,14 +1,14 @@ -
-
    -
  • room_code: {{ $location->room_code }}
  • -
  • timestamp_located_since: {{ $location->timestamp_located_since }}
  • -
+ + {{ $location->room_code }} + {{ $location->timestamp_located_since }} @can('admin-only') - -
- @method('DELETE') - @csrf - -
+ + +
+ @method('DELETE') + @csrf + +
+ @endcan -
\ No newline at end of file + diff --git a/device-app/resources/views/components/owner-transaction.blade.php b/device-app/resources/views/components/owner-transaction.blade.php index 1092aae..b338b3c 100644 --- a/device-app/resources/views/components/owner-transaction.blade.php +++ b/device-app/resources/views/components/owner-transaction.blade.php @@ -1,14 +1,14 @@ -
-
    -
  • rz_username: {{ $owner->rz_username }}
  • -
  • timestamp_owner_since: {{ $owner->timestamp_owner_since }}
  • -
+ + {{ $owner->rz_username }} + {{ $owner->timestamp_owner_since }} @can('admin-only') - + +
@method('DELETE') @csrf
+ @endcan -
\ No newline at end of file + \ No newline at end of file diff --git a/device-app/resources/views/components/purchasing-information.blade.php b/device-app/resources/views/components/purchasing-information.blade.php index 298408c..f4c3f09 100644 --- a/device-app/resources/views/components/purchasing-information.blade.php +++ b/device-app/resources/views/components/purchasing-information.blade.php @@ -1,16 +1,34 @@ -
- @php - $purchasing = $device->purchasing; - @endphp -

Purchasing Information

-
    -
  • price: {{ $purchasing->price }}
  • -
  • timestamp_warranty_end: {{ $purchasing->timestamp_warranty_end }}
  • -
  • timestamp_purchase: {{ $purchasing->timestamp_purchase }}
  • -
  • cost_centre: {{ $purchasing->cost_centre }}
  • -
  • seller: {{ $purchasing->seller }}
  • -
- @can('admin-only') - - @endcan -
\ No newline at end of file +@php + $purchasing = $device->purchasing; +@endphp + +
+ + + + + + + + + @can('admin-only') + + @endcan + + + + + + + + + + @can('admin-only') + + @endcan + + +
pricetimestamp_warranty_endtimestamp_purchasecost_centresellerAction
{{ $purchasing->price }}{{ $purchasing->timestamp_warranty_end }}{{ $purchasing->timestamp_purchase }}{{ $purchasing->cost_centre }}{{ $purchasing->seller }} + +
+
diff --git a/device-app/resources/views/devices/create.blade.php b/device-app/resources/views/devices/create.blade.php index 428d877..8a701fe 100644 --- a/device-app/resources/views/devices/create.blade.php +++ b/device-app/resources/views/devices/create.blade.php @@ -1,56 +1,103 @@ @extends('layout') @section('content') -
- @csrf - - - - @error('title') -

{{$message}}

- @enderror -
- - - @error('device_type') -

{{$message}}

- @enderror -
- - - @error('accessories') -

{{$message}}

- @enderror -
- - - @error('rz_username_buyer') -

{{$message}}

- @enderror -
- - - @error('serial_number') -

{{$message}}

- @enderror -
- - - @error('image_url') -

{{$message}}

- @enderror -
- - - @error('description') -

{{$message}}

- @enderror -
- -
-@endsection \ No newline at end of file +
+
+
+

Create Device

+ + +
+ @csrf + +
+ +
+ +
+ @error('title') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('device_type') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('accessories') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('rz_username_buyer') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('serial_number') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('image_url') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('description') +

{{ $message }}

+ @enderror +
+ +
+
+ +
+
+ Cancel +
+
+
+ +
+
+
+ +@endsection diff --git a/device-app/resources/views/devices/edit.blade.php b/device-app/resources/views/devices/edit.blade.php index e258154..5d47709 100644 --- a/device-app/resources/views/devices/edit.blade.php +++ b/device-app/resources/views/devices/edit.blade.php @@ -1,57 +1,102 @@ @extends('layout') @section('content') -
- @method('PUT') - @csrf - - - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- - - @error('device_id') -

{{$message}}

- @enderror -
- -
-@endsection \ No newline at end of file +
+
+
+

Edit Device

+ +
+ @method('PUT') + @csrf + +
+ +
+ +
+ @error('title') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('device_type') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('accessories') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('rz_username_buyer') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('serial_number') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('image_url') +

{{ $message }}

+ @enderror +
+ +
+ +
+ +
+ @error('description') +

{{ $message }}

+ @enderror +
+ +
+
+ +
+
+ Cancel +
+
+
+ +
+
+
+@endsection diff --git a/device-app/resources/views/devices/index.blade.php b/device-app/resources/views/devices/index.blade.php index 3f8fba0..4b210bb 100644 --- a/device-app/resources/views/devices/index.blade.php +++ b/device-app/resources/views/devices/index.blade.php @@ -1,17 +1,37 @@ @extends('layout') @section('content') -

Device List

- @unless(count($devices) == 0) -
    - @foreach ($devices as $device) - - @endforeach -
+

Device List

+ @can('admin-only') + + @endcan + @unless (count($devices) == 0) +
+ + + + + + + + + + + + + + + + @foreach ($devices as $device) + + @endforeach + +
device_titledevice_typedescriptionaccessoriesrz_username_buyerserial_numberimage_urlroom_coderz_username
+
@else

No devices found

@endunless - @can('admin-only') - - @endcan + @endsection diff --git a/device-app/resources/views/layout.blade.php b/device-app/resources/views/layout.blade.php index 71b4c80..b202490 100644 --- a/device-app/resources/views/layout.blade.php +++ b/device-app/resources/views/layout.blade.php @@ -2,35 +2,107 @@ + + Device Manager + {{-- Bulma CSS Framework --}} + + + + - -
-

Device Manager

-
- @yield('content') + + +
+
+
+ @yield('content') +
+
-