From 1250e42992088d45c181227cce54ff8e0418eb58 Mon Sep 17 00:00:00 2001 From: ilestis Date: Mon, 8 Apr 2024 11:37:00 -0600 Subject: [PATCH 1/8] Remove old grid/table urls, merging them into one and saving last click --- .../Controllers/Crud/AbilityController.php | 8 -- .../Controllers/Crud/CalendarController.php | 8 -- .../Controllers/Crud/CharacterController.php | 15 -- .../Controllers/Crud/CreatureController.php | 7 - app/Http/Controllers/Crud/EventController.php | 7 - .../Controllers/Crud/FamilyController.php | 9 -- app/Http/Controllers/Crud/ItemController.php | 7 - .../Controllers/Crud/JournalController.php | 10 -- .../Controllers/Crud/LocationController.php | 7 - app/Http/Controllers/Crud/NoteController.php | 7 - .../Crud/OrganisationController.php | 7 - app/Http/Controllers/Crud/QuestController.php | 7 - app/Http/Controllers/Crud/RaceController.php | 7 - app/Http/Controllers/Crud/TagController.php | 7 - .../Controllers/Crud/TimelineController.php | 6 - app/Http/Controllers/CrudController.php | 129 ++++++++++++++---- app/Models/Bookmark.php | 8 +- app/Models/Relations/CampaignRelations.php | 2 +- app/Renderers/DatagridRenderer.php | 1 - app/Services/BreadcrumbService.php | 7 +- app/Services/RecoveryService.php | 2 +- app/Services/SidebarService.php | 15 -- app/Traits/TreeControllerTrait.php | 7 +- lang/en/abilities.php | 3 - lang/en/bookmarks.php | 1 - lang/en/calendars.php | 1 - lang/en/campaigns.php | 6 - lang/en/creatures.php | 3 - lang/en/datagrids.php | 2 + lang/en/events.php | 1 - lang/en/families.php | 4 - lang/en/items.php | 3 - lang/en/journals.php | 4 - lang/en/locations.php | 2 - lang/en/maps.php | 2 - lang/en/notes.php | 3 - lang/en/organisations.php | 4 - lang/en/quests.php | 1 - lang/en/races.php | 3 - lang/en/settings/appearance.php | 6 - lang/en/tags.php | 1 - lang/en/timelines.php | 1 - phpstan.neon | 2 +- resources/views/abilities/_tree.blade.php | 2 +- .../views/bookmarks/form/_entry.blade.php | 73 +++++----- .../views/bookmarks/form/_type.blade.php | 12 +- resources/views/calendars/_tree.blade.php | 2 +- .../views/campaigns/forms/panes/ui.blade.php | 6 - resources/views/creatures/_tree.blade.php | 2 +- .../views/cruds/datagrids/_grid.blade.php | 2 +- .../views/cruds/datagrids/explore.blade.php | 2 +- resources/views/cruds/tree.blade.php | 4 +- .../entities/components/header.blade.php | 2 +- .../components/profile/_type.blade.php | 2 +- .../pages/print/profile/_type.blade.php | 2 +- resources/views/events/_tree.blade.php | 2 +- resources/views/families/_tree.blade.php | 2 +- resources/views/items/_tree.blade.php | 2 +- resources/views/journals/_tree.blade.php | 2 +- .../layouts/datagrid/_togglers.blade.php | 26 +++- .../views/layouts/sidebars/app.blade.php | 14 +- resources/views/locations/_tree.blade.php | 2 +- resources/views/maps/_tree.blade.php | 2 +- resources/views/notes/_tree.blade.php | 2 +- resources/views/organisations/_tree.blade.php | 2 +- resources/views/quests/_tree.blade.php | 2 +- resources/views/races/_tree.blade.php | 2 +- resources/views/settings/appearance.blade.php | 21 --- resources/views/tags/_tree.blade.php | 2 +- resources/views/timelines/_tree.blade.php | 2 +- routes/campaigns/entities.php | 16 --- 71 files changed, 204 insertions(+), 351 deletions(-) diff --git a/app/Http/Controllers/Crud/AbilityController.php b/app/Http/Controllers/Crud/AbilityController.php index ea0280bb78..6191973170 100644 --- a/app/Http/Controllers/Crud/AbilityController.php +++ b/app/Http/Controllers/Crud/AbilityController.php @@ -7,21 +7,13 @@ use App\Http\Requests\StoreAbility; use App\Models\Ability; use App\Models\Campaign; -use App\Traits\TreeControllerTrait; class AbilityController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'abilities'; protected string $route = 'abilities'; protected string $module = 'abilities'; - /** - * Crud models - */ protected $model = Ability::class; protected string $filter = AbilityFilter::class; diff --git a/app/Http/Controllers/Crud/CalendarController.php b/app/Http/Controllers/Crud/CalendarController.php index 181a4f4ba8..1a5fa93aa1 100644 --- a/app/Http/Controllers/Crud/CalendarController.php +++ b/app/Http/Controllers/Crud/CalendarController.php @@ -8,23 +8,15 @@ use App\Models\Calendar; use App\Models\Campaign; use App\Sanitizers\CalendarSanitizer; -use App\Traits\TreeControllerTrait; class CalendarController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'calendars'; protected string $route = 'calendars'; protected $module = 'calendars'; - - /** @var string */ protected $model = Calendar::class; - /** */ protected string $filter = CalendarFilter::class; protected string $sanitizer = CalendarSanitizer::class; diff --git a/app/Http/Controllers/Crud/CharacterController.php b/app/Http/Controllers/Crud/CharacterController.php index 3ff5fcf4e0..921ff8ebed 100644 --- a/app/Http/Controllers/Crud/CharacterController.php +++ b/app/Http/Controllers/Crud/CharacterController.php @@ -10,19 +10,12 @@ class CharacterController extends CrudController { - /** - */ protected string $view = 'characters'; protected string $route = 'characters'; protected $module = 'characters'; - /** - * @var string - */ protected $model = Character::class; - /** - */ protected string $filter = CharacterFilter::class; public function store(StoreCharacter $request, Campaign $campaign) @@ -30,29 +23,21 @@ public function store(StoreCharacter $request, Campaign $campaign) return $this->campaign($campaign)->crudStore($request); } - /** - */ public function show(Campaign $campaign, Character $character) { return $this->campaign($campaign)->crudShow($character); } - /** - */ public function edit(Campaign $campaign, Character $character) { return $this->campaign($campaign)->crudEdit($character); } - /** - */ public function update(StoreCharacter $request, Campaign $campaign, Character $character) { return $this->campaign($campaign)->crudUpdate($request, $character); } - /** - */ public function destroy(Campaign $campaign, Character $character) { return $this->campaign($campaign)->crudDestroy($character); diff --git a/app/Http/Controllers/Crud/CreatureController.php b/app/Http/Controllers/Crud/CreatureController.php index c0052668ae..631a95a06b 100644 --- a/app/Http/Controllers/Crud/CreatureController.php +++ b/app/Http/Controllers/Crud/CreatureController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreCreature; use App\Models\Campaign; use App\Models\Creature; -use App\Traits\TreeControllerTrait; class CreatureController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'creatures'; protected string $route = 'creatures'; protected $module = 'creatures'; - /** @var string Model */ protected $model = Creature::class; - /** @var string Filter */ protected string $filter = CreatureFilter::class; /** diff --git a/app/Http/Controllers/Crud/EventController.php b/app/Http/Controllers/Crud/EventController.php index 08c271b73c..08d699f8e3 100644 --- a/app/Http/Controllers/Crud/EventController.php +++ b/app/Http/Controllers/Crud/EventController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreEvent; use App\Models\Campaign; use App\Models\Event; -use App\Traits\TreeControllerTrait; class EventController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'events'; protected string $route = 'events'; protected $module = 'events'; - /** @var string Model */ protected $model = Event::class; - /** @var string Filter */ protected string $filter = EventFilter::class; public function store(StoreEvent $request, Campaign $campaign) diff --git a/app/Http/Controllers/Crud/FamilyController.php b/app/Http/Controllers/Crud/FamilyController.php index 5a0f88e3d6..6c86888aca 100644 --- a/app/Http/Controllers/Crud/FamilyController.php +++ b/app/Http/Controllers/Crud/FamilyController.php @@ -7,24 +7,15 @@ use App\Http\Requests\StoreFamily; use App\Models\Campaign; use App\Models\Family; -use App\Traits\TreeControllerTrait; class FamilyController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'families'; protected string $route = 'families'; protected $module = 'families'; - /** - * Crud models - */ protected $model = Family::class; - /** @var string Filter */ protected string $filter = FamilyFilter::class; public function store(StoreFamily $request, Campaign $campaign) diff --git a/app/Http/Controllers/Crud/ItemController.php b/app/Http/Controllers/Crud/ItemController.php index 9da7977ae6..e156c40311 100644 --- a/app/Http/Controllers/Crud/ItemController.php +++ b/app/Http/Controllers/Crud/ItemController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreItem; use App\Models\Campaign; use App\Models\Item; -use App\Traits\TreeControllerTrait; class ItemController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'items'; protected string $route = 'items'; protected $module = 'items'; - /** @var string Model */ protected $model = Item::class; - /** @var string Filter */ protected string $filter = ItemFilter::class; /** diff --git a/app/Http/Controllers/Crud/JournalController.php b/app/Http/Controllers/Crud/JournalController.php index b0401c5ea1..c5fce9531f 100644 --- a/app/Http/Controllers/Crud/JournalController.php +++ b/app/Http/Controllers/Crud/JournalController.php @@ -7,25 +7,15 @@ use App\Http\Requests\StoreJournal; use App\Models\Campaign; use App\Models\Journal; -use App\Traits\TreeControllerTrait; class JournalController extends CrudController { - /** - * Tree / Nested Mode - */ - use TreeControllerTrait; - - /** - */ protected string $view = 'journals'; protected string $route = 'journals'; protected $module = 'journals'; - /** @var string Model*/ protected $model = Journal::class; - /** @var string Filter */ protected string $filter = JournalFilter::class; /** diff --git a/app/Http/Controllers/Crud/LocationController.php b/app/Http/Controllers/Crud/LocationController.php index 1ed15c598a..8f440993b5 100644 --- a/app/Http/Controllers/Crud/LocationController.php +++ b/app/Http/Controllers/Crud/LocationController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreLocation; use App\Models\Campaign; use App\Models\Location; -use App\Traits\TreeControllerTrait; class LocationController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'locations'; protected string $route = 'locations'; protected $module = 'locations'; - /** @var string Model */ protected $model = Location::class; - /** @var string Filter */ protected string $filter = LocationFilter::class; /** diff --git a/app/Http/Controllers/Crud/NoteController.php b/app/Http/Controllers/Crud/NoteController.php index 69c7870a7b..a1d33b24fc 100644 --- a/app/Http/Controllers/Crud/NoteController.php +++ b/app/Http/Controllers/Crud/NoteController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreNote; use App\Models\Campaign; use App\Models\Note; -use App\Traits\TreeControllerTrait; class NoteController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'notes'; protected string $route = 'notes'; protected $module = 'notes'; - /** @var string */ protected $model = Note::class; - /** @var string Filter */ protected string $filter = NoteFilter::class; /** diff --git a/app/Http/Controllers/Crud/OrganisationController.php b/app/Http/Controllers/Crud/OrganisationController.php index 95f4be2363..7292de528e 100644 --- a/app/Http/Controllers/Crud/OrganisationController.php +++ b/app/Http/Controllers/Crud/OrganisationController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreOrganisation; use App\Models\Campaign; use App\Models\Organisation; -use App\Traits\TreeControllerTrait; class OrganisationController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'organisations'; protected string $route = 'organisations'; protected $module = 'organisations'; - /** @var string */ protected $model = Organisation::class; - /** @var string Filter */ protected string $filter = OrganisationFilter::class; /** diff --git a/app/Http/Controllers/Crud/QuestController.php b/app/Http/Controllers/Crud/QuestController.php index 6d11af3ce1..2fe96335c9 100644 --- a/app/Http/Controllers/Crud/QuestController.php +++ b/app/Http/Controllers/Crud/QuestController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreQuest; use App\Models\Campaign; use App\Models\Quest; -use App\Traits\TreeControllerTrait; class QuestController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'quests'; protected string $route = 'quests'; protected $module = 'quests'; - /** @var string Model */ protected $model = Quest::class; - /** @var string Filter */ protected string $filter = QuestFilter::class; /** diff --git a/app/Http/Controllers/Crud/RaceController.php b/app/Http/Controllers/Crud/RaceController.php index b21e74fbf6..09072ea108 100644 --- a/app/Http/Controllers/Crud/RaceController.php +++ b/app/Http/Controllers/Crud/RaceController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreRace; use App\Models\Campaign; use App\Models\Race; -use App\Traits\TreeControllerTrait; class RaceController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'races'; protected string $route = 'races'; protected $module = 'races'; - /** @var string Model */ protected $model = Race::class; - /** @var string Filter */ protected string $filter = RaceFilter::class; /** diff --git a/app/Http/Controllers/Crud/TagController.php b/app/Http/Controllers/Crud/TagController.php index eac2be2921..399e13f87c 100644 --- a/app/Http/Controllers/Crud/TagController.php +++ b/app/Http/Controllers/Crud/TagController.php @@ -7,22 +7,15 @@ use App\Http\Requests\StoreTag; use App\Models\Campaign; use App\Models\Tag; -use App\Traits\TreeControllerTrait; class TagController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'tags'; protected string $route = 'tags'; protected $module = 'tags'; - /** @var string Model */ protected $model = Tag::class; - /** @var string Filter */ protected string $filter = TagFilter::class; /** diff --git a/app/Http/Controllers/Crud/TimelineController.php b/app/Http/Controllers/Crud/TimelineController.php index 604669d21a..aa0a4b59b8 100644 --- a/app/Http/Controllers/Crud/TimelineController.php +++ b/app/Http/Controllers/Crud/TimelineController.php @@ -7,18 +7,12 @@ use App\Http\Requests\StoreTimeline; use App\Models\Campaign; use App\Models\Timeline; -use App\Traits\TreeControllerTrait; class TimelineController extends CrudController { - use TreeControllerTrait; - - /** - */ protected string $view = 'timelines'; protected string $route = 'timelines'; - /** @var string */ protected $model = Timeline::class; protected string $filter = TimelineFilter::class; diff --git a/app/Http/Controllers/CrudController.php b/app/Http/Controllers/CrudController.php index 0cfdce8910..7816c75909 100644 --- a/app/Http/Controllers/CrudController.php +++ b/app/Http/Controllers/CrudController.php @@ -25,7 +25,10 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; use Illuminate\Pagination\Paginator; +use Illuminate\Support\Arr; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Cookie; +use Illuminate\Support\Facades\Session; use LogicException; class CrudController extends Controller @@ -82,6 +85,8 @@ class CrudController extends Controller /** Determine if the create/store procedure has a limit checking in place */ protected bool $hasLimitCheck = false; + protected Request $request; + public function __construct() { $this->middleware('campaign.member'); @@ -109,6 +114,7 @@ public function crudIndex(Request $request) * Prepare a lot of variables that will be shared over to the view * @var MiscModel $model */ + $this->request = $request; $model = new $this->model(); $campaign = $this->campaign; $this->filterService @@ -131,20 +137,40 @@ public function crudIndex(Request $request) $datagridActions = new $this->datagridActions(); $templates = $this->loadTemplates($model); + // Determine if we're nested or not + $nested = $this->isNested(); + $base = $model ->preparedSelect() ->preparedWith() ->search($this->filterService->search()) ->order($this->filterService->order()) + ->distinct() ; $parent = null; if (request()->has('parent_id')) { - // @phpstan-ignore-next-line $parentKey = $model->getParentKeyName(); $base->where([$model->getTable() . '.' . $parentKey => request()->get('parent_id')]); $parent = $model->where('id', request()->get('parent_id'))->first(); + if (request()->get('m') === 'table') { + if (!empty($parent) && !empty($parent->parent)) { + // Go back to previous parent + $this->addNavAction( + route($this->route . '.index', [$campaign, 'parent_id' => $parent->parent->id]), + ' ' . $parent->parent->name + ); + } else { + // Go back to first level + $this->addNavAction( + route($this->route . '.index', [$campaign]), + ' ' . __('crud.actions.back') + ); + } + } + } elseif ($nested) { + $base->whereNull($model->getTable() . '.' . $model->getParentKeyName()); } // Do this to avoid an extra sql query when no filters are selected @@ -174,22 +200,12 @@ public function crudIndex(Request $request) } // Switch between the new explore/grid mode and the old table - $mode = request()->get('m', 'grid'); - if (!in_array($mode, ['grid', 'table'])) { - $mode = 'grid'; - } + $mode = $this->mode(); $forceMode = null; if (property_exists($this, 'forceMode')) { $mode = $forceMode = $this->forceMode; } - // Add a button to the tree view if the controller has it - if (method_exists($this, 'tree') && $mode === 'table') { - $this->addNavAction( - route($this->route . '.tree', [$this->campaign, 'm' => 'table']), - ' ' . __('crud.actions.explore_view') - ); - } $this->getNavActions(); $actions = $this->navActions; $entityTypeId = $model->entityTypeId(); @@ -221,6 +237,9 @@ public function crudIndex(Request $request) } else { $data['titleKey'] = Module::plural($entityTypeId, __('entities.' . $langKey)); } + if (method_exists($model, 'getParentKeyName')) { + $data['nestable'] = $nested; + } return view('cruds.index', $data); } @@ -518,12 +537,7 @@ public function crudUpdate(Request $request, Model|MiscModel $model) } elseif ($request->has('submit-update')) { $route = route($this->route . '.edit', [$this->campaign, $model->id]); } elseif ($request->has('submit-close')) { - $subroute = 'index'; - $defaultNested = auth()->user()->defaultNested || $this->campaign->defaultToNested(); - if ($defaultNested && \Illuminate\Support\Facades\Route::has($this->route . '.tree')) { - $subroute = 'tree'; - } - $route = route($this->route . '.' . $subroute, [$this->campaign]); + $route = route($this->route . '.index', [$this->campaign]); } elseif ($request->has('submit-copy')) { $route = route($this->route . '.create', [$this->campaign, 'copy' => $model->id]); return response()->redirectTo($route); @@ -546,13 +560,7 @@ public function crudDestroy(Model|MiscModel $model) $model->delete(); - $subroute = 'index'; - $defaultNested = auth()->user()->defaultNested || $this->campaign->defaultToNested(); - if ($defaultNested && \Illuminate\Support\Facades\Route::has($this->route . '.tree')) { - $subroute = 'tree'; - } - - return redirect()->route($this->route . '.' . $subroute, $this->campaign) + return redirect()->route($this->route . '.index', $this->campaign) ->with('success', __('general.success.deleted', ['name' => $model->name])); } @@ -674,4 +682,75 @@ protected function loadTemplates($model): Collection } return Entity::select('id', 'name', 'entity_id')->templates($model->entityTypeID())->get(); } + + /** + * Determine if the layout is in the nice grid mode, or the old table mode + * @return string + */ + protected function mode(): string + { + if (!isset($this->module)) { + return 'table'; + } + $key = $this->module . '_mode'; + if ($this->request->has('m')) { + $mode = $this->request->get('m'); + if (!in_array($mode, ['grid', 'table'])) { + return 'grid'; + } + $newMode = $mode; + } + if (isset($newMode)) { + if (auth()->guest()) { + Session::put($key, $newMode); + } else { + $settings = auth()->user()->settings; + if (auth()->check() && Arr::get($settings, $key) !== $newMode) { + $settings[$key] = $newMode; + auth()->user()->settings = $settings; + auth()->user()->updateQuietly(); + } + } + return $newMode; + } + + if (auth()->guest()) { + return Session::get($key, 'grid'); + } + // Else use the user's preferred stacking for this entity type + return Arr::get(auth()->user()->settings, $key, true); + } + /** + * Determine if the current layout should be nested or not + * @return bool + */ + protected function isNested(): bool + { + // Model isn't nested, not an option to start with + if (!isset($this->module) || !method_exists($this->model, 'getParentKeyName')) { + return false; + } + $key = $this->module . '_nested'; + if ($this->request->has('n')) { + $new = (bool) $this->request->get('n'); + if (auth()->guest()) { + Session::put($key, $new); + } else { + $settings = auth()->user()->settings; + if (auth()->check() && Arr::get($settings, $key) !== $new) { + $settings = auth()->user()->settings; + $settings[$key] = $new; + auth()->user()->settings = $settings; + auth()->user()->updateQuietly(); + } + } + return $new; + } + + if (auth()->guest()) { + return (bool) Session::get($key, true); + } + // Else use the user's preferred stacking for this entity type + return Arr::get(auth()->user()->settings, $key, true); + } } diff --git a/app/Models/Bookmark.php b/app/Models/Bookmark.php index 7613857171..57384658b5 100644 --- a/app/Models/Bookmark.php +++ b/app/Models/Bookmark.php @@ -249,11 +249,9 @@ protected function getEntityRoute(): string protected function getIndexRoute(): string { $filters = $this->filters . '&_clean=true&_from=bookmark&bookmark=' . $this->id; - $nestedType = (!empty($this->options['is_nested']) && $this->options['is_nested'] == '1' ? 'tree' : 'index'); - - $routeName = Str::plural($this->type) . ".{$nestedType}"; - if ($nestedType === 'tree' && !Route::has($routeName)) { - $routeName = Str::plural($this->type) . '.index'; + $routeName = Str::plural($this->type) . '.index'; + if (empty($this->options['is_nested']) && $this->options['is_nested'] == '1') { + $filters .= '&n=1'; } try { $campaign = CampaignLocalization::getCampaign(); diff --git a/app/Models/Relations/CampaignRelations.php b/app/Models/Relations/CampaignRelations.php index 9f49416d7d..fcffd9c003 100644 --- a/app/Models/Relations/CampaignRelations.php +++ b/app/Models/Relations/CampaignRelations.php @@ -107,7 +107,7 @@ public function nonAdmins() } $this->nonAdmins = new Collection(); // We can't exclude admins through pure SQL as some members might be role-less in weird edge cases - foreach ($this->members()->with(['user', 'user.campaignRoles'])->get() as $member) { + foreach ($this->members()->with(['user', 'user.campaignRoles', 'user.tutorials'])->get() as $member) { $isAdmin = false; /** @var CampaignRole $campaignRole */ foreach ($member->user->campaignRoles as $campaignRole) { diff --git a/app/Renderers/DatagridRenderer.php b/app/Renderers/DatagridRenderer.php index 72185e574b..ded61255f2 100644 --- a/app/Renderers/DatagridRenderer.php +++ b/app/Renderers/DatagridRenderer.php @@ -236,7 +236,6 @@ private function route(string $field = null, string $label = null) $routeOptions = [ 'campaign' => $this->campaign, - 'm' => 'table', 'order' => $field , 'page' => request()->get('page') ]; diff --git a/app/Services/BreadcrumbService.php b/app/Services/BreadcrumbService.php index 263861954c..7f801578c8 100644 --- a/app/Services/BreadcrumbService.php +++ b/app/Services/BreadcrumbService.php @@ -16,16 +16,11 @@ class BreadcrumbService public function index(string $name): string { // Determine the "mode" for logged-in users who prefer the old table view - $params = auth()->check() && auth()->user()->entityExplore === '1' ? ['m' => 'table'] : []; + $params = []; $params['campaign'] = $this->campaign; // If the user activated nested views by default, go back to it. $entityIndexRoute = route($name . '.index', $params); - if ($this->campaign->defaultToNested() || (auth()->check() && auth()->user()->defaultNested)) { - if (\Illuminate\Support\Facades\Route::has($name . '.tree')) { - $entityIndexRoute = route($name . '.tree', $params); - } - } return $entityIndexRoute; } diff --git a/app/Services/RecoveryService.php b/app/Services/RecoveryService.php index 502f2cc120..ab7f8a8883 100644 --- a/app/Services/RecoveryService.php +++ b/app/Services/RecoveryService.php @@ -123,7 +123,7 @@ protected function trashChild(Entity $entity, MiscModel $child = null) } // Set the campaign scope to avoid hitting entities of other campaigns (this can happen with - // nested trees) + // nested modules) \App\Facades\CampaignLocalization::setConsoleCampaign($entity->campaign_id); // Update the parent_id / tree before diff --git a/app/Services/SidebarService.php b/app/Services/SidebarService.php index 06c6c341fc..4db2cb07f7 100644 --- a/app/Services/SidebarService.php +++ b/app/Services/SidebarService.php @@ -204,56 +204,48 @@ protected function setupElements(): void 'locations' => [ 'icon' => config('entities.icons.location'), 'label' => 'entities.locations', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.location') ], 'maps' => [ 'icon' => config('entities.icons.map'), 'label' => 'entities.maps', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.map') ], 'organisations' => [ 'icon' => config('entities.icons.organisation'), 'label' => 'entities.organisations', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.organisation') ], 'families' => [ 'icon' => config('entities.icons.family'), 'label' => 'entities.families', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.family') ], 'calendars' => [ 'icon' => config('entities.icons.calendar'), 'label' => 'entities.calendars', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.calendar') ], 'timelines' => [ 'icon' => config('entities.icons.timeline'), 'label' => 'entities.timelines', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.timeline') ], 'races' => [ 'icon' => config('entities.icons.race'), 'label' => 'entities.races', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.race') ], 'creatures' => [ 'icon' => config('entities.icons.creature'), 'label' => 'entities.creatures', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.creature') ], @@ -266,42 +258,36 @@ protected function setupElements(): void 'quests' => [ 'icon' => config('entities.icons.quest'), 'label' => 'entities.quests', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.quest') ], 'journals' => [ 'icon' => config('entities.icons.journal'), 'label' => 'entities.journals', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.journal') ], 'items' => [ 'icon' => config('entities.icons.item'), 'label' => 'entities.items', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.item') ], 'events' => [ 'icon' => config('entities.icons.event'), 'label' => 'entities.events', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.event') ], 'abilities' => [ 'icon' => config('entities.icons.ability'), 'label' => 'entities.abilities', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.ability') ], 'notes' => [ 'icon' => config('entities.icons.note'), 'label' => 'entities.notes', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.note') ], @@ -322,7 +308,6 @@ protected function setupElements(): void 'tags' => [ 'icon' => config('entities.icons.tag'), 'label' => 'entities.tags', - 'tree' => true, 'mode' => true, 'type_id' => config('entities.ids.tag') ], diff --git a/app/Traits/TreeControllerTrait.php b/app/Traits/TreeControllerTrait.php index a7708ba459..0bdb1b5651 100644 --- a/app/Traits/TreeControllerTrait.php +++ b/app/Traits/TreeControllerTrait.php @@ -57,7 +57,7 @@ public function tree(Request $request, Campaign $campaign) if ($mode === 'table') { $this->addNavAction( - route($this->route . '.index', [$this->campaign, 'm' => 'table']), + route($this->route . '.index', [$this->campaign]), ' ' . __('entities.' . $this->view) ); } @@ -65,9 +65,10 @@ public function tree(Request $request, Campaign $campaign) $base = $model ->preparedSelect() ->preparedWith() - ->search(request()->get('search')) + ->search($this->filterService->search()) ->order($this->filterService->order()) - ->distinct(); + ->distinct() + ; /** @var Tag $model **/ $parentKey = $model->getParentKeyName(); diff --git a/lang/en/abilities.php b/lang/en/abilities.php index 1c211155e2..f49feeb0ed 100644 --- a/lang/en/abilities.php +++ b/lang/en/abilities.php @@ -18,9 +18,6 @@ 'fields' => [ 'charges' => 'Charges', ], - 'helpers' => [ - 'nested_without' => 'Displaying all abilities that don\'t have a parent ability. Click on a row to see the children abilities.', - ], 'placeholders' => [ 'charges' => 'Amount of charges. Reference attributes with {Level}*{CHA}', 'name' => 'Fireball, Alert, Cunning Strike', diff --git a/lang/en/bookmarks.php b/lang/en/bookmarks.php index e04961f228..d2bd6486c8 100644 --- a/lang/en/bookmarks.php +++ b/lang/en/bookmarks.php @@ -16,7 +16,6 @@ 'default_dashboard' => 'Default dashboard', 'entity' => 'Entity', 'filters' => 'Filters', - 'is_nested' => 'Nested', 'menu' => 'Subpage', 'position' => 'Position', 'random' => 'Random', diff --git a/lang/en/calendars.php b/lang/en/calendars.php index 3af16db2e4..4f4e317f59 100644 --- a/lang/en/calendars.php +++ b/lang/en/calendars.php @@ -107,7 +107,6 @@ 'format' => 'Add custom date formatting for calendar entities.', 'month_type' => 'Intercalary months don\'t use week days, but still influence moons and seasons.', 'moon_offset' => 'By default, the first fullmoon appears on the first day of year 0. Changing the offset will alter when the first full moon is displayed. This value can negative (up to the length of the first month) or positive (up to the length of the first month).', - 'nested_without' => 'Displaying all calendars that don\'t have a parent calendar. Click on a row to see the children calendars.', 'start_offset' => 'By default, the calendar starts on the first weekday of year 0. Changing this field influences where the calendar\'s first day is placed.', ], 'hints' => [ diff --git a/lang/en/campaigns.php b/lang/en/campaigns.php index 907ad800d5..26d38093cc 100644 --- a/lang/en/campaigns.php +++ b/lang/en/campaigns.php @@ -59,7 +59,6 @@ 'is_discreet' => 'Discreet', 'locale' => 'Locale', 'name' => 'Name', - 'nested' => 'Default entity lists to nested when available', 'open' => 'Open to applications', 'past_featured' => 'Previously featured campaign', 'post_collapsed' => 'New posts on entities are collapsed by default.', @@ -452,7 +451,6 @@ 'entity_history' => 'Entity\'s history logs', 'entity_image' => 'Entity\'s image', 'member_list' => 'Campaign\'s member list', - 'nested' => 'Default lists layout', 'post_collapsed' => 'New post default collapsed value', ], 'helpers' => [ @@ -469,10 +467,6 @@ 'hidden' => 'Only visible to campaign admins', 'visible' => 'Visible to members', ], - 'nested' => [ - 'nested' => 'Nested', - 'user' => 'User\'s default', - ], 'other' => 'Other', ], 'visibilities' => [ diff --git a/lang/en/creatures.php b/lang/en/creatures.php index 132839b435..aa4bb52371 100644 --- a/lang/en/creatures.php +++ b/lang/en/creatures.php @@ -7,9 +7,6 @@ 'fields' => [ 'is_extinct' => 'Extinct', ], - 'helpers' => [ - 'nested_without' => 'Displaying all creatures that don\'t have a parent creature. Click on a row to see the children creatures.', - ], 'hints' => [ 'is_extinct' => 'This creature is extinct.', ], diff --git a/lang/en/datagrids.php b/lang/en/datagrids.php index ac18c8d9dc..b8737ee751 100644 --- a/lang/en/datagrids.php +++ b/lang/en/datagrids.php @@ -7,6 +7,8 @@ 'modes' => [ 'grid' => 'Switch to the grid view', 'table' => 'Switch to the table view', + 'flatten' => 'Switch to a flattened layout', + 'nested' => 'Switch to a nested layout', ], 'tooltips' => [ 'nested' => 'This entity has children. Click on the image to view them.', diff --git a/lang/en/events.php b/lang/en/events.php index 39197790c3..ebef532137 100644 --- a/lang/en/events.php +++ b/lang/en/events.php @@ -12,7 +12,6 @@ ], 'helpers' => [ 'date' => 'This field can contain anything and is not linked to the campaign\'s calendars. To link this event to a calendar, go add it on the calendar or on the reminders subpage of this event.', - 'nested_without' => 'Displaying all events that don\'t have a parent event. Click on a row to see the children events.', ], 'placeholders' => [ 'date' => 'A date for your event', diff --git a/lang/en/families.php b/lang/en/families.php index ec2bc396c3..336b0c7b4b 100644 --- a/lang/en/families.php +++ b/lang/en/families.php @@ -7,10 +7,6 @@ 'fields' => [ 'members' => 'Members', ], - 'helpers' => [ - 'descendants' => 'This list contains all families which are descendants of this family, and not only those directly under it.', - 'nested_without' => 'Displaying all families that don\'t have a parent family. Click on a row to see the children families.', - ], 'hints' => [ 'members' => 'Members of a family are listed here. A character can be added to a family by editing the desired character and using the "Family" dropdown.', ], diff --git a/lang/en/items.php b/lang/en/items.php index 4622d41e61..b1596e33c0 100644 --- a/lang/en/items.php +++ b/lang/en/items.php @@ -10,9 +10,6 @@ 'price' => 'Price', 'size' => 'Size', ], - 'helpers' => [ - 'nested_without' => 'Displaying all items that don\'t have a parent item. Click on a row to see the children items.', - ], 'hints' => [ 'items' => 'Organise items by using the parent item field.', ], diff --git a/lang/en/journals.php b/lang/en/journals.php index dee9862cf1..fdfbc96dfa 100644 --- a/lang/en/journals.php +++ b/lang/en/journals.php @@ -8,10 +8,6 @@ 'author' => 'Author', 'date' => 'Date', ], - 'helpers' => [ - 'journals' => 'Display all or only the direct sub journals of this journal.', - 'nested_without' => 'Displaying all journals that don\'t have a parent journal. Click on a row to see the children journals.', - ], 'placeholders' => [ 'author' => 'Who wrote the journal', 'date' => 'Real world date of the journal', diff --git a/lang/en/locations.php b/lang/en/locations.php index 126f9103a7..1218a30d30 100644 --- a/lang/en/locations.php +++ b/lang/en/locations.php @@ -6,8 +6,6 @@ ], 'helpers' => [ 'characters' => 'View all characters in this location and its children locations, or just those directly located here.', - 'descendants' => 'This list contains all locations which are descendants of this location, not only those directly under it.', - 'nested_without' => 'Displaying all locations that don\'t have a parent location. Click on a row to see the children locations.', ], 'placeholders' => [ 'type' => 'City, Kingdom, Ruin', diff --git a/lang/en/maps.php b/lang/en/maps.php index e6ee8dbdb8..4750525d86 100644 --- a/lang/en/maps.php +++ b/lang/en/maps.php @@ -47,7 +47,6 @@ 'center' => 'Changing the following values will control which area of the map is focused on. Leaving these values empty will result in the center of the map being focued on.', 'centering' => 'Centering on a marker will take priority on default coordinates.', 'chunked_zoom' => 'Automatically cluster markers together when they are close to each other.', - 'descendants' => 'This list contains all maps which are descendants of this map, and not only those directly under it.', 'distance_measure' => 'Giving the map a distance measurement will enable the measurement tool in the exploration mode.', 'distance_measure_2' => 'For 100 pixels to measure 1 kilometer, input a value of 0.0041.', 'grid' => 'Define a grid size that will be displayed in the exploration mode.', @@ -57,7 +56,6 @@ 'max_zoom' => 'The most a map can be zoomed in on. The default value is :default, while the highest allowed value is :max.', 'min_zoom' => 'The most a map can be zoomed out of. The default value is :default, while the lowest allowed value is :min.', 'missing_image' => 'Save the map with an image before being able to add layers and markers.', - 'nested_without' => 'Displaying all maps that don\'t have a parent map. Click on a row to see the children maps.', ], 'panels' => [ 'groups' => 'Groups', diff --git a/lang/en/notes.php b/lang/en/notes.php index 22f416b8d2..74eed3503f 100644 --- a/lang/en/notes.php +++ b/lang/en/notes.php @@ -7,9 +7,6 @@ 'fields' => [ 'notes' => 'Sub Notes', ], - 'helpers' => [ - 'nested_without' => 'Displaying all notes that don\'t have a parent note. Click on a row to see the children notes.', - ], 'placeholders' => [ 'note' => 'Choose a parent note', 'type' => 'Religion, Race, Political system', diff --git a/lang/en/organisations.php b/lang/en/organisations.php index 75cdb77ce5..c08a1d02e8 100644 --- a/lang/en/organisations.php +++ b/lang/en/organisations.php @@ -8,10 +8,6 @@ 'is_defunct' => 'Defunct', 'members' => 'Members', ], - 'helpers' => [ - 'descendants' => 'This list contains all organisations which are descendants of this organisation, and not only those directly under it.', - 'nested_without' => 'Displaying all organisations that don\'t have a parent organisation. Click on a row to see the children organisations.', - ], 'hints' => [ 'is_defunct' => 'This organisation is defunct.', ], diff --git a/lang/en/quests.php b/lang/en/quests.php index fa1bfbd56f..8368b9a8b2 100644 --- a/lang/en/quests.php +++ b/lang/en/quests.php @@ -32,7 +32,6 @@ ], 'helpers' => [ 'is_completed' => 'The quest is considered as completed.', - 'nested_without' => 'Displaying all quests that don\'t have a parent quest. Click on a row to see the children quests.', ], 'hints' => [ 'quests' => 'A web of interlocking quests can be built using the Parent Quest field.', diff --git a/lang/en/races.php b/lang/en/races.php index 3966b9099b..ea0561302d 100644 --- a/lang/en/races.php +++ b/lang/en/races.php @@ -13,9 +13,6 @@ 'fields' => [ 'members' => 'Members', ], - 'helpers' => [ - 'nested_without' => 'Displaying all races that don\'t have a parent race. Click on a row to see the children races.', - ], 'members' => [ 'create' => [ 'submit' => 'Add members', diff --git a/lang/en/settings/appearance.php b/lang/en/settings/appearance.php index 0f150f3dc1..8d8898d417 100644 --- a/lang/en/settings/appearance.php +++ b/lang/en/settings/appearance.php @@ -27,7 +27,6 @@ 'fields' => [ 'campaign-order' => 'Campaign list order', 'date-format' => 'Date formatting', - 'default-nested' => 'Nested lists layout', 'editor' => 'Text editor', 'entity-explore' => 'Entity lists', 'mentions' => 'Mentions when editing', @@ -39,7 +38,6 @@ 'advanced-mentions' => 'When editing texts, control if mentions are rendered as the entity\'s name, or as the advanced mention.', 'campaign-order' => 'Change the order in which campaigns are listed in the campaign switcher.', 'date-format' => 'When available, control the format in which to display real world dates.', - 'default-nested' => 'Control how lists which support nesting are displayed by default.', 'editor' => 'Using the legacy text editor (TinyMCE) doesn\'t support mentions on mobile devices, campaign galleries or other advanced features.', 'entity-explore' => 'Control the way in which entity lists are displayed on campaigns.', 'new-entity-workflow' => 'Control which interface you are taken to after creating a new entity.', @@ -51,10 +49,6 @@ 'advanced' => 'Display advanced mentions :code', 'default' => 'Mentions as the entity name', ], - 'nested' => [ - 'default' => 'Flat lists', - 'nested' => 'Nested lists', - ], 'success' => 'Appearance options saved.', 'values' => [ 'pagination' => ':amount results per page', diff --git a/lang/en/tags.php b/lang/en/tags.php index 463aada0a1..bd6ca3d4f4 100644 --- a/lang/en/tags.php +++ b/lang/en/tags.php @@ -22,7 +22,6 @@ 'is_hidden' => 'Hidden from header and tooltip', ], 'helpers' => [ - 'nested_without' => 'Displaying all tags that don\'t have a parent tag. Click on a row to see the children tags.', 'no_children' => 'There are currently no entities tagged with this tag.', ], 'hints' => [ diff --git a/lang/en/timelines.php b/lang/en/timelines.php index 376e26ab17..b26b6f8254 100644 --- a/lang/en/timelines.php +++ b/lang/en/timelines.php @@ -16,7 +16,6 @@ 'reverse_order' => 'Reverse era order', ], 'helpers' => [ - 'nested_without' => 'Displaying all timelines that don\'t have a parent timeline. Click on a row to see the children timelines.', 'no_era_v2' => 'This timeline currently doesn\'t have any eras. Add one or several eras to it, after which you can add elements to the eras here.', 'reverse_order' => 'Enable to display eras in reverse chronological order (older era first)', ], diff --git a/phpstan.neon b/phpstan.neon index c1af1ee65f..0b9bd2b9b4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ includes: - - ./vendor/nunomaduro/larastan/extension.neon + - ./vendor/larastan/larastan/extension.neon parameters: diff --git a/resources/views/abilities/_tree.blade.php b/resources/views/abilities/_tree.blade.php index 4f9d7166f6..e61493c81d 100644 --- a/resources/views/abilities/_tree.blade.php +++ b/resources/views/abilities/_tree.blade.php @@ -32,7 +32,7 @@ ] ]) ->options([ - 'route' => 'abilities.tree', + 'route' => 'abilities.index', 'baseRoute' => 'abilities', 'trans' => 'abilities.fields.', 'row' => [ diff --git a/resources/views/bookmarks/form/_entry.blade.php b/resources/views/bookmarks/form/_entry.blade.php index 4c6f7b7742..c343e3b5ce 100644 --- a/resources/views/bookmarks/form/_entry.blade.php +++ b/resources/views/bookmarks/form/_entry.blade.php @@ -115,43 +115,44 @@ -
+ +
-

{{ __('bookmarks.fields.selector') }}

- +

{{ __('bookmarks.fields.selector') }}

+ - - - -
- - - - - -
-@includeWhen(auth()->user()->isAdmin(), 'cruds.fields.privacy_callout') +
+ @includeWhen(auth()->user()->isAdmin(), 'cruds.fields.privacy_callout') + diff --git a/resources/views/bookmarks/form/_type.blade.php b/resources/views/bookmarks/form/_type.blade.php index 0e3313ef57..e9cd15587c 100644 --- a/resources/views/bookmarks/form/_type.blade.php +++ b/resources/views/bookmarks/form/_type.blade.php @@ -20,11 +20,11 @@ {!! Form::text('filters', FormCopy::field('filters')->string(), ['placeholder' => __('bookmarks.placeholders.filters'), 'class' => '', 'maxlength' => 191]) !!} - - {!! Form::hidden('options[is_nested]', 0) !!} - - {!! Form::checkbox('options[is_nested]', 1, empty($model->options) ? false : $model->options['is_nested']) !!} - - +{{-- --}} +{{-- {!! Form::hidden('options[is_nested]', 0) !!}--}} +{{-- --}} +{{-- {!! Form::checkbox('options[is_nested]', 1, empty($model->options) ? false : $model->options['is_nested']) !!}--}} +{{-- --}} +{{-- --}} diff --git a/resources/views/calendars/_tree.blade.php b/resources/views/calendars/_tree.blade.php index 748341e885..91003d96d0 100644 --- a/resources/views/calendars/_tree.blade.php +++ b/resources/views/calendars/_tree.blade.php @@ -41,7 +41,7 @@ ] ]) ->options([ - 'route' => 'calendars.tree', + 'route' => 'calendars.index', 'baseRoute' => 'calendars', 'trans' => 'calendars.fields.', 'row' => [ diff --git a/resources/views/campaigns/forms/panes/ui.blade.php b/resources/views/campaigns/forms/panes/ui.blade.php index 90af90615b..cee46201c3 100644 --- a/resources/views/campaigns/forms/panes/ui.blade.php +++ b/resources/views/campaigns/forms/panes/ui.blade.php @@ -102,12 +102,6 @@ {!! Form::select('ui_settings[connections_mode]', [0 => __('campaigns.ui.collapsed.default'), 1 => __('entities/relations.options.only_relations'), 2 => __('entities/relations.options.related'), 3 => __('entities/relations.options.mentions')], null, ['class' => 'w-full']) !!} - - {!! Form::select('ui_settings[nested]', [0 => __('campaigns.ui.nested.user'), 1 => __('campaigns.ui.nested.nested')], (!isset($model) ? 1 : null), ['class' => '']) !!} - - options([ - 'route' => 'creatures.tree', + 'route' => 'creatures.index', 'baseRoute' => 'creatures', 'trans' => 'creatures.fields.', 'row' => [ diff --git a/resources/views/cruds/datagrids/_grid.blade.php b/resources/views/cruds/datagrids/_grid.blade.php index 6df00f1d27..fbd6fc7ede 100644 --- a/resources/views/cruds/datagrids/_grid.blade.php +++ b/resources/views/cruds/datagrids/_grid.blade.php @@ -21,7 +21,7 @@ @if ($stacked > 0)
type)) data-type="{{ \Illuminate\Support\Str::slug($model->type) }}" @endif> - + @if ($model->is_private)
diff --git a/resources/views/cruds/datagrids/explore.blade.php b/resources/views/cruds/datagrids/explore.blade.php index 7f511ba62a..f1cfd2a172 100644 --- a/resources/views/cruds/datagrids/explore.blade.php +++ b/resources/views/cruds/datagrids/explore.blade.php @@ -20,7 +20,7 @@ @include('cruds.datagrids._grid') @endforeach - @if ($models->hasPages() && auth()->check() && !UserCache::dismissedTutorial('pagination')) + @if (auth()->check() && $models->hasPages() && !UserCache::dismissedTutorial('pagination'))
- + @endsection @section('modals') diff --git a/resources/views/entities/components/header.blade.php b/resources/views/entities/components/header.blade.php index 64c412b576..754a5ad512 100644 --- a/resources/views/entities/components/header.blade.php +++ b/resources/views/entities/components/header.blade.php @@ -172,7 +172,7 @@ {{ __('crud.actions.new') }} - @if (\Illuminate\Support\Facades\Route::has($entity->pluralType() . '.tree')) + @if (method_exists($model, 'getParentKeyName')) {{ __('crud.actions.new_child') }} diff --git a/resources/views/entities/components/profile/_type.blade.php b/resources/views/entities/components/profile/_type.blade.php index b8791981e8..3c8890f77e 100644 --- a/resources/views/entities/components/profile/_type.blade.php +++ b/resources/views/entities/components/profile/_type.blade.php @@ -2,7 +2,7 @@
{{ __('crud.fields.type') }}
@php - $defaultOptions = auth()->check() && auth()->user()->entityExplore === '1' ? [$campaign, 'm' => 'table'] : [$campaign]; + $defaultOptions = [$campaign]; @endphp {!! link_to_route( $entity->pluralType() . '.index', diff --git a/resources/views/entities/pages/print/profile/_type.blade.php b/resources/views/entities/pages/print/profile/_type.blade.php index 86cdd58f5c..6d78256c93 100644 --- a/resources/views/entities/pages/print/profile/_type.blade.php +++ b/resources/views/entities/pages/print/profile/_type.blade.php @@ -1,6 +1,6 @@ @if (!empty($model->type)) @php -$defaultOptions = auth()->check() && auth()->user()->entityExplore === '1' ? [$campaign, 'm' => 'table'] : [$campaign]; +$defaultOptions = [$campaign]; @endphp | {{ __('crud.fields.type') }} | {{ $model->type }} | @endif diff --git a/resources/views/events/_tree.blade.php b/resources/views/events/_tree.blade.php index 7e1474fdd7..e5853da098 100644 --- a/resources/views/events/_tree.blade.php +++ b/resources/views/events/_tree.blade.php @@ -29,7 +29,7 @@ ] ]) ->options([ - 'route' => 'events.tree', + 'route' => 'events.index', 'baseRoute' => 'events', 'trans' => 'events.fields.', 'row' => [ diff --git a/resources/views/families/_tree.blade.php b/resources/views/families/_tree.blade.php index 920c741fee..c820017ce8 100644 --- a/resources/views/families/_tree.blade.php +++ b/resources/views/families/_tree.blade.php @@ -37,7 +37,7 @@ ] ]) ->options( [ - 'route' => 'families.tree', + 'route' => 'families.index', 'baseRoute' => 'families', 'trans' => 'families.fields.', 'row' => [ diff --git a/resources/views/items/_tree.blade.php b/resources/views/items/_tree.blade.php index 573423c7be..954dcca946 100644 --- a/resources/views/items/_tree.blade.php +++ b/resources/views/items/_tree.blade.php @@ -40,7 +40,7 @@ ] ]) ->options( [ - 'route' => 'items.tree', + 'route' => 'items.index', 'baseRoute' => 'items', 'trans' => 'items.fields.', 'row' => [ diff --git a/resources/views/journals/_tree.blade.php b/resources/views/journals/_tree.blade.php index 6044419534..23eee7d8c2 100644 --- a/resources/views/journals/_tree.blade.php +++ b/resources/views/journals/_tree.blade.php @@ -47,7 +47,7 @@ ] ]) ->options( [ - 'route' => 'journals.tree', + 'route' => 'journals.index', 'baseRoute' => 'journals', 'trans' => 'journals.fields.', 'row' => [ diff --git a/resources/views/layouts/datagrid/_togglers.blade.php b/resources/views/layouts/datagrid/_togglers.blade.php index 9ba80d26c5..82348a3910 100644 --- a/resources/views/layouts/datagrid/_togglers.blade.php +++ b/resources/views/layouts/datagrid/_togglers.blade.php @@ -1,4 +1,4 @@ -@if ($mode === 'grid') +@if ($mode === 'grid' && auth()->check())