Skip to content

Commit

Permalink
Merge pull request #749 from owlchester/bulk-parent-should-be-named-p…
Browse files Browse the repository at this point in the history
…arent

Bulk: Parents should be named parent
  • Loading branch information
ilestis authored Oct 10, 2023
2 parents 632803d + f9e0d97 commit a0b0a78
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/AbilityBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AbilityBulk extends Bulk
protected array $fields = [
'name',
'type',
'ability_id',
'parent_ability_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/CreatureBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CreatureBulk extends Bulk
protected array $fields = [
'name',
'type',
'creature_id',
'parent_creature_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/EventBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class EventBulk extends Bulk
protected array $fields = [
'name',
'type',
'event_id',
'parent_event_id',
'location_id',
'tags',
'private_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/FamilyBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class FamilyBulk extends Bulk
protected array $fields = [
'name',
'type',
'family_id',
'parent_family_id',
'location_id',
'tags',
'private_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/ItemBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ItemBulk extends Bulk
'type',
'price',
'size',
'item_id',
'parent_item_id',
'location_id',
'character_id',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/JournalBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class JournalBulk extends Bulk
protected array $fields = [
'name',
'type',
'journal_id',
'parent_journal_id',
'author_id',
'location_id',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/MapBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MapBulk extends Bulk
protected array $fields = [
'name',
'type',
'map_id',
'parent_map_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/NoteBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class NoteBulk extends Bulk
protected array $fields = [
'name',
'type',
'note_id',
'parent_note_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/OrganisationBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OrganisationBulk extends Bulk
'name',
'type',
'location_id',
'organisation_id',
'parent_organisation_id',
'tags',
'private_choice',
'defunct_choice'
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/QuestBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QuestBulk extends Bulk
protected array $fields = [
'name',
'type',
'quest_id',
'parent_quest_id',
'instigator_id',
'completed_choice',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/RaceBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RaceBulk extends Bulk
protected array $fields = [
'name',
'type',
'race_id',
'parent_race_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/TagBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TagBulk extends Bulk
'name',
'type',
'colour',
'tag_id',
'parent_tag_id',
'private_choice',
'auto_applied_choice',
'hide_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/TimelineBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TimelineBulk extends Bulk
protected array $fields = [
'name',
'type',
'timeline_id',
'parent_timeline_id',
'tags',
'private_choice',
];
Expand Down
8 changes: 7 additions & 1 deletion resources/views/cruds/datagrids/bulks/modals/batch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<x-dialog id="bulk-edit" :title="__('crud.bulk.edit.title')" footer="cruds.datagrids.bulks.modals._batch-footer">
<x-grid>
@foreach ($bulk->fields() as $field)
@php $trimmed = \Illuminate\Support\Str::beforeLast($field, '_id'); @endphp
@php
$trimmed = \Illuminate\Support\Str::between($field,'parent_', '_id');
$isParent = \Illuminate\Support\Str::contains($field, 'parent');
@endphp


{!! $fieldCount % 2 === 0 ? '' : null !!}
@include('cruds.fields.' . $trimmed, [
'trans' => $name,
Expand All @@ -13,6 +18,7 @@
'allowNew' => false,
'dropdownParent' => '#bulk-edit',
'route' => null,
'isParent' => $isParent,
])
@php $fieldCount++; @endphp
@endforeach
Expand Down
1 change: 0 additions & 1 deletion resources/views/cruds/fields/parent_location.blade.php

This file was deleted.

0 comments on commit a0b0a78

Please sign in to comment.