Add attachments, more pages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tyler
2020-12-26 19:34:07 -05:00
parent d086b29bcc
commit a1ac81a73a
29 changed files with 2349 additions and 17899 deletions

View File

@ -6,6 +6,9 @@
<div class="form-row justify-content-md-center">
<div class="col-4">
<select name="location" class="form-control select2-location">
@foreach ($locations as $location)
<option value="{{ $location->name }}">{{ $location->name }}</option>
@endforeach
</select>
</div>
</div>
@ -21,9 +24,11 @@
@endif
</div>
<div class="row">
<button class="btn btn-primary" name="save" type="submit">
Save
</button>
<div class="col-2">
<button class="btn btn-primary" name="save" type="submit" style="width:100%">
Save
</button>
</div>
</div>
</form>
@include('partials/row', [ 'id' => 'add-template', 'htmlClass' => 'invisible' ])

View File

@ -0,0 +1,18 @@
@extends('layouts.main')
@section('content')
<h3>{{ $book->name }}</h3>
<h5>By: {{ $book->authors->pluck('name')->join(', ') }}</h5>
<br />
@if ($thumbnail = $book->attachment('thumbnail'))
<h5>Image</h5>
<p>
<img src="{{ $thumbnail->url }}" />
</p>
@endif
<h5>Location:</h5>
<p>
{{ $book->location->name }}
</p>
@endsection

View File

View File

@ -1,11 +1,12 @@
@extends('layouts.main')
@section('content')
<table class="table table-compact">
<table class="table table-compact table-striped">
<thead>
<th>Name</th>
<th>Authors</th>
<th>Location</th>
<th>Actions</th>
</thead>
<tbody>
@foreach ($rows as $row)
@ -13,6 +14,9 @@
<td>{{ $row->name }}</td>
<td>{{ $row->authors->pluck('name')->join(', ') }}</td>
<td>{{ $row->location->name }}</td>
<td>
<a class="btn btn-info btn-sm" href="{{ route('books.show', $row->id) }}">View</a>
</td>
</tr>
@endforeach
</tbody>

View File

@ -21,7 +21,6 @@
</main><!-- /.container -->
<script src="{{ mix('js/app.js') }}"></script>
<script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script>
@stack('scripts')
</body>
</html>

View File

@ -0,0 +1,21 @@
@extends('layouts.main')
@section('content')
<table class="table table-compact">
<thead>
<th>Name</th>
<th>Actions</th>
</thead>
<tbody>
@foreach ($locations as $row)
<tr>
<td>{{ $row->name }}</td>
<td>
<a href="{{ route('locations.show', $row->id) }}" class="btn btn-info btn-sm">View</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $locations->links() }}
@endsection

View File

@ -0,0 +1,24 @@
@extends('layouts.main')
@section('content')
<h3>{{ $location->name }}</h3>
<table class="table table-compact">
<thead>
<th>Name</th>
<th>Authors</th>
</thead>
<tbody>
@foreach ($rows as $row)
<tr data-id="{{ $row->id }}" data-url="{{ route('books.show', $row->id) }}">
<td>{{ $row->name }}</td>
<td>{{ $row->authors->pluck('name')->join(', ') }}</td>
<td>
<a class="btn btn-info btn-sm" href="{{ route('books.show', $row->id) }}">View</a>
<button class="remove-item btn btn-danger btn-sm">Remove</button>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $rows->links() }}
@endsection

View File

@ -11,7 +11,10 @@
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="/add">Add</a>
<a class="nav-link" href="{{ route('locations.index') }}">Locations</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('add') }}">Add</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" action="{{ route('search') }}">