@extends('admin.layout') @section('admin-title') Factions @endsection @section('admin-content') {!! breadcrumbs(['Admin Panel' => 'admin', 'Factions' => 'admin/world/factions', ($faction->id ? 'Edit' : 'Create') . ' Faction' => $faction->id ? 'admin/world/factions/edit/' . $faction->id : 'admin/world/factions/create']) !!}

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

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

Basic Information

{!! Form::label('Name*') !!} {!! Form::text('name', $faction->name, ['class' => 'form-control']) !!}
@if (isset($faction->parent_id))
{!! Form::label('Style') !!} {!! add_help('How this faction will be displayed.
Options are editable in the Faction model.') !!} {!! Form::select('style', $faction->displayStyles, isset($faction->display_style) ? $faction->display_style : null, ['class' => 'form-control selectize']) !!}
@endif
{!! Form::label('Type*') !!} {!! add_help('What type of faction is this?') !!} {!! Form::select('type_id', [0 => 'Choose a Faction Type'] + $types, $faction->type_id, ['class' => 'form-control selectize', 'id' => 'type']) !!}
{!! Form::label('Parent (Optional)') !!} {!! add_help('For instance, the parent of Paris is France.
If left blank, this will be \'top level.\'""') !!} {!! Form::select('parent_id', [0 => 'Choose a Parent'] + $factions, isset($faction->parent_id) ? $faction->parent_id : null, ['class' => 'form-control selectize']) !!}
@if ($user_enabled || $ch_enabled)
@if ($user_enabled) {!! Form::checkbox('user_faction', 1, $faction->id ? $faction->is_user_faction : 0, ['class' => 'form-check-input', 'data-toggle' => 'toggle', 'data-on' => 'Users Can Join', 'data-off' => 'Users Cannot Join']) !!} @endif @if ($ch_enabled) {!! Form::checkbox('character_faction', 1, $faction->id ? $faction->is_character_faction : 0, ['class' => 'form-check-input', 'data-toggle' => 'toggle', 'data-on' => 'Characters Can Join', 'data-off' => 'Characters Cannot Join']) !!} @endif
@endif
{!! Form::label('Summary (Optional)') !!} {!! Form::text('summary', $faction->summary, ['class' => 'form-control']) !!}

Images

@if ($faction->thumb_extension) @endif {!! Form::label('Thumbnail Image (Optional)') !!} {!! add_help('This thumbnail is used on the faction index.') !!}
{!! Form::file('image_th') !!}
Recommended size: 200x200
@if (isset($faction->thumb_extension))
{!! Form::checkbox('remove_image_th', 1, false, ['class' => 'form-check-input', 'data-toggle' => 'toggle', 'data-off' => 'Leave Thumbnail As-Is', 'data-on' => 'Remove Thumbnail Image']) !!}
@endif
@if ($faction->image_extension) @endif {!! Form::label('faction Image (Optional)') !!} {!! add_help('This image is used on the faction page as a header.') !!}
{!! Form::file('image') !!}
Recommended size: None (Choose a standard size for all faction header images.)
@if (isset($faction->image_extension))
{!! Form::checkbox('remove_image', 1, false, ['class' => 'form-check-input', 'data-toggle' => 'toggle', 'data-off' => 'Leave Header Image As-Is', 'data-on' => 'Remove Current Header Image']) !!}
@endif
{!! Form::label('Description (Optional)') !!}
{!! Form::textarea('description', $faction->description, ['class' => 'form-control wysiwyg']) !!}
Ranks

Factions may have multiple ranks, which may be either open (available for users and/or characters to have/climb through) or closed (occupyable by characters or figures and changeable only by staff). Open ranks require a "breakpoint"-- the amount of faction standing (as represented by the set currency) required to attain that rank. Ranks are adjusted automatically/on the fly based on the user/character's current amount of standing. Ranks should have unique breakpoints within the faction. To create a basic/entry rank, set a breakpoint of 0.

@foreach ($faction->ranks()->orderBy('sort')->get() as $rank)
{!! Form::label('Sort/Internal Ranking') !!} {!! add_help('The order of the rank within the faction, with 1 being the highest rank.') !!} {!! Form::number('rank_sort[]', $rank->sort, ['class' => 'form-control']) !!}
{!! Form::label('Rank Name') !!}
{!! Form::text('rank_name[]', $rank->name, ['class' => 'form-control']) !!} ×
{!! Form::label('Description') !!} {!! Form::text('rank_description[]', $rank->description, ['class' => 'form-control']) !!}
{!! Form::label('Is Open') !!} {!! Form::select('rank_is_open[]', [1 => 'Yes', 0 => 'No'], $rank->is_open, ['class' => 'form-control rank-is-open', 'placeholder' => 'Choose a Setting']) !!}
{!! Form::label('Breakpoint') !!} {!! add_help('The amount of standing required to achieve this rank.') !!} {!! Form::number('rank_breakpoint[]', $rank->breakpoint, ['class' => 'form-control', 'placeholder' => 'Enter a Breakpoint']) !!}
{!! Form::label('Available Positions') !!} {!! add_help('The number of positions of this rank available. Please note that reducing this will remove any existing members over the new number from their position.') !!} {!! Form::number('rank_amount[]', $rank->amount, ['class' => 'form-control', 'placeholder' => 'Enter an Amount']) !!}
@if (!$rank->is_open)
Occupants
@if ($rank->members()->count()) @foreach ($rank->members as $member)
{!! Form::label('Member Type') !!} {!! add_help('Only members of this faction may be selected.') !!} {!! Form::select( 'rank_member_type[' . $rank->id . '][]', ['figure' => 'Figure'] + (Settings::get('WE_user_factions') > 0 ? ['user' => 'User'] : []) + (Settings::get('WE_character_factions') > 0 ? ['character' => 'Character'] : []), $member->member_type, ['class' => 'form-control rank-member-type', 'placeholder' => 'Choose a Type'], ) !!}
{!! Form::label('Figure') !!} {!! Form::select('rank_figure_id[' . $rank->id . '][]', $figureOptions, $member->member_type == 'figure' ? $member->member_id : null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select Figure']) !!}
{!! Form::label('User') !!} {!! Form::select('rank_user_id[' . $rank->id . '][]', $users, $member->member_type == 'user' ? $member->member_id : null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select User']) !!}
{!! Form::label('Character') !!} {!! Form::select('rank_character_id[' . $rank->id . '][]', $characters, $member->member_type == 'character' ? $member->member_id : null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select Character']) !!}
@endforeach @endif @if (!$rank->members()->count() || $rank->members()->count() < $rank->amount) @for ($i = 0; $i < $rank->amount - $rank->members()->count(); $i++)
{!! Form::label('Member Type') !!} {!! add_help('Only members of this faction may be selected.') !!} {!! Form::select('rank_member_type[' . $rank->id . '][]', ['figure' => 'Figure'] + (Settings::get('WE_user_factions') > 0 ? ['user' => 'User'] : []) + (Settings::get('WE_character_factions') > 0 ? ['character' => 'Character'] : []), null, [ 'class' => 'form-control rank-member-type', 'placeholder' => 'Choose a Type', ]) !!}

Please select a member type.

{!! Form::label('Figure') !!} {!! Form::select('rank_figure_id[' . $rank->id . '][]', $figureOptions, null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select Figure']) !!}
{!! Form::label('User') !!} {!! Form::select('rank_user_id[' . $rank->id . '][]', $users, null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select User']) !!}
{!! Form::label('Character') !!} {!! Form::select('rank_character_id[' . $rank->id . '][]', $characters, null, ['class' => 'form-control mr-2 selectize', 'placeholder' => 'Select Character']) !!}
@endfor @endif @endif
@endforeach
@if ($faction->id)

Attachments

@include('widgets._attachment_select', ['attachments' => $faction->attachments])
@if ($faction->attachers->count()) @endif
@endif
{!! Form::checkbox('is_active', 1, $faction->id ? $faction->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 type will not be visible to regular users.') !!}
{!! Form::submit($faction->id ? 'Edit' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
{!! Form::label('Sort/Internal Ranking') !!} {!! add_help('The order of the rank within the faction, with 1 being the highest rank.') !!} {!! Form::number('rank_sort[]', null, ['class' => 'form-control']) !!}
{!! Form::label('Rank Name') !!}
{!! Form::text('rank_name[]', null, ['class' => 'form-control']) !!} ×
{!! Form::label('Description') !!} {!! Form::text('rank_description[]', null, ['class' => 'form-control']) !!}
{!! Form::label('Is Open') !!} {!! Form::select('rank_is_open[]', [1 => 'Yes', 0 => 'No'], null, ['class' => 'form-control rank-is-open', 'placeholder' => 'Choose a Setting']) !!}

Please set whether this rank should be open or not.

{!! Form::label('Breakpoint') !!} {!! add_help('The amount of standing required to achieve this rank.') !!} {!! Form::number('rank_breakpoint[]', null, ['class' => 'form-control', 'placeholder' => 'Enter a Breakpoint']) !!}
{!! Form::label('Available Positions') !!} {!! add_help('The number of positions of this rank available.') !!} {!! Form::number('rank_amount[]', null, ['class' => 'form-control', 'placeholder' => 'Enter an Amount']) !!}
@include('widgets._attachment_select_row') @endsection @section('scripts') @parent @include('js._attachment_js') @endsection