diff --git a/app/Services/FeatureService.php b/app/Services/FeatureService.php index 0962b180a0..eafae3a346 100644 --- a/app/Services/FeatureService.php +++ b/app/Services/FeatureService.php @@ -315,6 +315,7 @@ public function updateFeature($feature, $data, $user, $parent = null) 'display_separate' => $alt ? (isset($data['alt']['display_separate'][$key]) ? 1 : 0) : 1, 'image' => isset($data['alt']['image'][$key]) ? $data['alt']['image'][$key] : null, 'remove_image' => $alt ? (isset($data['alt']['remove_image'][$key]) ? 1 : 0) : 0, + 'is_visible' => $alt ? (isset($data['alt']['is_visible'][$key]) ? 1 : 0) : 0, ]; // If the ID is already set, modify the existing feature diff --git a/resources/views/admin/features/create_edit_feature.blade.php b/resources/views/admin/features/create_edit_feature.blade.php index 1b21943eb7..2d7eaa2bec 100644 --- a/resources/views/admin/features/create_edit_feature.blade.php +++ b/resources/views/admin/features/create_edit_feature.blade.php @@ -150,6 +150,10 @@ {!! Form::checkbox('alt[display_separate]['.$altType->id.']', 1, $altType->display_separate, ['class' => 'form-check-input', 'data-toggle' => 'toggle']) !!} {!! Form::label('alt[display_separate]', 'Display Separately', ['class' => 'form-check-label ml-3']) !!} {!! add_help('If enabled, this trait will be displayed separately from its parent in general trait listings, including species\' visual trait indexes if enabled.') !!} +
+ {!! Form::checkbox('alt[is_visible]['.$altType->id.']', 1, $altType->id ? $altType->is_visible : 1, ['class' => 'form-check-input', 'data-toggle' => 'toggle']) !!} + {!! Form::label('alt[is_visible]['.$altType->id.']', 'Is Visible', ['class' => 'form-check-label ml-3']) !!} {!! add_help('If turned off, the trait will not be visible in the trait list or available for selection in search and design updates. Permissioned staff will still be able to add them to characters, however.') !!} +
@if(isset($altType->display_separate) && $altType->display_separate)

Preview


diff --git a/resources/views/world/_feature_entry.blade.php b/resources/views/world/_feature_entry.blade.php index a6dd833cd2..00e4664c55 100644 --- a/resources/views/world/_feature_entry.blade.php +++ b/resources/views/world/_feature_entry.blade.php @@ -7,7 +7,7 @@ @if($feature->feature_category_id)
Category: {!! $feature->category->displayName !!}
@endif - @if($feature->parent_id) + @if($feature->parent_id && $feature->parent->is_visible)
Parent Trait: {!! $feature->parent->displayName !!}
@endif @if($feature->species_id) @@ -16,14 +16,14 @@
{!! $feature->parsed_description !!}
- @if($feature->altTypes->count()) + @if($feature->altTypes()->visible()->get()->count())
Alternate Types