@extends('frame') 

@section('title', 'Den | Sources Admin')

    @php
    switch($mode)
        {
            case 'source-create':
                $action_url = '/den/source/create';
                break;
            case 'source-edit':
                $action_url = '/den/source/edit';
                break;
        }
    @endphp
    @section('main-content')
        <section>
            <article>
                @switch($mode)
                    @case('source-edit') 
                    <h2>Edit Info for {{$source->url}}</h2>
                    @include('forms.source-edit') 
                    <br />
                    @break

                    @case('source-create') 
                    <h2>New Source Info</h2>
                    @include('forms.source-edit') 
                    <br />
                    @break

                    @default
                        <h2>Current Sources </h2>
                        @foreach($sources as $source)
                            <a href="/den/source/{{$source->id}}">{{$source->url}}</a><br />
                        @endforeach
                        <h2>Add Source </h2>
                        <a href="/den/source/edit/create">Add a new Source</a><br />
                    @endswitch
            </article>
        </section>
    @endsection