Browse Source

grains refactor mkV

master
jk 3 years ago
parent
commit
4ce3791bed
  1. 85
      resources/views/grains.blade.php

85
resources/views/grains.blade.php

@ -1,89 +1,8 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
@include('inc.navbar')
<div class="card-header"><a href="/home">Home</a> -> {{ __('Grain List') }}<span class="backlink"><a href="{{url()->previous()}}">Go Back</a></span></div>
<div class="card-body">
@if (Auth::user()->isAdmin())
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addModal" type="button" name="button" >
Add Grain
</button>
<hr />
@endif
<table class="table table-striped table-dark" id="table-programs">
<!-- This piece of code is for error messages display purposes -->
@include('inc.messages')
<tbody>
@foreach ($grains as $grain)
<tr>
<td><a href="/grain/{{$grain->id}}">{{$grain->name}}</a> </td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- this code if for the modal -->
<div class="modal fade bg-primary text-dark" tabindex="-1" role="dialog" id="addModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Add Grain</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">x</span>
</button>
</div>
<div class="modal-body">
<form class="" action="{{route('grains.store')}}" method="post">
{{csrf_field()}}
<div class="form-group">
<label for="">Name</label>
<input type="text" class="form-control" name="name">
</div>
<div class="form-group">
<label for="">Flavour</label>
<textarea type="text" class="form-control" name="flavour" ></textarea>
</div>
<div class="form-group">
<label for="">Colour</label>
<input type="text" class="form-control" name="colour">
</div>
<div class="form-group">
<label for="">Lovibond</label>
<input type="text" class="form-control" name="lovibond">
</div>
<div class="form-group">
<label for="">Windisch-Kolbach</label>
<input type="text" class="form-control" name="winkol">
</div>
<div class="form-group">
<label for="">Lintner</label>
<input type="text" class="form-control" name="lintner">
</div>
<div class="form-group">
<label for="">EBC</label>
<input type="text" class="form-control" name="ebc">
</div>
<div class="form-group">
<label for="">Alternative Grain(s)</label>
<input type="text" class="form-control" name="alternative">
</div>
<input type="submit" name="submit" value="Submit" class="btn btn-success">
</form>
</div>
</div>
</div>
<div class="container">
@yield('main')
</div>
@endsection
Loading…
Cancel
Save