LMIV-SNACKAUTOMAT/resources/views/admin/tenants/create.blade.php

265 lines
13 KiB
PHP

@extends('layouts.vending')
@section('title', 'Neuen Mandant erstellen')
@section('content')
<div class="max-w-4xl mx-auto px-4">
<div class="mb-8">
<div class="flex items-center justify-between">
<div>
<h1 class="text-3xl font-bold text-gray-900">Neuen Mandant erstellen</h1>
<p class="text-gray-600 mt-2">Erstellen Sie einen neuen Mandanten im System</p>
</div>
<a href="{{ route('admin.tenants.index') }}"
class="bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-600 transition-colors">
Zurück zur Übersicht
</a>
</div>
</div>
<div class="bg-white shadow rounded-lg p-6">
<form action="{{ route('admin.tenants.store') }}" method="POST" enctype="multipart/form-data" class="space-y-6">
@csrf
<!-- Name -->
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">
Name <span class="text-red-500">*</span>
</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-blue-500 @error('name') border-red-500 @enderror">
@error('name')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Beschreibung -->
<div>
<label for="description" class="block text-sm font-medium text-gray-700 mb-2">
Beschreibung
</label>
<textarea id="description"
name="description"
rows="3"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('description') border-red-500 @enderror">{{ old('description') }}</textarea>
@error('description')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Domain -->
<div>
<label for="domain" class="block text-sm font-medium text-gray-700 mb-2">
Domain
</label>
<input type="text"
id="domain"
name="domain"
value="{{ old('domain') }}"
placeholder="z.B. beispiel.de"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('domain') border-red-500 @enderror">
@error('domain')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Public Slug -->
<div>
<label for="public_slug" class="block text-sm font-medium text-gray-700 mb-2">
Öffentlicher Slug für QR-Codes
</label>
<input type="text"
id="public_slug"
name="public_slug"
value="{{ old('public_slug') }}"
placeholder="z.B. firma1, kantinen-service"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('public_slug') border-red-500 @enderror">
<p class="text-gray-500 text-sm mt-1">Wird für QR-Code URLs verwendet: /{public_slug}/machine/automat1</p>
@error('public_slug')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Logo -->
<div>
<label for="logo" class="block text-sm font-medium text-gray-700 mb-2">
Logo
</label>
<input type="file"
id="logo"
name="logo"
accept="image/*"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('logo') border-red-500 @enderror">
<p class="text-gray-500 text-sm mt-1">Unterstützte Formate: JPG, PNG, GIF (max. 2MB)</p>
@error('logo')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Status -->
<div>
<div class="flex items-center">
<input type="checkbox"
id="is_active"
name="is_active"
value="1"
{{ old('is_active', true) ? 'checked' : '' }}
class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
<label for="is_active" class="ml-2 block text-sm text-gray-700">
Mandant ist aktiv
</label>
</div>
@error('is_active')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Anzeige-Einstellungen -->
<div class="border-t pt-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Anzeige-Einstellungen</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<div class="flex items-center">
<input type="checkbox"
id="show_prices"
name="show_prices"
value="1"
{{ old('show_prices', true) ? 'checked' : '' }}
class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
<label for="show_prices" class="ml-2 block text-sm text-gray-700">
Preise anzeigen
</label>
</div>
<p class="text-gray-500 text-xs mt-1">Produktpreise für Kunden sichtbar</p>
@error('show_prices')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<div>
<div class="flex items-center">
<input type="checkbox"
id="show_stock"
name="show_stock"
value="1"
{{ old('show_stock', true) ? 'checked' : '' }}
class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500">
<label for="show_stock" class="ml-2 block text-sm text-gray-700">
Verfügbarkeit anzeigen
</label>
</div>
<p class="text-gray-500 text-xs mt-1">Bestandsinformationen für Kunden sichtbar</p>
@error('show_stock')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
</div>
</div>
<!-- Adressdaten -->
<div class="border-t pt-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Adressdaten</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="md:col-span-2">
<div class="grid grid-cols-3 gap-4">
<div class="col-span-2">
<label for="street" class="block text-sm font-medium text-gray-700 mb-2">
Straße
</label>
<input type="text"
id="street"
name="street"
value="{{ old('street') }}"
placeholder="z.B. Musterstraße"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('street') border-red-500 @enderror">
@error('street')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<div>
<label for="house_number" class="block text-sm font-medium text-gray-700 mb-2">
Hausnummer
</label>
<input type="text"
id="house_number"
name="house_number"
value="{{ old('house_number') }}"
placeholder="z.B. 123a"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('house_number') border-red-500 @enderror">
@error('house_number')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
</div>
</div>
<div>
<label for="postal_code" class="block text-sm font-medium text-gray-700 mb-2">
PLZ
</label>
<input type="text"
id="postal_code"
name="postal_code"
value="{{ old('postal_code') }}"
placeholder="z.B. 12345"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('postal_code') border-red-500 @enderror">
@error('postal_code')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<div>
<label for="city" class="block text-sm font-medium text-gray-700 mb-2">
Stadt
</label>
<input type="text"
id="city"
name="city"
value="{{ old('city') }}"
placeholder="z.B. Musterstadt"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('city') border-red-500 @enderror">
@error('city')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
<div class="md:col-span-2">
<label for="country" class="block text-sm font-medium text-gray-700 mb-2">
Land
</label>
<input type="text"
id="country"
name="country"
value="{{ old('country', 'Deutschland') }}"
placeholder="z.B. Deutschland"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 @error('country') border-red-500 @enderror">
@error('country')
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
@enderror
</div>
</div>
</div>
<!-- Buttons -->
<div class="flex items-center justify-between pt-4 border-t">
<a href="{{ route('admin.tenants.index') }}"
class="bg-gray-500 text-white px-6 py-2 rounded hover:bg-gray-600 transition-colors">
Abbrechen
</a>
<button type="submit"
class="bg-blue-600 text-white px-6 py-2 rounded hover:bg-blue-700 transition-colors">
Mandant erstellen
</button>
</div>
</form>
</div>
</div>
@endsection