@extends('layouts.pro-logged-in')
@section('content')
<div class="container" id="note-container">
    <div class="row">
        <div class="col-md-12 mt-2">
            <div class="card">
                <div class="card-header">
                    Note details:
                </div>
                <div class="card-body">
                    <div class="mb-2">
                        <a href="{{route('select_section_template_form', $note->uid)}}"
                            up-modal="#select_section_template_form" up-history="false" class="btn btn-primary">Add
                            section</a>
                    </div>
                    @if(!$note->sections->count())
                    <div class="alert alert-info">No sections on this note.</div>
                    @else

                    @foreach ($note->sections as $section)
                    <div class="card">
                        <div class="card-header">
                            {{$section->sectionTemplate->title}}
                        </div>
                        <div class="card-body">
                            {!! $section->summary_html !!}
                        </div>
                        <div class="card-footer">
                            <a href="{{route('section_update_form', $section->uid)}}"
                                up-modal="#section_form" up-history="false" class="btn btn-primary">Update section</a>
                        </div>
                    </div>
                    @endforeach
                    @endif
                </div>
            </div>
        </div>
    </div>
</div>
@endsection