@extends('backend.layouts.app')
@section('content')
<div class="content-wrapper">
  <section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Add Season</h1>
          <small>Series: <strong>{{ $series->title }}</strong></small>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div class="card">
            <form action="{{ route('admin.seasons.insert', $series->id) }}" method="post">
              @csrf
              <div class="card-body">
                @if($errors->any())
                  <div class="alert alert-danger">
                    <ul class="mb-0">@foreach($errors->all() as $e)<li>{{ $e }}</li>@endforeach</ul>
                  </div>
                @endif

                <div class="form-group">
                  <label>Season Number <span class="text-danger">*</span></label>
                  <input type="number" class="form-control" name="season_number" value="{{ old('season_number') }}" min="1" placeholder="e.g. 1">
                </div>

                <div class="form-group">
                  <label>Title (optional)</label>
                  <input type="text" class="form-control" name="title" value="{{ old('title') }}" placeholder="e.g. Season 1">
                </div>

                <div class="form-group">
                  <label>Description</label>
                  <textarea name="description" class="form-control" rows="4">{{ old('description') }}</textarea>
                </div>
              </div>
              <div class="card-footer">
                <button type="submit" class="btn btn-primary">Save Season</button>
                <a href="{{ url('admin/series/'.$series->id.'/seasons') }}" class="btn btn-secondary ml-2">Cancel</a>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </section>
</div>
@endsection
