@extends('layouts.public.main')

@section('content')
    <div class="page-header header-filter clear-filter purple-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}});">
        <div class="container">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto">
                    <div class="brand">
                        <h2>{{ $new->title }}</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="main main-raised">
        <div class="container">
            <div class="section">
                <div class="row">
                    <div class="col-md-12">
                        <div class="row gtr-50 gtr-uniform">
                            @foreach ($new->pictures as $picture)
                                <div @if ($loop->first)
                                     class="col-12"
                                     @else
                                     class="col-4"
                                        @endif><span class="image fit"><a href="/picture/{{$picture->id}}"><img src="{{ $picture->url }}" alt="{{ $picture->title }}"></a></span></div>
                            @endforeach
                        </div>
                        <p>
                            {{ $new->body }}
                        </p>
                        <span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span>
                    </div>
                </div>
                <a href="{{ url()->previous() }}" class="btn button primary">Retour</a>
            </div>
        </div>
@endsection

