diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index 61b52fe2..f6ddff91 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -306,4 +306,18 @@ class InternalApiController extends Controller Cache::forget('profile:status_count:'.$profile->id); return $status->url(); } + + public function bookmarks(Request $request) + { + $statuses = Auth::user()->profile + ->bookmarks() + ->withCount(['likes','comments']) + ->orderBy('created_at', 'desc') + ->simplePaginate(10); + + $resource = new Fractal\Resource\Collection($statuses, new StatusTransformer()); + $res = $this->fractal->createData($resource)->toArray(); + + return response()->json($res); + } } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 7050bb6d..d5db00b1 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -240,23 +240,4 @@ class ProfileController extends Controller } return view('profile.following', compact('user', 'profile', 'following', 'owner', 'is_following', 'is_admin', 'settings')); } - - public function savedBookmarks(Request $request, $username) - { - if (Auth::check() === false || $username !== Auth::user()->username) { - abort(403); - } - $user = $profile = Auth::user()->profile; - if($profile->status != null) { - return $this->accountCheck($profile); - } - $settings = User::whereUsername($username)->firstOrFail()->settings; - $owner = true; - $following = false; - $timeline = $user->bookmarks()->withCount(['likes','comments'])->orderBy('created_at', 'desc')->simplePaginate(10); - $is_following = ($owner == false && Auth::check()) ? $user->followedBy(Auth::user()->profile) : false; - $is_admin = is_null($user->domain) ? $user->user->is_admin : false; - return view('profile.bookmarks', compact('user', 'profile', 'settings', 'owner', 'following', 'timeline', 'is_following', 'is_admin')); - } - } diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 769c9073..c78bad9e 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -192,8 +192,14 @@ class SettingsController extends Controller $patreon = Str::startsWith($request->input('patreon'), 'https://') ? substr($request->input('patreon'), 8) : $request->input('patreon'); - $liberapay = Str::startsWith($request->input('liberapay'), 'https://') ? substr($request->input('liberapay'), 8) : $request->input('liberapay'); - $opencollective = Str::startsWith($request->input('opencollective'), 'https://') ? substr($request->input('opencollective'), 8) : $request->input('opencollective'); + + $liberapay = Str::startsWith($request->input('liberapay'), 'https://') ? + substr($request->input('liberapay'), 8) : + $request->input('liberapay'); + + $opencollective = Str::startsWith($request->input('opencollective'), 'https://') ? + substr($request->input('opencollective'), 8) : + $request->input('opencollective'); $patreon = Str::startsWith($patreon, 'patreon.com/') ? e($patreon) : null; $liberapay = Str::startsWith($liberapay, 'liberapay.com/') ? e($liberapay) : null; diff --git a/public/js/profile.js b/public/js/profile.js index 9661c7e5..df0f2850 100644 Binary files a/public/js/profile.js and b/public/js/profile.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 21dbaa09..565cc777 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/Profile.vue b/resources/assets/js/components/Profile.vue index b3e53504..e25c9fa0 100644 --- a/resources/assets/js/components/Profile.vue +++ b/resources/assets/js/components/Profile.vue @@ -1,524 +1,526 @@ -