@extends('admin::Layouts.master')
@section('content')
<div class="container-fluid pt-4">
    @include('partials.messages')
    @include('partials.admin.settings-tabs', ['subactive' => 'prefix'])
    <div class="d-none d-lg-flex">
        <div class="col-12 col-lg-4 font-weight-bolder">Präfix</div>
        <div class="col-12 col-lg-4 font-weight-bolder">Anzeigestil</div>
        <div class="col-12 col-lg-2 font-weight-bolder text-center">Anz. Themen</div>
    </div>
    @forelse($prefixes as $prefix)
    <div class="d-flex hover align-items-center{{ $loop->last ? ' mb-3' : '' }}">
        <div class="col-12 col-lg-4">
            <a href="{{ route('admin.settings.prefix.edit', [$prefix->uuid]) }}" class="d-block">
                {{ $prefix->prefix }}
            </a>
        </div>
        <div class="col-12 col-lg-4">
            {!! $prefix->display_style !!}
        </div>
        <div class="col-12 col-lg-2 text-lg-center">
            {{ $prefix->threads_count }}
        </div>
        <div class="col-12 col-lg-2 text-lg-end">
            <form action="{{ route('admin.settings-prefix.destroy') }}" enctype="multipart/form-data" method="post" class="delete" data-message="Wollen Sie diesen Präfix wirklich löschen?">
                @csrf
                <input type="hidden" name="uuid" value="{{ $prefix->uuid }}">
                <button class="btn">
                    <span class="far fa-trash-alt"></span>
                </button>
            </form>
        </div>
    </div>
    @empty
    <div class="row my-3">
        <div class="col-12 text-center">
            Es sind keine Präfixe in der Datenbank vorhanden.
        </div>
    </div>
    @endforelse
    @include('partials.button', ['context' => 'primary', 'href' => 'admin.settings.prefix.create', 'parameters' => [], 'icon' => 'plus', 'label' => 'Neuen Präfix erstellen'])
</div>
@stop
