diff --git a/timeliner/app/Http/Controllers/TimelineController.php b/timeliner/app/Http/Controllers/TimelineController.php index e9167ac..ced0ccf 100644 --- a/timeliner/app/Http/Controllers/TimelineController.php +++ b/timeliner/app/Http/Controllers/TimelineController.php @@ -64,17 +64,11 @@ public function show($id) public function showDashboard() { - $user = Auth::user(); + $timelines = $this->timelinesWithOwnership(); - $timelines = DB::select(" - SELECT timelines.* - FROM timelines - JOIN ownerships - ON CAST(SUBSTR(ownerships.id, 1, LENGTH(ownerships.id) - LENGTH(?)) AS INTEGER) = timelines.id - WHERE CAST(SUBSTR(ownerships.id, -LENGTH(?)) AS INTEGER) = ? - ", [$user->id, $user->id, $user->id]); + $timelinesWithOwnership = $this->timelinesWithOwnership(); - return view('dashboard',['timelines' => $timelines]); + return view('dashboard',['timelines' => $timelines, 'timelinesWithOwnership' => $timelinesWithOwnership]); } public function create() diff --git a/timeliner/resources/views/dashboard.blade.php b/timeliner/resources/views/dashboard.blade.php index 29d634b..a6da339 100644 --- a/timeliner/resources/views/dashboard.blade.php +++ b/timeliner/resources/views/dashboard.blade.php @@ -11,9 +11,6 @@
{{ __("You're logged in!") }}
-
- @include("timeline.partials.timelinelist", $timelines) -
diff --git a/timeliner/resources/views/timeline/create.blade.php b/timeliner/resources/views/timeline/create.blade.php index dbb0e97..9cead26 100644 --- a/timeliner/resources/views/timeline/create.blade.php +++ b/timeliner/resources/views/timeline/create.blade.php @@ -34,7 +34,7 @@ -
+
@include('timeline.partials.nodecreate')
diff --git a/timeliner/resources/views/timeline/edit.blade.php b/timeliner/resources/views/timeline/edit.blade.php index 325aa94..57cd32d 100644 --- a/timeliner/resources/views/timeline/edit.blade.php +++ b/timeliner/resources/views/timeline/edit.blade.php @@ -32,7 +32,7 @@
-
+
@include('timeline.partials.nodeedit', ['nodes' => $nodes])
@@ -54,4 +54,4 @@
- \ No newline at end of file +