@extends('admin.layouts.layout')
@section('content')
    <div class="row match-height">
        <div class="col-md-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title text-primary">Editando Transparência Municipal</h4>
                    <p class="text-muted">Editando Links de Transparência no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('transparencias.index') }}"
                        role="button">Ver todas</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('transparencias.update', ['transparencia' => $transparencias->id]) }}"
                            method="POST" class="form-horizontal">
                            @method('PUT')
                            @csrf
                            <div class="box box-info">

                                <div class="form-group">
                                    <label class="col-form-label">Título</label>
                                    <input type="text" name="titulo" value="{{ $transparencias->titulo }}"
                                        class="form-control @error('titulo') is-invalid @enderror">
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Descrição</label>
                                    <input type="text" name="descricao" value="{{ $transparencias->descricao }}"
                                        class="form-control @error('descricao') is-invalid @enderror">
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Documento</label>
                                    <input type="file" name="documento" value="{{ $transparencias->documento }}"
                                        class="form-control">
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Url</label>
                                    <input type="text" name="url" value="{{ $transparencias->url }}"
                                        class="form-control @error('url') is-invalid @enderror">
                                </div>

                                <div class="row">
                                    <div class="form-group col-md-4">
                                        <label class="control-label">Ícone</label>
                                        <input type="text" name="icone" value="{{ $transparencias->icone }}"
                                            class="form-control @error('icone') is-invalid @enderror">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label class="control-label">Meta</label>
                                        <input type="text" name="meta" value="{{ $transparencias->meta }}"
                                            class="form-control @error('meta') is-invalid @enderror">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="control-label">Covid</label>
                                        <select class="form-control" name="covid" value="{{ $transparencias['covid'] }}">
                                            <option value="N" @if ($transparencias['covid'] == 'N') selected @endif>Não
                                            </option>
                                            <option value="S" @if ($transparencias['covid'] == 'S') selected @endif>Sim
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <input type="submit" value="Gravar" class="btn btn-sm btn-block btn-outline-success">
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
