Added views for authorizing.

This commit is contained in:
Lukas Halbritter
2018-12-06 11:48:42 +01:00
parent 280b132282
commit 85493343d6
13 changed files with 504 additions and 72 deletions
+44
View File
@@ -0,0 +1,44 @@
@extends('layout.master')
@section('content')
<h1>Login</h1>
<form method="POST" action="{{ route('login') }}" aria-label="{{ __('Login') }}">
@csrf
<div class="form-group row">
<label for="email" class="col-sm-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
@if ($errors->has('password'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Login') }}
</button>
</div>
</div>
</form>
@endsection
@@ -0,0 +1,47 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Reset Password') }}</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
<form method="POST" action="{{ route('password.email') }}" aria-label="{{ __('Reset Password') }}">
@csrf
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
@if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Send Password Reset Link') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,65 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Reset Password') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('password.request') }}" aria-label="{{ __('Reset Password') }}">
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
@if ($errors->has('password'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Reset Password') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
+77
View File
@@ -0,0 +1,77 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('register') }}" aria-label="{{ __('Register') }}">
@csrf
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" required autofocus>
@if ($errors->has('name'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
@if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
@if ($errors->has('password'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Register') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
+1 -1
View File
@@ -81,7 +81,7 @@
<a href='/bookings/{{ $booking->id }}/edit' class='btn btn-success'>
<i class='fas fa-edit'></i>
</a>
<a href='/bookings{{ $booking->id }}/delete' class='btn btn-danger'>
<a href='/bookings/{{ $booking->id }}/delete' class='btn btn-danger'>
<i class="fas fa-trash"></i>
</a>
</div>
+23
View File
@@ -0,0 +1,23 @@
@extends('layout.master')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
You are logged in!
</div>
</div>
</div>
</div>
</div>
@endsection
+14 -1
View File
@@ -1 +1,14 @@
<p class="text-muted">This page took {{ number_format(microtime(true) - LARAVEL_START, 3) }} seconds to render.</p>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<p class="text-muted">
This page took {{ number_format(microtime(true) - LARAVEL_START, 3) }} seconds to render.
</p>
@auth
<form id="logout-form" action="{{ route('logout') }}"
method="POST">
@csrf
<button class='btn btn-outline-primary ml-' type='submit' id='submit'>
Logout
</button>
</form>
@endauth
</nav>
@@ -8,61 +8,110 @@
<h1>@yield('title')</h1>
<form action="/bookings" method='post'>
{{ csrf_field() }}
<table>
<tr>
<td>{{ Form::label('date', 'Datum') }}</td>
<td>{{ Form::date('date') }}</td>
</tr>
<tr>
<td>{{ Form::label('reference', 'Buchungstext') }}</td>
<td>{{ Form::text('reference') }}</td>
</tr>
<tr>
<td>{{ Form::label('person_or_company', 'Person / Firma') }}</td>
<td>{{ Form::text('person_or_company') }}</td>
</tr>
<tr>
<td>{{ Form::label('amount', 'Betrag') }}</td>
<td>{{ Form::text('amount') }}</td>
</tr>
<tr>
<td>{{ Form::label('account_type_id', 'Konto') }}</td>
<td>{{ Form::select('account_type_id', $accountTypeArray, 'placeholder',
['placeholder' => 'Hier auswählen ...']) }}</td>
</tr>
<tr>
<td>{{ Form::label('person_target_id', 'Personenkonto') }}</td>
<td>{{ Form::select('person_target_id', $openTargetsArray, 'placeholder',
['placeholder' => 'Hier auswählen ...']) }}</td>
</tr>
<tr>
<td><b>oder:</b></td>
<td></td>
</tr>
<tr>
<td>{{ Form::label('personTarget[person_id]', 'neue Soll-Buchung') }}</td>
<td>
<div class='form-group row'>
{{ Form::label('date', 'Datum', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{ Form::date('date', null, ['class' => 'form-control']) }}
</div>
</div>
<div class='form-group row'>
{{ Form::label('reference', 'Buchungstext', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{ Form::text('reference', null, ['class' => 'form-control']) }}
</div>
</div>
<div class='form-group row'>
{{ Form::label('person_or_company', 'Person / Firma', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{ Form::text('person_or_company', null, ['class' => 'form-control']) }}
</div>
</div>
<div class='form-group row'>
{{ Form::label('amount', 'Betrag', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{ Form::text('amount', null, ['class' => 'form-control']) }}
</div>
</div>
<div class='form-group row'>
{{ Form::label('account_type_id', 'Konto', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{
Form::select(
'account_type_id',
$accountTypeArray,
'placeholder',
[
'placeholder' => 'Hier auswählen ...',
'class' => 'form-control'
]
)
}}
</div>
</div>
<div class='form-group row'>
{{ Form::label('person_target_id', 'Personenkonto', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{
Form::select(
'person_target_id',
$openTargetsArray,
'placeholder',
[
'placeholder' => 'Hier auswählen ...',
'class' => 'form-control'
]
)
}}
</div>
</div>
<b>oder:</b>
<div class='form-group row'>
{{
Form::label(
'personTarget[person_id]',
'neue Soll-Buchung',
['class' => 'col-sm-2 col-form-label']
)
}}
<div class='col-sm-5'>
{{
Form::select(
'personTarget[person_id]',
$personsArray,
'placeholder',
['placeholder' => 'Hier auswählen ...']
[
'placeholder' => 'Hier auswählen ...',
'class' => 'form-control'
]
)
}}
{{ Form::date('personTarget[date]') }}
</td>
</tr>
<tr>
<td>{{ Form::label('project_id', 'Projekt') }}</td>
<td>{{ Form::select('project_id', $projectsArray, 'placeholder',
['placeholder' => 'Hier auswählen ...']) }}</td>
</tr>
<tr>
<td>{{ Form::label('note', 'Anmerkung') }}</td>
<td>{{ Form::textarea('note') }}</td>
</tr>
</table>
</div>
<div class='col-sm-5'>
{{ Form::date('personTarget[date]', null, ['class' => 'form-control']) }}
</div>
</div>
<div class='form-group row'>
{{ Form::label('project_id', 'Projekt', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{
Form::select(
'project_id',
$projectsArray,
'placeholder',
[
'placeholder' => 'Hier auswählen ...',
'class' => 'form-control'
]
)
}}
</div>
</div>
<div class='form-group row'>
{{ Form::label('note', 'Anmerkung', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
{{ Form::textarea('note', null, ['class' => 'form-control']) }}
</div>
</div>
<ul>
@foreach ($errors->all() as $error)
@@ -70,6 +119,10 @@
@endforeach
</ul>
<button type="submit" id="submit">Speichern</button>
<div class='form-group row'>
<div class='col-sm-10'>
<button class='btn btn-primary' type="submit" id="submit">Speichern</button>
</div>
</div>
</form>
@endsection
@@ -50,6 +50,13 @@
<div class='form-group row'>
{{ Form::label('person_id', 'Person / Firma', ['class' => 'col-sm-2 col-form-label']) }}
<div class='col-sm-10'>
@if (is_null($personTarget->id))
<select class='js-example-basic-multiple form-control' name='person_id[]' multiple='multiple'>
@foreach ($peopleArray as $personId => $personName)
<option value='{{ $personId }}'>{{ $personName }}</option>
@endforeach
</select>
@else
{{
Form::select(
'person_id',
@@ -61,6 +68,7 @@
]
)
}}
@endif
</div>
</div>
+6 -1
View File
@@ -43,8 +43,13 @@
<script type="text/javascript">
$(document).ready(function() {
$('#datatable').DataTable();
} );
});
$(document).ready(function() {
$('.js-example-basic-multiple').select2();
});
</script>
</body>
</html>
+79
View File
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
<nav class="navbar navbar-expand-md navbar-light navbar-laravel">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
<main class="py-4">
@yield('content')
</main>
</div>
</body>
</html>
+2 -1
View File
@@ -110,7 +110,7 @@
<th align='right'>{!! formatAmount($target->difference()) !!}</th>
<td>
<div class='btn-group' role='group' aria-label='Basic example'>
<a href='/targets/{{ $target->id }}/edit' class='btn btn-primary'>
<a href='/targets/{{ $target->id }}/edit' class='btn btn-success'>
<i class='fas fa-edit'></i>
</a>
<a href='/targets/{{ $target->id }}/delete' class='btn btn-danger'>
@@ -127,6 +127,7 @@
<td></td>
<td align='right'>{!! formatAmount($actual->signedAmount()) !!}</td>
<td></td>
<td></td>
</tr>
@endforeach
@endforeach
+18 -1
View File
@@ -19,6 +19,15 @@
<th>Differenz</th>
<th>Aktion</th>
</tr>
<tr>
<th></th>
<th>SUMME</th>
<th></th>
<th></th>
<th></th>
<th>{!! formatAmount($sums['debts']) !!}</th>
<th></th>
</tr>
@foreach ($personTargets['debts'] as $personTarget)
<tr>
<td>{{ formatDate($personTarget->date) }}</td>
@@ -47,6 +56,15 @@
<th>Differenz</th>
<th>Aktion</th>
</tr>
<tr>
<th></th>
<th>SUMME</th>
<th></th>
<th></th>
<th></th>
<th>{!! formatAmount($sums['receivables']) !!}</th>
<th></th>
</tr>
@foreach ($personTargets['receivables'] as $personTarget)
<tr>
<td>{{ formatDate($personTarget->date) }}</td>
@@ -57,7 +75,6 @@
<td>{!! formatAmount($personTarget->difference()) !!}</td>
<td>
<div class="btn-group" role="group" aria-label="Basic example">
<a href='/targets/{{ $personTarget->id }}' class="btn btn-primary"><i class="fas fa-eye"></i></a>
<a href='/targets/{{ $personTarget->id }}/edit' class="btn btn-success"><i class="fas fa-edit"></i></a>
<a href='/targets/{{ $personTarget->id }}/delete' class="btn btn-danger"><i class="fas fa-trash"></i></a>
</div>