Merge branch 'frontend' into 'main'

add new frontend

See merge request ase22ws/abschlussprojekt-device-manager-timon-lorenz!7
This commit is contained in:
lot17014 2023-04-06 12:19:41 +02:00
commit df4a1c84d9
18 changed files with 887 additions and 398 deletions

View File

@ -120,7 +120,7 @@ php artisan test
Timon Lorenz (lot17014) Timon Lorenz (lot17014)
## 6 License ## 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 ## Releasedate
latest: 15.04.2023 latest: 15.04.2023

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,56 +1,103 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<form method="POST" action="/devices"> <div class="columns is-centered">
@csrf <div class="column is-6">
<!--label for="device_id">device_id:</label> <div class="box">
<input type="text" id="device_id" name="device_id" value="{{old('device_id')}}" required> <h3 class="title is-3 has-text-centered">Create Device</h3>
@error('device_id')
<p>{{$message}}</p>
@enderror <form method="POST" action="/devices">
<br /--> @csrf
<label for="title">Title:</label>
<input type="text" id="title" name="title" value="{{old('title')}}" required> <div class="field">
@error('title') <label for="title" class="label">Title</label>
<p>{{$message}}</p> <div class="control">
@enderror <input class="input" type="text" id="title" placeholder="Title" name="title"
<br /> value="{{ old('title') }}" required />
<label for="device_type">device_type:</label> </div>
<input type="text" id="device_type" name="device_type" value="{{old('device_type')}}" required> @error('title')
@error('device_type') <p class="help is-danger">{{ $message }}</p>
<p>{{$message}}</p> @enderror
@enderror </div>
<br />
<label for="accessories">accessories:</label> <div class="field">
<input type="text" id="accessories" name="accessories" value="{{old('accessories')}}"> <label for="device_type" class="label">device_type</label>
@error('accessories') <div class="control">
<p>{{$message}}</p> <input class="input" type="text" id="device_type" placeholder="device_type"
@enderror name="device_type" value="{{ old('device_type') }}" required />
<br /> </div>
<label for="rz_username_buyer">rz_username_buyer:</label> @error('device_type')
<input type="text" id="rz_username_buyer" name="rz_username_buyer" value="{{old('rz_username_buyer')}}" required> <p class="help is-danger">{{ $message }}</p>
@error('rz_username_buyer') @enderror
<p>{{$message}}</p> </div>
@enderror
<br /> <div class="field">
<label for="serial_number">serial_number:</label> <label for="accessories" class="label">accessories</label>
<input type="text" id="serial_number" name="serial_number" value="{{old('serial_number')}}" required> <div class="control">
@error('serial_number') <input class="input" type="text" id="accessories" placeholder="accessories"
<p>{{$message}}</p> name="accessories" value="{{ old('accessories') }}" />
@enderror </div>
<br /> @error('accessories')
<label for="image_url">image_url:</label> <p class="help is-danger">{{ $message }}</p>
<input id="image_url" name="image_url" value="{{old('image_url')}}" required> @enderror
@error('image_url') </div>
<p>{{$message}}</p>
@enderror <div class="field">
<br /> <label for="rz_username_buyer" class="label">rz_username_buyer</label>
<label for="description">description:</label> <div class="control">
<textarea type="text" id="description" name="description">{{old('rz_username_buyer')}}</textarea> <input class="input" type="text" id="rz_username_buyer" placeholder="rz_username_buyer"
@error('description') name="rz_username_buyer" value="{{ old('rz_username_buyer') }}" required />
<p>{{$message}}</p> </div>
@enderror @error('rz_username_buyer')
<br /> <p class="help is-danger">{{ $message }}</p>
<input type="submit" value="Submit"> @enderror
</form> </div>
<div class="field">
<label for="serial_number" class="label">serial_number</label>
<div class="control">
<input class="input" type="text" id="serial_number" placeholder="serial_number"
name="serial_number" value="{{ old('serial_number') }}" required />
</div>
@error('serial_number')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="image_url" class="label">image_url</label>
<div class="control">
<input class="input" type="text" id="image_url" placeholder="image_url" name="image_url"
value="{{ old('image_url') }}" required />
</div>
@error('image_url')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="description" class="label">description</label>
<div class="control">
<textarea class="textarea" placeholder="description" id="description" name="description">{{ old('description') }}</textarea>
</div>
@error('description')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
<div class="control">
<a class="button is-success is-light" href="/devices">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection @endsection

