@extends('admin.layout')
@section('admin-title')
{{ $hunt->id ? 'Edit' : 'Create' }} Scavenger Hunt
@endsection
@section('admin-content')
{!! breadcrumbs(['Admin Panel' => 'admin', 'Scavenger Hunts' => 'admin/data/hunts', ($hunt->id ? 'Edit' : 'Create') . ' Scavenger Hunt' => $hunt->id ? 'admin/data/hunts/edit/' . $hunt->id : 'admin/data/hunts/create']) !!}
{{ $hunt->id ? 'Edit' : 'Create' }} Scavenger Hunt
@if ($hunt->id)
Delete Hunt
@endif
{!! Form::open(['url' => $hunt->id ? 'admin/data/hunts/edit/' . $hunt->id : 'admin/data/hunts/create']) !!}
Basic Information
{!! Form::label('Name') !!} {!! add_help('This is the name you will use to identify this hunt internally. This name will not be shown to users; a name that can be easily identified is recommended.') !!}
{!! Form::text('name', $hunt->name, ['class' => 'form-control']) !!}
{!! Form::label('Display Name') !!} {!! add_help('This is the name that will be shown to users. This is for display purposes and can be something more vague than the above.') !!}
{!! Form::text('display_name', $hunt->getRawOriginal('display_name'), ['class' => 'form-control']) !!}
{!! Form::label('Summary (Optional)') !!} {!! add_help('This is a short blurb that shows up when viewing a hunt\'s page. HTML cannot be used here.') !!}
{!! Form::text('summary', $hunt->summary, ['class' => 'form-control', 'maxLength' => 250]) !!}
{!! Form::label('Clue (Optional)') !!} {!! add_help('You can provide an initial clue to direct users here.') !!}
{!! Form::text('clue', $hunt->clue, ['class' => 'form-control', 'maxLength' => 250]) !!}
@if ($hunt->id)
Locations Show
{!! Form::label('locations', 'Locations (Optional)') !!} {!! add_help('The locations of hunt targets. HTML cannot be used.') !!}
{!! Form::textarea('locations', $hunt->locations, ['class' => 'form-control']) !!}
@endif
{!! Form::label('start_at', 'Start Time') !!} {!! add_help('Hunts can be viewed before the starting time, but targets cannot be claimed.') !!}
{!! Form::text('start_at', $hunt->start_at, ['class' => 'form-control datepicker']) !!}
{!! Form::label('end_at', 'End Time') !!} {!! add_help('Hunts can be viewed after the ending time, but targets cannot be claimed.') !!}
{!! Form::text('end_at', $hunt->end_at, ['class' => 'form-control datepicker']) !!}
{!! Form::submit($hunt->id ? 'Edit' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
@if ($hunt->id)
Display Link
For convenience, here is the hunt's url as well as the full HTML to display a link to the hunt's user-facing page. Hunt's pages inform users of how many of the hunt's targets they've found, and provide a recap of any clues attached to the
found targets. Targets not yet found are not displayed, aside from indicating the total number; the full lineup can thus be indicated (or not) as desired.
{{ $hunt->url }}
{{ $hunt->displayLink }}
@endif
@if ($hunt->id)
Hunt Targets
Hunt targets are items with a specified quantity. They are granted to the user on being claimed, and can only be claimed once. Each target is assigned a number, 1-10, per hunt, based on the order they are added to the hunt. Targets can be
deleted so long as the hunt has not had any participants, as doing so after would break the logs. Users will also be shown the number of targets they have found out of the total, so make sure you have only the number of targets desired before
the hunt goes live!
@if (count($hunt->targets) < 10)
@endif
@if (count($hunt->targets))
@foreach ($hunt->targets as $target)
{{ $target->targetNumber }}
{!! $target->displayItem !!}
@endforeach
@else
This hunt has no targets yet.
@endif
@endif
@if ($hunt->id)
Log
This is the log of claimed targets. It's organized per user, and claimed targets are represented by a checkmark with the timestamp in the adjacent tooltip.
@if (count($hunt->participants))
{!! $participants->render() !!}
User
@foreach ($hunt->targets as $target)
Target {{ $target->targetNumber }}
@endforeach
@foreach ($participants as $participant)
{!! $participant->user->displayName !!}
@foreach ($hunt->targets as $target)
@if (isset($participant[$target->targetField]))
{!! add_help($participant[$target->targetField]) !!}
@endif
@endforeach
@endforeach
{!! $participants->render() !!}
@else
No participants found!
@endif
@endif
@endsection
@section('scripts')
@parent
@endsection