diff --git a/app/Http/Controllers/TemplateController.php b/app/Http/Controllers/TemplateController.php index 8a89614d6..04a1b2acc 100644 --- a/app/Http/Controllers/TemplateController.php +++ b/app/Http/Controllers/TemplateController.php @@ -15,7 +15,7 @@ public function index(Request $request) { $limit = null; if ($request->offsetExists('limit') && $request->get('limit') > 0) { - $limit = (int) $request->get('limit'); + $limit = (int)$request->get('limit'); } $onlyMy = false; @@ -24,12 +24,18 @@ public function index(Request $request) } $templates = Template::limit($limit) - ->when(Auth::check() && !$onlyMy, function ($query) { - $query->where('publicly_listed', true); - $query->orWhere('creator_id', Auth::id()); + ->when(Auth::check(), function ($query) use ($onlyMy) { + if ($onlyMy) { + $query->where('creator_id', Auth::id()); + } else { + $query->where(function ($query) { + $query->where('publicly_listed', true) + ->orWhere('creator_id', Auth::id()); + }); + } }) - ->when(Auth::check() && $onlyMy, function ($query) { - $query->where('creator_id', Auth::id()); + ->when(!Auth::check(), function ($query) { + return $query->publiclyListed(); }) ->orderByDesc('created_at') ->get(); diff --git a/resources/js/components/open/forms/fields/FormBlockOptionsModal.vue b/resources/js/components/open/forms/fields/FormBlockOptionsModal.vue deleted file mode 100644 index 7c2e4e05a..000000000 --- a/resources/js/components/open/forms/fields/FormBlockOptionsModal.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - diff --git a/resources/js/components/open/forms/fields/FormFieldOptionsModal.vue b/resources/js/components/open/forms/fields/FormFieldOptionsModal.vue deleted file mode 100644 index fa4428c38..000000000 --- a/resources/js/components/open/forms/fields/FormFieldOptionsModal.vue +++ /dev/null @@ -1,579 +0,0 @@ - - -