View File

@ -1,57 +1,102 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<form method="POST" action="/devices/{{$device->device_id}}"> <div class="columns is-centered">
@method('PUT') <div class="column is-6">
@csrf <div class="box">
<!--label for="device_id">device_id:</label> <h3 class="title is-3 has-text-centered">Edit Device</h3>
<input type="text" id="device_id" name="device_id" value="{{$device->device_id}}" required>
@error('device_id') <form method="POST" action="/devices/{{ $device->device_id }}">
<p>{{$message}}</p> @method('PUT')
@enderror @csrf
<br /-->
<label for="title">Title:</label> <div class="field">
<input type="text" id="title" name="title" value="{{$device->title}}" required> <label for="title" class="label">Title</label>
@error('device_id') <div class="control">
<p>{{$message}}</p> <input class="input" type="text" id="title" name="title"
@enderror value="{{ $device->title }}" required />
<br /> </div>
<label for="device_type">device_type:</label> @error('title')
<input type="text" id="device_type" name="device_type" value="{{$device->device_type}}" required> <p class="help is-danger">{{ $message }}</p>
@error('device_id') @enderror
<p>{{$message}}</p> </div>
@enderror
<br /> <div class="field">
<label for="accessories">accessories:</label> <label for="device_type" class="label">device_type</label>
<input type="text" id="accessories" name="accessories" value="{{$device->accessories}}"> <div class="control">
@error('device_id') <input class="input" type="text" id="device_type"
<p>{{$message}}</p> name="device_type" value="{{ $device->device_type }}" required />
@enderror </div>
<br /> @error('device_type')
<label for="rz_username_buyer">rz_username_buyer:</label> <p class="help is-danger">{{ $message }}</p>
<input type="text" id="rz_username_buyer" name="rz_username_buyer" value="{{$device->rz_username_buyer}}" required> @enderror
@error('device_id') </div>
<p>{{$message}}</p>
@enderror <div class="field">
<br /> <label for="accessories" class="label">accessories</label>
<label for="serial_number">serial_number:</label> <div class="control">
<input type="text" id="serial_number" name="serial_number" value="{{$device->serial_number}}" required> <input class="input" type="text" id="accessories"
@error('device_id') name="accessories" value="{{ $device->accessories }}" />
<p>{{$message}}</p> </div>
@enderror @error('accessories')
<br /> <p class="help is-danger">{{ $message }}</p>
<label for="image_url">image_url:</label> @enderror
<input id="image_url" name="image_url" value="{{$device->image_url}}" required> </div>
@error('device_id')
<p>{{$message}}</p> <div class="field">
@enderror <label for="rz_username_buyer" class="label">rz_username_buyer</label>
<br /> <div class="control">
<label for="description">description:</label> <input class="input" type="text" id="rz_username_buyer"
<textarea type="text" id="description" name="description">{{$device->description}}</textarea> name="rz_username_buyer" value="{{ $device->rz_username_buyer }}" required />
@error('device_id') </div>
<p>{{$message}}</p> @error('rz_username_buyer')
@enderror <p class="help is-danger">{{ $message }}</p>
<br /> @enderror
<input type="submit" value="Submit"> </div>
</form>
<div class="field">
<label for="serial_number" class="label">serial_number</label>
<div class="control">
<input class="input" type="text" id="serial_number"
name="serial_number" value="{{ $device->serial_number }}" required />
</div>
@error('serial_number')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="image_url" class="label">image_url</label>
<div class="control">
<input class="input" type="text" id="image_url" name="image_url"
value="{{ $device->image_url }}" required />
</div>
@error('image_url')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="description" class="label">description</label>
<div class="control">
<textarea class="textarea" id="description" name="description">{{ $device->description }}</textarea>
</div>
@error('description')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
<div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection @endsection

View File

