@extends('layouts.pmar.theme')
@section("title", env("APP_NAME") . " :: Boletim Oficial")
@section('content')

    <section>
        <div class="container">
            <div class="row">
                <hr />
                <div class="col-12">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="{{ route("paginas.home") }}">{{ __("Portal") }}</a>
                            </li>
                            <li class="breadcrumb-item active" aria-current="page">{{ __("Boletim Oficial do Município de Angra dos Reis") }}</li>
                        </ol>
                    </nav>
                </div>
                <div class="col-12">
                    <h1>{{ __("Boletim Oficial do Município de Angra dos Reis") }}</h1>
                </div>
            </div>
        </div>
    </section>

    <section>
        <div class="container">
            <div class="row my-5">
                <div class="col-9 p-5">
                    <article class="article-main">
                        <h2 class="text-primary fw-bold">{{ __("Ano:") }} <span class="currentYear"></span></h2>
                        <div class="col-3 my-3">
                            <select class="form-select form-seletc-lg" id="endpoint" data-endpoint="https://portal.angra.rj.gov.br/boletim-oficial-list.asp?ano=" onchange="javascript:preparaBoletins()">
                                <option value="">---- {{ __("Anos Anteriores") }} ----</option>
                                @php
                            $startingYear = 2004;
                            $currentYear = (int) date("Y");
                            @endphp
                                @while($currentYear != $startingYear)
                                    <option value="{{ $currentYear }}">{{ $currentYear }}</option>
                                    @php $currentYear-- @endphp
                                @endwhile
                            </select>
                        </div>

                        <div class="text-center tBodyDownload table-responsive">

                        </div>
                    </article>
                </div>

                <div class="col-3 ">
                    <div class="row">
                        <div class="col p-4">
                            <div class="card-slug">
                                <h2 class="royal-blue">Leia Mais</h2>
                            @foreach($noticias as $noticia)
                                    <div class="my-4">
                                <!-- <span class="news-label">{{ $noticia->title }}</span> -->
                                        <h5 class="slug-summary mt-3">
                                            <a href="{{ route('paginas.slug', [date('d-m-Y', strtotime($noticia->created_at)), $noticia->slug]) }}">
                                                {{ Str::limit(html_entity_decode($noticia->summary), 50) }}
                                            </a>
                                        </h5>
                                    </div>
                                    <hr>
                                @endforeach

                                <a href="{{ route("paginas.noticias") }}" class="mt-5 px-4 py-2 btn border-1 bg-blue-gradient text-white text-start text-center rounded-5">{{ __("Ver
                                Mais") }}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

@endsection