@extends('adminlte::layouts.app')

@section('htmlheader_title')
	Setup
@endsection
@section('page_title')
	Setup
@endsection

@section('contentheader_title')
	{{ $site->site_name }}
@endsection
@section('contentheader_description')
	Setup #{{ $site->site_id }}
@endsection

@section('main-content')
	<div class="row">
		<div class="col-12">

			<div class="card card-dark">
				<div class="card-header">
					<h1 class="card-title">Setup Configuration</h1>
					<x-leenooks::button.success class="float-right"/>
				</div>

				<div class="card-body">
					<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
						@csrf

						<div class="row">
							<div class="col-12 col-sm-6 col-lg-4">
								<div class="row">
									<div class="col">
										<x-leenooks::form.text name="site_name" label="Organisation Name" helper="System Name used everywhere." feedback="Organisation Name is required!" :value="$site->site_name" required/>
									</div>
								</div>

								<div class="row">
									<div class="col">
										<x-leenooks::form.text name="site_address1" label="Address" placeholder="Address..." :value="$site->site_address1" required/>
										<x-leenooks::form.text name="site_address2" helper="At Least 1 address line required" :value="$site->site_address2"/>
									</div>
								</div>

								<div class="row">
									<div class="col-12 col-md-8">
										<x-leenooks::form.text name="site_city" label="City" feedback="City is required" :value="$site->site_city" required/>
									</div>
								</div>

								<div class="row">
									<div class="col-12 col-md-4">
										<x-leenooks::form.text name="site_state" label="State" feedback="State is required" :value="$site->site_state" required/>
									</div>
									<div class="col-12 col-md-4">
										<x-leenooks::form.text name="site_postcode" label="Post Code" feedback="Postcode is required" :value="$site->site_postcode" required/>
									</div>
								</div>
							</div>

							<div class="col-12 col-sm-6 col-lg-4">
								<x-leenooks::form.text name="site_phone" label="Phone" :value="$site->site_phone"/>
								<x-leenooks::form.text name="site_fax" label="Fax" :value="$site->site_fax"/>
								<x-leenooks::form.email name="site_email" label="Email" feedback="Email is required" :value="$site->site_email" required/>
								<x-leenooks::form.text name="site_tax" label="Tax Number" prepend="<small>ABN</small>" feedback="Tax Number is required" :value="$site->site_tax" required/>
							</div>

							<div class="col-12 col-sm-6 col-lg-4">
								<div class="row">
									<div class="col">
										<x-leenooks::form.file name="site_logo" label="Site Logo" helper="Choose a file" :value="$site->site_logo"><img class="col-12 p-2 border mb-4" src="{{ asset($site->site_logo) }}"></x-leenooks::form.file>
									</div>
								</div>

								<div class="row">
									<div class="col">
										<x-leenooks::form.file name="email_logo" label="Email Logo" helper="Choose a file" :value="$site->email_logo"><img class="col-12 p-2 border mb-4" src="{{ asset($site->email_logo) }}"></x-leenooks::form.file>
									</div>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="col-12">
								<x-leenooks::form.textarea name="site_description" label="Organisation Description" placeholder="Site Description..." helper="Brief description of site." :value="$site->site_description"/>
							</div>
						</div>

						<div class="row">
							<div class="col-12">
								<x-leenooks::button.cancel/>
								@can('wholesaler')
									<x-leenooks::button.submit class="float-right">Save</x-leenooks::button.submit>
								@endcan
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
@endsection