@ -1,17 +1,37 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<h1>Device List</h1> <h3 class="title is-3 has-text-centered">Device List</h3>
@unless(count($devices) == 0) @can('admin-only')
<ul> <div class="buttons is-right">
@foreach ($devices as $device) <a class="button is-small" href="devices/create">Create Device</a>
<x-device-simple :device="$device" /> </div>
@endforeach @endcan
</ul> @unless (count($devices) == 0)
<div class="table-container">
<table class="table is-narrow is-fullwidth is-striped is-hoverable">
<thead>
<tr>
<th>device_title</th>
<th>device_type</th>
<th>description</th>
<th>accessories</th>
<th>rz_username_buyer</th>
<th>serial_number</th>
<th>image_url</th>
<th>room_code</th>
<th>rz_username</th>
</tr>
</thead>
<tbody>
@foreach ($devices as $device)
<x-device-simple :device="$device" />
@endforeach
</tbody>
</table>
</div>
@else @else
<p>No devices found</p> <p>No devices found</p>
@endunless @endunless
@can('admin-only')
<button><a href="devices/create">Device</a></button>
@endcan
@endsection @endsection

View File

@ -2,35 +2,107 @@
<html> <html>
<head> <head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Device Manager</title> <title>Device Manager</title>
{{-- Bulma CSS Framework --}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css" />
</head> </head>
<style>
/*for sticky footer*/
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
#wrapper {
flex: 1;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Add a click event on each of them
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
</script>
<body> <body>
<nav> <nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<ul> <div class="navbar-brand">
<li><a href="/home">Home</a></li> <a class="navbar-item" href="/home">
@auth Device Manager
<li>Welcome {{ auth()->user()->full_name }}</li> </a>
<li>
<form class="inline" method="POST" action="/logout"> {{-- nav bar for mobile device --}}
@csrf <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navBarBasic">
<button type="submit">Logout</button> <span aria-hidden="true"></span>
</form> <span aria-hidden="true"></span>
</li> <span aria-hidden="true"></span>
@else </a>
<li><a href="/register">Register</a></li>
<li><a href="/login">Login</a></li>
@endauth
</ul>
</nav>
<main>
<h1>Device Manager</h1>
<div class="container">
@yield('content')
</div> </div>
<div id="navBarBasic" class="navbar-menu">
<div class="navbar-start">
@auth
<a class="navbar-item" href="/devices">To List</a>
<a class="navbar-item" href="/log-viewer">To Log-Viewer</a>
@endauth
</div>
<div class="navbar-end">
@auth
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
{{ auth()->user()->full_name }}
</a>
<div class="navbar-dropdown is-right">
<form class="navbar-item" method="POST" action="/logout">
@csrf
<button class="button is-small" type="submit">Logout</button>
</form>
</div>
</div>
@else
<a class="navbar-item" href="/login">
Login
</a>
<a class="navbar-item" href="/register">
Register
</a>
@endauth
</div>
</div>
</nav>
<main id="wrapper">
<section class="section">
<div class="container">
@yield('content')
</div>
</section>
</main> </main>
<footer>
<p>&copy; 2023 My Website. All rights reserved.</p> <footer class="footer notification is-dark p-5">
<p class="has-text-centered">&copy; 2023 Device-Manager. MIT License.</p>
</footer> </footer>
</body> </body>

View File

@ -1,17 +1,48 @@
<form method="POST" action="/devices/{{ $device->device_id }}/locations"> @extends('layout')
@csrf
<label for="room_code">room_code:</label> @section('content')
<input type="text" id="room_code" name="room_code" value="{{old('room_code')}}" required> <div class="columns is-centered">
@error('room_code') <div class="column is-6">
<p>{{ $message }}</p> <div class="box">
@enderror <h3 class="title is-3 has-text-centered">Create Location</h3>
<br /> <form method="POST" action="/devices/{{ $device->device_id }}/locations">
<label for="timestamp_located_since">timestamp_located_since:</label> @csrf
<input type="text" id="timestamp_located_since" name="timestamp_located_since"
value="{{old('timestamp_located_since')}}" required> <div class="field">
@error('timestamp_located_since') <label for="room_code" class="label">room_code</label>
<p>{{ $message }}</p> <div class="control">
@enderror <input class="input" type="text" id="room_code" placeholder="room_code" name="room_code"
<br /> value="{{ old('room_code') }}" required />
<input type="submit" value="Submit"> </div>
</form> @error('room_code')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="timestamp_located_since" class="label">timestamp_located_since</label>
<div class="control">
<input class="input" type="text" id="timestamp_located_since"
placeholder="timestamp_located_since" name="timestamp_located_since"
value="{{ old('timestamp_located_since') }}" required />
</div>
@error('timestamp_located_since')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
<div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -1,18 +1,48 @@
<form method="POST" action="/devices/locations/{{ $location->location_transaction_id }}"> @extends('layout')
@method('PUT')
@csrf @section('content')
<label for="room_code">room_code:</label> <div class="columns is-centered">
<input type="text" id="room_code" name="room_code" value="{{$location->room_code}}" required> <div class="column is-6">
@error('room_code') <div class="box">
<p>{{ $message }}</p> <h3 class="title is-3 has-text-centered">Edit Location</h3>
@enderror <form method="POST" action="/devices/locations/{{ $location->location_transaction_id }}">
<br /> @csrf
<label for="timestamp_located_since">timestamp_located_since:</label> @method('PUT')
<input type="text" id="timestamp_located_since" name="timestamp_located_since" <div class="field">
value="{{$location->timestamp_located_since}}" required> <label for="room_code" class="label">room_code</label>
@error('timestamp_located_since') <div class="control">
<p>{{ $message }}</p> <input class="input" type="text" id="room_code" name="room_code"
@enderror value="{{$location->room_code}}" required />
<br /> </div>
<input type="submit" value="Submit"> @error('room_code')
</form> <p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="timestamp_located_since" class="label">timestamp_located_since</label>
<div class="control">
<input class="input" type="text" id="timestamp_located_since" name="timestamp_located_since"
value="{{$location->timestamp_located_since}}" required />
</div>
@error('timestamp_located_since')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
{{-- TODO: make a link to go back to device --}}
{{-- <div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div> --}}
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -1,17 +1,48 @@
<form method="POST" action="/devices/{{ $device->device_id }}/owners"> @extends('layout')
@csrf
<label for="rz_username">rz_username:</label> @section('content')
<input type="text" id="rz_username" name="rz_username" value="{{old('rz_username')}}" required> <div class="columns is-centered">
@error('rz_username') <div class="column is-6">
<p>{{ $message }}</p> <div class="box">
@enderror <h3 class="title is-3 has-text-centered">Create Owner</h3>
<br /> <form method="POST" action="/devices/{{ $device->device_id }}/owners">
<label for="timestamp_owner_since">timestamp_owner_since:</label> @csrf
<input type="text" id="timestamp_owner_since" name="timestamp_owner_since"
value="{{old('timestamp_owner_since')}}" required> <div class="field">
@error('timestamp_owner_since') <label for="rz_username" class="label">rz_username</label>
<p>{{ $message }}</p> <div class="control">
@enderror <input class="input" type="text" id="rz_username" name="rz_username" placeholder="rz_username"
<br /> value="{{old('rz_username')}}" required />
<input type="submit" value="Submit"> </div>
</form> @error('rz_username')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="timestamp_owner_since" class="label">timestamp_owner_since</label>
<div class="control">
<input class="input" type="text" id="timestamp_owner_since" name="timestamp_owner_since" placeholder="timestamp_owner_since"
value="{{old('timestamp_owner_since')}}" required />
</div>
@error('timestamp_owner_since')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
{{-- TODO: make a link to go back to device --}}
{{-- <div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div> --}}
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -1,18 +1,48 @@
<form method="POST" action="/devices/owners/{{ $owner->owner_transaction_id }}"> @extends('layout')
@method('PUT')
@csrf @section('content')
<label for="rz_username">rz_username:</label> <div class="columns is-centered">
<input type="text" id="rz_username" name="rz_username" value="{{$owner->rz_username}}" required> <div class="column is-6">
@error('rz_username') <div class="box">
<p>{{ $message }}</p> <h3 class="title is-3 has-text-centered">Edit Owner</h3>
@enderror <form method="POST" action="/devices/owners/{{ $owner->owner_transaction_id }}">
<br /> @csrf
<label for="timestamp_owner_since">timestamp_owner_since:</label> @method('PUT')
<input type="text" id="timestamp_owner_since" name="timestamp_owner_since" <div class="field">
value="{{$owner->timestamp_owner_since}}" required> <label for="rz_username" class="label">rz_username</label>
@error('timestamp_owner_since') <div class="control">
<p>{{ $message }}</p> <input class="input" type="text" id="rz_username" name="rz_username"
@enderror value="{{$owner->rz_username}}" required />
<br /> </div>
<input type="submit" value="Submit"> @error('rz_username')
</form> <p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="timestamp_owner_since" class="label">timestamp_owner_since</label>
<div class="control">
<input class="input" type="text" id="timestamp_owner_since" name="timestamp_owner_since"
value="{{$owner->timestamp_owner_since}}" required />
</div>
@error('timestamp_owner_since')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
{{-- TODO: make a link to go back to device --}}
{{-- <div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div> --}}
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -1,36 +1,82 @@
<form method="POST" action="/devices/{{ $purchasing->device->device_id }}/purchasing"> @extends('layout')
@method('PUT')
@csrf @section('content')
<label for="price">price:</label> <div class="columns is-centered">
<input type="text" id="price" name="price" value="{{$purchasing->price}}" required> <div class="column is-6">
@error('price') <div class="box">
<p>{{ $message }}</p> <h3 class="title is-3 has-text-centered">Edit Purchasing</h3>
@enderror <form method="POST" action="/devices/{{ $purchasing->device->device_id }}/purchasing">
<br /> @method('PUT')
<label for="timestamp_warranty_end">timestamp_warranty_end:</label> @csrf
<input type="text" id="timestamp_warranty_end" name="timestamp_warranty_end"
value="{{$purchasing->timestamp_warranty_end}}" required> <div class="field">
@error('timestamp_warranty_end') <label for="price" class="label">price</label>
<p>{{ $message }}</p> <div class="control">
@enderror <input class="input" type="text" id="price" name="price"
<br /> value="{{$purchasing->price}}" required />
<label for="timestamp_purchase">timestamp_purchase:</label> </div>
<input type="text" id="timestamp_purchase" name="timestamp_purchase" @error('price')
value="{{$purchasing->timestamp_purchase}}" required> <p class="help is-danger">{{ $message }}</p>
@error('timestamp_purchase') @enderror
<p>{{ $message }}</p> </div>
@enderror
<br /> <div class="field">
<label for="cost_centre">cost_centre:</label> <label for="timestamp_warranty_end" class="label">timestamp_warranty_end</label>
<input type="text" id="cost_centre" name="cost_centre" value="{{$purchasing->cost_centre}}" required> <div class="control">
@error('cost_centre') <input class="input" type="text" id="timestamp_warranty_end" name="timestamp_warranty_end"
<p>{{ $message }}</p> value="{{$purchasing->timestamp_warranty_end}}" required />
@enderror </div>
<br /> @error('timestamp_warranty_end')
<label for="seller">seller:</label> <p class="help is-danger">{{ $message }}</p>
<input type="text" id="seller" name="seller" value="{{$purchasing->seller}}"> @enderror
@error('seller') </div>
<p>{{ $message }}</p>
@enderror <div class="field">
<input type="submit" value="Submit"> <label for="timestamp_purchase" class="label">timestamp_purchase</label>
</form> <div class="control">
<input class="input" type="text" id="timestamp_purchase" name="timestamp_purchase"
value="{{$purchasing->timestamp_purchase}}" required />
</div>
@error('timestamp_purchase')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="cost_centre" class="label">cost_centre</label>
<div class="control">
<input class="input" type="text" id="cost_centre" name="cost_centre"
value="{{$purchasing->cost_centre}}" required />
</div>
@error('cost_centre')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="seller" class="label">seller</label>
<div class="control">
<input class="input" type="text" id="seller" name="seller"
value="{{$purchasing->seller}}" required />
</div>
@error('seller')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Submit</button>
</div>
{{-- TODO: make a link to go back to device --}}
{{-- <div class="control">
<a class="button is-success is-light" href="/devices/{{ $device->device_id }}">Cancel</a>
</div> --}}
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -1,25 +1,51 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<h1>Login Form</h1> <div class="columns is-centered">
<form method="POST" action="/users/authenticate"> <div class="column is-4">
@csrf <div class="box">
<label for="rz_username">RZ-Username:</label> <h3 class="title is-3 has-text-centered">Login Form</h3>
<input type="text" id="rz_username" name="rz_username" value="{{ old('device_id') }}" required> <form method="POST" action="/users/authenticate">
@error('rz_username') @csrf
<p>{{ $message }}</p>
@enderror <div class="field">
<br /> <label for="rz_username" class="label">RZ-Username</label>
<label for="hashed_password">Password:</label> <div class="control">
<input type="password" id="hashed_password" name="password" required> <input class="input" type="text" id="rz_username" placeholder="RZ-Username"
@error('hashed_password') name="rz_username" value="{{ old('device_id') }}" required />
<p>{{ $message }}</p> </div>
@enderror @error('rz_username')
<br /> <p class="help is-danger">{{ $message }}</p>
<input type="submit" value="Login"> @enderror
<div> </div>
<p>Don't have an account?</p>
<a href="/register">Register</a> <div class="field">
<label for="hashed_password" class="label">Password</label>
<div class="control">
<input class="input" type="password" id="hashed_password" name="password" required />
</div>
@error('hashed_password')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Login</button>
</div>
<div class="control">
<a class="button is-success is-light" href="/home">Cancel</a>
</div>
</div>
</form>
<div class="has-text-centered">
<p>Don't have an account?</p>
<a href="/register">Register</a>
</div>
</div>
</div> </div>
</form> </div>
@endsection @endsection

View File

@ -1,43 +1,79 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<h1>Registration Form</h1> <div class="columns is-centered">
<form method="POST" action="/users"> <div class="column is-4">
@csrf <div class="box">
<label for="rz_username">RZ-Username:</label> <h3 class="title is-3 has-text-centered">Registration Form Form</h3>
<input type="text" id="rz_username" name="rz_username" value="{{old('device_id')}}" required> <form method="POST" action="/users">
@error('rz_username') @csrf
<p>{{$message}}</p>
@enderror <div class="field">
<br/> <label for="rz_username" class="label">RZ-Username</label>
<label for="full_name">Full Name:</label> <div class="control">
<input type="text" id="full_name" name="full_name" value="{{old('device_id')}}" required> <input class="input" type="text" id="rz_username" name="rz_username"
@error('full_name') value="{{ old('device_id') }}" placeholder="RZ-Username" required />
<p>{{$message}}</p> </div>
@enderror @error('rz_username')
<br/> <p class="help is-danger">{{ $message }}</p>
<label for="organisation_unit">Organisation Unit:</label> @enderror
<input type="text" id="organisation_unit" name="organisation_unit" value="{{old('device_id')}}" required> </div>
@error('organisation_unit')
<p>{{$message}}</p> <div class="field">
@enderror <label for="full_name" class="label">Full Name</label>
<br/> <div class="control">
<label for="password">Password:</label> <input class="input" type="text" id="full_name" name="full_name"
<input type="password" id="password" name="password" required> value="{{ old('device_id') }}" placeholder="Full Name" required />
@error('password') </div>
<p>{{$message}}</p> @error('full_name')
@enderror <p class="help is-danger">{{ $message }}</p>
<br/> @enderror
{{-- <label for="password_confirm">Confirm Password:</label> </div>
<input type="password" id="password_confirmation" name="password_confirm" required><
@error('password_confirmation') <div class="field">
<p>{{$message}}</p> <label for="organisation_unit" class="label">Organisation Unit</label>
@enderror <div class="control">
<br/> --}} <input class="input" type="text" id="organisation_unit" name="organisation_unit"
<input type="submit" value="Register"> value="{{ old('device_id') }}" placeholder="Organisation Unit" required />
<div> </div>
<p>Already have an account?</p> @error('organisation_unit')
<a href="/login">Login</a> <p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field">
<label for="password" class="label">Password</label>
<div class="control">
<input class="input" type="password" id="password" name="password" required />
</div>
@error('password')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control">
<button class="button is-success" type="submit">Register</button>
</div>
<div class="control">
<a class="button is-success is-light" href="/home">Cancel</a>
</div>
</div>
{{--
<label for="password_confirm">Confirm Password:</label>
<input type="password" id="password_confirmation" name="password_confirm" required><
@error('password_confirmation')
<p>{{$message}}</p>
@enderror
--}}
</form>
<div class="has-text-centered">
<p>Already have an account?</p>
<a href="/login">Login</a>
</div>
</div>
</div> </div>
</form> </div>
@endsection @endsection

View File

@ -1,10 +1,8 @@
@extends('layout') @extends('layout')
@section('content') @section('content')
<h1>Welcome</h1> <h3 class="title is-3 has-text-centered">Welcome</h3>
<a href="/devices">To List</a>
<br/>
@can('admin-only')
<a href="/log-viewer">To Log Viewer</a>
@endcan
@endsection @endsection
{{-- @can('admin-only')
<a href="/log-viewer">To Log Viewer</a>
@endcan --}}