Created
March 25, 2017 15:23
-
-
Save event15/65f2b30994925caea6d3b0de8420efaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<div class="col-sm-offset-2 col-sm-8"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
New Task | |
</div> | |
<div class="panel-body"> | |
<!-- Display Validation Errors --> | |
@include('common.errors') | |
<!-- New Task Form --> | |
<form action="{{ url('task')}}" method="POST" class="form-horizontal"> | |
{{ csrf_field() }} | |
<!-- Task Name --> | |
<div class="form-group"> | |
<label for="task-name" class="col-sm-3 control-label">Task</label> | |
<div class="col-sm-6"> | |
<input type="text" name="name" id="task-name" class="form-control" value="{{ old('task') }}"> | |
</div> | |
</div> | |
<!-- Add Task Button --> | |
<div class="form-group"> | |
<div class="col-sm-offset-3 col-sm-6"> | |
<button type="submit" class="btn btn-default"> | |
<i class="fa fa-btn fa-plus"></i>Add Task | |
</button> | |
</div> | |
</div> | |
</form> | |
</div> | |
</div> | |
<!-- Current Tasks --> | |
@if (count($tasks) > 0) | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
Current Tasks | |
</div> | |
<div class="panel-body"> | |
<table class="table table-striped task-table"> | |
<thead> | |
<th>Task</th> | |
<th> </th> | |
</thead> | |
<tbody> | |
@foreach ($tasks as $task) | |
<tr> | |
<td class="table-text"><div>{{ $task->name }}</div></td> | |
<!-- Task Delete Button --> | |
<td> | |
<form action="{{ url('task/'.$task->id) }}" method="POST"> | |
{{ csrf_field() }} | |
{{ method_field('DELETE') }} | |
<button type="submit" class="btn btn-danger"> | |
<i class="fa fa-btn fa-trash"></i>Delete | |
</button> | |
</form> | |
</td> | |
</tr> | |
@endforeach | |
</tbody> | |
</table> | |
</div> | |
</div> | |
@endif | |
</div> | |
</div> | |
@endsection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment