144 lines
7.8 KiB
PHP
144 lines
7.8 KiB
PHP
@extends('layouts.vending')
|
|
|
|
@section('title', 'Neuer Automat')
|
|
|
|
@section('content')
|
|
<div class="max-w-4xl mx-auto px-4">
|
|
<div class="mb-8">
|
|
<div class="flex items-center space-x-4 mb-4">
|
|
<a href="{{ route('vending-machines.index') }}" class="text-blue-600 hover:text-blue-800">
|
|
← Zurück zur Übersicht
|
|
</a>
|
|
</div>
|
|
<h1 class="text-3xl font-bold text-gray-900">Neuen Snackautomaten erstellen</h1>
|
|
<p class="text-gray-600 mt-2">Grunddaten für einen neuen Automaten erfassen</p>
|
|
</div>
|
|
|
|
<form action="{{ route('vending-machines.store') }}" method="POST" class="space-y-8">
|
|
@csrf
|
|
|
|
<!-- Grundinformationen -->
|
|
<div class="bg-white shadow rounded-lg p-6">
|
|
<h2 class="text-xl font-semibold text-gray-900 mb-6 border-b border-gray-200 pb-2">
|
|
Grundinformationen
|
|
</h2>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div>
|
|
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Automatname *
|
|
</label>
|
|
<input type="text" id="name" name="name" value="{{ old('name') }}" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('name') border-red-500 @enderror">
|
|
@error('name')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="slug" class="block text-sm font-medium text-gray-700 mb-2">
|
|
URL-Slug (wird automatisch generiert)
|
|
</label>
|
|
<input type="text" id="slug" name="slug" value="{{ old('slug') }}"
|
|
placeholder="wird-automatisch-erstellt"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('slug') border-red-500 @enderror">
|
|
<p class="mt-1 text-sm text-gray-500">Leer lassen für automatische Generierung basierend auf dem Namen</p>
|
|
@error('slug')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="machine_number" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Maschinennummer *
|
|
</label>
|
|
<input type="text" id="machine_number" name="machine_number" value="{{ old('machine_number') }}" required
|
|
placeholder="z.B. automat-1, snackost"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('machine_number') border-red-500 @enderror">
|
|
<p class="mt-1 text-sm text-gray-500">Eindeutige Nummer für URLs (nur Buchstaben, Zahlen und Bindestriche)</p>
|
|
@error('machine_number')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<label for="location" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Standort *
|
|
</label>
|
|
<input type="text" id="location" name="location" value="{{ old('location') }}" required
|
|
placeholder="z.B. Bürogebäude A, 1. Stock, Pausenbereich"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('location') border-red-500 @enderror">
|
|
@error('location')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<label for="description" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Beschreibung
|
|
</label>
|
|
<textarea id="description" name="description" rows="3"
|
|
placeholder="Zusätzliche Informationen zum Automaten..."
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('description') border-red-500 @enderror">{{ old('description') }}</textarea>
|
|
@error('description')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="max_slots" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Maximale Anzahl Slots *
|
|
</label>
|
|
<input type="number" id="max_slots" name="max_slots" value="{{ old('max_slots', 24) }}" min="1" max="100" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 @error('max_slots') border-red-500 @enderror">
|
|
@error('max_slots')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
<p class="text-xs text-gray-500 mt-1">Anzahl der verfügbaren Produktfächer (1-100)</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="flex items-center mt-8">
|
|
<input type="checkbox" name="is_active" id="is_active" value="1"
|
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
|
|
{{ old('is_active', true) ? 'checked' : '' }}>
|
|
<span class="ml-2 text-sm text-gray-700">Automat ist aktiv</span>
|
|
</label>
|
|
<p class="text-xs text-gray-500 mt-1">Nur aktive Automaten werden öffentlich angezeigt</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Slots automatisch erstellen -->
|
|
<div class="bg-white shadow rounded-lg p-6">
|
|
<h2 class="text-xl font-semibold text-gray-900 mb-6 border-b border-gray-200 pb-2">
|
|
Slot-Konfiguration
|
|
</h2>
|
|
|
|
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
|
<h3 class="font-semibold text-blue-900 mb-2">Automatische Slot-Erstellung</h3>
|
|
<p class="text-blue-800 text-sm mb-3">
|
|
Nach dem Erstellen des Automaten werden automatisch die angegebene Anzahl von Slots erstellt.
|
|
Sie können diese dann einzeln konfigurieren und mit Produkten befüllen.
|
|
</p>
|
|
<div class="text-blue-700 text-sm">
|
|
<strong>Slot-Nummerierung:</strong> 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, 30, 31, ...
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Aktionsbuttons -->
|
|
<div class="flex justify-between items-center bg-gray-50 px-6 py-4 rounded-lg">
|
|
<a href="{{ route('vending-machines.index') }}"
|
|
class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
|
|
Abbrechen
|
|
</a>
|
|
|
|
<button type="submit"
|
|
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
|
|
Automaten erstellen
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
@endsection |