From a8673b20369be09e0a7087b9e2fa91285c3e6634 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Wed, 28 Jun 2017 13:44:06 -0400 Subject: [PATCH] 113 - Viewing the Update Form Just the view, saving changes not yet implemented. --- .../Backstage/ConcertsController.php | 11 + .../views/backstage/concerts/edit.blade.php | 204 ++++++++++++++++++ .../views/backstage/concerts/index.blade.php | 3 - routes/web.php | 2 +- tests/Feature/Backstage/EditConcertTest.php | 84 ++++++++ .../Feature/Backstage/ViewConcertListTest.php | 4 - tests/TestCase.php | 5 + 7 files changed, 305 insertions(+), 8 deletions(-) create mode 100644 resources/views/backstage/concerts/edit.blade.php create mode 100644 tests/Feature/Backstage/EditConcertTest.php diff --git a/app/Http/Controllers/Backstage/ConcertsController.php b/app/Http/Controllers/Backstage/ConcertsController.php index 6d9be22..7030596 100644 --- a/app/Http/Controllers/Backstage/ConcertsController.php +++ b/app/Http/Controllers/Backstage/ConcertsController.php @@ -55,4 +55,15 @@ class ConcertsController extends Controller return redirect()->route('concerts.show', $concert); } + + public function edit($id) + { + $concert = Auth::user()->concerts()->findOrFail($id); + + abort_if($concert->isPublished(), 403); + + return view('backstage.concerts.edit', [ + 'concert' => $concert, + ]); + } } diff --git a/resources/views/backstage/concerts/edit.blade.php b/resources/views/backstage/concerts/edit.blade.php new file mode 100644 index 0000000..7620a3c --- /dev/null +++ b/resources/views/backstage/concerts/edit.blade.php @@ -0,0 +1,204 @@ +@extends('layouts.master') + +@section('body') + + + + + + + + + + {{ csrf_field() }} + Log out + + + + + + + + + + Edit concert + + + + {{ csrf_field() }} + {{ method_field('PATCH') }} + + @if ($errors->any()) + + + + There {{ $errors->count() == 1 ? 'is' : 'are' }} {{ $errors->count() }} {{ str_plural('error', $errors->count() )}} with this concert: + + + @foreach ($errors->all() as $error) + {{ $error }} + @endforeach + + + + @endif + + + + + + + Concert Details + Tell us who's playing! (Please be Slayer!) + Include the headliner in the concert name, use the subtitle section to list any opening bands, and add any important information to the description. + + + + + + + Title + + + + Subtitle + + + + Additional Information + {{ old('additional_information', $concert->additional_information) }} + + + + + + + + + + + + + Date & Time + True metalheads really only care about the obscure openers, so make sure they don't get there late! + + + + + + + + + Date + + + + + + + Start Time + + + + + + + + + + + + + + + + Venue Information + Where's the show? Let attendees know the venue name and address so they can bring the mosh. + + + + + + + Venue Name + + + + Stree Address + + + + + + City + + + + + + State/Province + + + + + + ZIP + + + + + + + + + + + + + + + + Tickets & Pricing + Set your ticket price and availability, but don't forget, metalheads are cheap so keep it reasonable. + + + + + + + + + Price + + + $ + + + + + + + + Ticket Quantity + + + + + + + + + + + + Save Changes + + + + + +@endsection diff --git a/resources/views/backstage/concerts/index.blade.php b/resources/views/backstage/concerts/index.blade.php index 895a0ec..74435db 100644 --- a/resources/views/backstage/concerts/index.blade.php +++ b/resources/views/backstage/concerts/index.blade.php @@ -48,9 +48,6 @@ {{ $concert->formatted_date }} @ {{ $concert->formatted_start_time }}
Tell us who's playing! (Please be Slayer!)
Include the headliner in the concert name, use the subtitle section to list any opening bands, and add any important information to the description.
True metalheads really only care about the obscure openers, so make sure they don't get there late!
Where's the show? Let attendees know the venue name and address so they can bring the mosh.
Set your ticket price and availability, but don't forget, metalheads are cheap so keep it reasonable.