@extends('admin.layout') @section('admin-title') {{ $shop->id ? 'Edit' : 'Create' }} Shop @endsection @section('admin-content') {!! breadcrumbs(['Admin Panel' => 'admin', 'Shops' => 'admin/data/shops', ($shop->id ? 'Edit' : 'Create') . ' Shop' => $shop->id ? 'admin/data/shops/edit/' . $shop->id : 'admin/data/shops/create']) !!}

{{ $shop->id ? 'Edit' : 'Create' }} Shop @if ($shop->id) ({!! $shop->displayName !!}) Delete Shop @endif

{!! Form::open(['url' => $shop->id ? 'admin/data/shops/edit/' . $shop->id : 'admin/data/shops/create', 'files' => true]) !!}

Basic Information

{!! Form::label('Name') !!} {!! Form::text('name', $shop->name, ['class' => 'form-control']) !!}
{!! Form::label('Shop Image (Optional)') !!} {!! add_help('This image is used on the shop index and on the shop page as a header.') !!}
{!! Form::label('image', 'Choose file...', ['class' => 'custom-file-label']) !!} {!! Form::file('image', ['class' => 'custom-file-input']) !!}
Recommended size: None (Choose a standard size for all shop images)
@if ($shop->has_image)
{!! Form::checkbox('remove_image', 1, false, ['class' => 'form-check-input']) !!} {!! Form::label('remove_image', 'Remove current image', ['class' => 'form-check-label']) !!}
@endif
{!! Form::label('Description (Optional)') !!} {!! Form::textarea('description', $shop->description, ['class' => 'form-control wysiwyg']) !!}
{!! Form::checkbox('is_active', 1, $shop->id ? $shop->is_active : 1, ['class' => 'form-check-input', 'data-toggle' => 'toggle']) !!} {!! Form::label('is_active', 'Set Active', ['class' => 'form-check-label ml-3']) !!} {!! add_help('If turned off, the shop will not be visible to regular users.') !!}
{!! Form::checkbox('is_staff', 1, $shop->id ? $shop->is_staff : 0, ['class' => 'form-check-input', 'data-toggle' => 'toggle']) !!} {!! Form::label('is_staff', 'For Staff?', ['class' => 'form-check-label ml-3']) !!} {!! add_help('If turned on, the shop will not be visible to regular users, only staff.') !!}
{!! Form::checkbox('use_coupons', 1, $shop->id ? $shop->use_coupons : 0, ['class' => 'form-check-label', 'data-toggle' => 'toggle', 'id' => 'use_coupons']) !!} {!! Form::label('use_coupons', 'Allow Coupons?', ['class' => 'form-check-label ml-3']) !!} {!! add_help('Note that ALL coupons will be allowed to be used, unless specified otherwise.') !!}
{!! Form::label('allowed_coupons', 'Allowed Coupon(s)', ['class' => 'form-check-label']) !!}

Leave blank to allow ALL coupons.

{!! Form::select('allowed_coupons[]', $coupons, json_decode($shop->allowed_coupons, 1), ['multiple', 'class' => 'form-check-label', 'placeholder' => 'Select Coupons', 'id' => 'allowed_coupons']) !!}
{!! Form::checkbox('is_fto', 1, $shop->id ? $shop->is_fto : 0, ['class' => 'form-check-label', 'data-toggle' => 'toggle']) !!} {!! Form::label('is_fto', 'FTO Only?', ['class' => 'form-check-label ml-3']) !!} {!! add_help('Only users who are currently FTO and staff can enter.') !!}

{!! Form::checkbox('is_timed_shop', 1, $shop->is_timed_shop ?? 0, ['class' => 'form-check-input shop-timed shop-toggle shop-field', 'id' => 'is_timed_shop']) !!} {!! Form::label('is_timed_shop', 'Set Timed Shop', ['class' => 'form-check-label ml-3']) !!} {!! add_help('Sets the shop as timed between the chosen dates.') !!}
{!! Form::label('start_at', 'Start Time') !!} {!! add_help('The shop will cycle in at this date.') !!} {!! Form::text('start_at', $shop->start_at, ['class' => 'form-control', 'id' => 'datepicker2']) !!}
{!! Form::label('end_at', 'End Time') !!} {!! add_help('The shop will cycle out at this date.') !!} {!! Form::text('end_at', $shop->end_at, ['class' => 'form-control', 'id' => 'datepicker3']) !!}
{!! Form::submit($shop->id ? 'Edit' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!} @if ($shop->id) {!! Form::open(['url' => 'admin/data/shops/restrictions/' . $shop->id]) !!}

Restrict Shop

{!! Form::checkbox('is_restricted', 1, $shop->is_restricted, ['class' => 'is-restricted-class form-check-label', 'data-toggle' => 'toggle']) !!} {!! Form::label('is_restricted', 'Should this shop require an item to enter?', ['class' => 'is-restricted-label form-check-label ml-3']) !!} {!! add_help('If turned on, the shop will cannot be entered unless the user currently owns all required items.') !!}
{!! Form::submit('Edit', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}

Shop Stock

Add Stock
@foreach ($shop->stock as $stock)
@if ($stock->item->has_image)
{{ $stock->item->name }}
@endif
Cost: {!! $stock->currency->display($stock->cost) !!}
@if (!$stock->is_visible)
@endif @if ($stock->is_timed_stock)
@endif
@if ($stock->is_limited_stock)
Stock: {{ $stock->quantity }}
@endif @if ($stock->is_limited_stock)
Restock: {!! $stock->restock ? '' : '' !!}
@endif @if ($stock->purchase_limit)
Max {{ $stock->purchase_limit }} @if ($stock->purchase_limit_timeframe !== 'lifetime') {{ $stock->purchase_limit_timeframe }} @endif per user
@endif @if ($stock->disallow_transfer)
Cannot be transferred
@endif
{{-- trash icon --}}
@endforeach
@endif
{!! Form::label('item_id', 'Item', ['class' => 'col-form-label']) !!}
{!! Form::select('item_id[]', $items, null, ['class' => 'form-control', 'placeholder' => 'Select Item']) !!}
Remove
@endsection @section('scripts') @parent @endsection