2025-08-10 18:09:07 +02:00

164 lines
9.5 KiB
PHP

@extends('layouts.app')
@section('title', 'Hersteller')
@section('content')
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card glass-card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="mb-0">
<i class="fas fa-industry text-primary"></i>
Hersteller
</h2>
<a href="https://neonail.vogt.de.com/manufacturers/create" class="btn btn-primary">
<i class="fas fa-plus"></i> Neuer Hersteller
</a>
</div>
<div class="card-body">
<!-- Suchformular -->
<form method="GET" action="https://neonail.vogt.de.com/manufacturers" class="mb-4" data-https="true">
<div class="input-group">
<input type="text" name="search" class="form-control"
placeholder="Hersteller suchen..."
value="{{ $search }}">
<button class="btn btn-outline-secondary" type="submit">
<i class="fas fa-search"></i>
</button>
@if($search)
<a href="https://neonail.vogt.de.com/manufacturers" class="btn btn-outline-danger">
<i class="fas fa-times"></i>
</a>
@endif
</div>
</form>
@if(session('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="fas fa-check-circle"></i>
{{ session('success') }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
@endif
@if(session('error'))
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<i class="fas fa-exclamation-circle"></i>
{{ session('error') }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
@endif
@if($manufacturers->count() > 0)
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>Name</th>
<th>Land</th>
<th>Website</th>
<th>Nagellacke</th>
<th>Erstellt</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
@foreach($manufacturers as $manufacturer)
<tr>
<td>
<strong>{{ $manufacturer->name }}</strong>
@if($manufacturer->description)
<br>
<small class="text-muted">{{ Str::limit($manufacturer->description, 50) }}</small>
@endif
</td>
<td>
@if($manufacturer->country)
<span class="badge bg-info">{{ $manufacturer->country }}</span>
@else
<span class="text-muted">-</span>
@endif
</td>
<td>
@if($manufacturer->website)
<a href="{{ $manufacturer->website }}" target="_blank" class="text-decoration-none">
<i class="fas fa-external-link-alt"></i>
Website
</a>
@else
<span class="text-muted">-</span>
@endif
</td>
<td>
<span class="badge bg-primary">{{ $manufacturer->nail_polishes_count }}</span>
</td>
<td>
<small class="text-muted">
{{ $manufacturer->created_at->format('d.m.Y') }}
</small>
</td>
<td>
<div class="btn-group" role="group">
<a href="https://neonail.vogt.de.com/manufacturers/{{ $manufacturer->id }}"
class="btn btn-sm btn-outline-info"
title="Anzeigen">
<i class="fas fa-eye"></i>
</a>
<a href="https://neonail.vogt.de.com/manufacturers/{{ $manufacturer->id }}/edit"
class="btn btn-sm btn-outline-warning"
title="Bearbeiten">
<i class="fas fa-edit"></i>
</a>
@if(!$manufacturer->hasNailPolishes())
<form action="https://neonail.vogt.de.com/manufacturers/{{ $manufacturer->id }}"
method="POST"
class="d-inline"
data-https="true"
onsubmit="return confirm('Sind Sie sicher, dass Sie diesen Hersteller löschen möchten?')">
@csrf
@method('DELETE')
<button type="submit"
class="btn btn-sm btn-outline-danger"
title="Löschen">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="d-flex justify-content-center">
{{ $manufacturers->appends(['search' => $search])->links() }}
</div>
@else
<div class="text-center py-5">
<i class="fas fa-industry fa-3x text-muted mb-3"></i>
<h4 class="text-muted">Keine Hersteller gefunden</h4>
@if($search)
<p class="text-muted">Keine Hersteller für "{{ $search }}" gefunden.</p>
<a href="https://neonail.vogt.de.com/manufacturers" class="btn btn-primary">
Alle Hersteller anzeigen
</a>
@else
<p class="text-muted">Erstellen Sie den ersten Hersteller.</p>
<a href="https://neonail.vogt.de.com/manufacturers/create" class="btn btn-primary">
<i class="fas fa-plus"></i> Ersten Hersteller erstellen
</a>
@endif
</div>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection