diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c155d4da..5d40ff6f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,10 @@ - Fix remote account post counts ([149cf9dc](https://github.com/pixelfed/pixelfed/commit/149cf9dc)) - Enforce blocks on incoming likes, shares, replies and follows on all endpoints ([1545e37c](https://github.com/pixelfed/pixelfed/commit/1545e37c)) - Fix unlisted post web redirect and api response ([6033d837](https://github.com/pixelfed/pixelfed/commit/6033d837)) +- Remove quilljs from admin page editor, fixes #3616 ([75fbd373](https://github.com/pixelfed/pixelfed/commit/75fbd373)) +- Fix AdminStatService cache key, fixes #3612 ([d1dbed89](https://github.com/pixelfed/pixelfed/commit/d1dbed89)) +- Improve mute/block v1 api endpoints, fixes #3540 ([c3e8a0e4](https://github.com/pixelfed/pixelfed/commit/c3e8a0e4)) +- Set Last-Modified header for atom feeds, fixes #2988 ([c18dcde3](https://github.com/pixelfed/pixelfed/commit/c18dcde3)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 72f76f25d..68558a3c2 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -873,12 +873,15 @@ class ApiV1Controller extends Controller ->whereFilterableType('App\Profile') ->whereFilterType('block') ->simplePaginate($limit) - ->pluck('filterable_id'); + ->pluck('filterable_id') + ->map(function($id) { + return AccountService::get($id, true); + }) + ->filter(function($account) { + return $account && isset($account['id']); + }); - $profiles = Profile::findOrFail($blocked); - $resource = new Fractal\Resource\Collection($profiles, new AccountTransformer()); - $res = $this->fractal->createData($resource)->toArray(); - return $this->json($res); + return $this->json($blocked); } /** @@ -1725,19 +1728,21 @@ class ApiV1Controller extends Controller ]); $user = $request->user(); - $limit = $request->input('limit') ?? 40; + $limit = $request->input('limit', 40); $mutes = UserFilter::whereUserId($user->profile_id) ->whereFilterableType('App\Profile') ->whereFilterType('mute') ->simplePaginate($limit) - ->pluck('filterable_id'); + ->pluck('filterable_id') + ->map(function($id) { + return AccountService::get($id, true); + }) + ->filter(function($account) { + return $account && isset($account['id']); + }); - $accounts = Profile::find($mutes); - - $resource = new Fractal\Resource\Collection($accounts, new AccountTransformer()); - $res = $this->fractal->createData($resource)->toArray(); - return $this->json($res); + return $this->json($mutes); } /** diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 147d95842..179db033d 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -118,8 +118,7 @@ class ProfileController extends Controller 'list' => $settings->show_profile_followers ] ]; - $ui = $request->has('ui') && $request->input('ui') == 'memory' ? 'profile.memory' : 'profile.show'; - return view($ui, compact('profile', 'settings')); + return view('profile.show', compact('profile', 'settings')); } } @@ -210,7 +209,7 @@ class ProfileController extends Controller ->whereProfileId($pid) ->whereVisibility('public') ->whereType('photo') - ->latest() + ->orderByDesc('id') ->take(10) ->get() ->map(function($status) { @@ -224,10 +223,14 @@ class ProfileController extends Controller }) ->values(); $permalink = config('app.url') . "/users/{$profile['username']}.atom"; + $headers = ['Content-Type' => 'application/atom+xml']; + if($items && $items->count()) { + $headers['Last-Modified'] = now()->parse($items->first()['created_at'])->toRfc7231String(); + } return response() ->view('atom.user', compact('profile', 'items', 'permalink')) - ->header('Content-Type', 'application/atom+xml'); + ->withHeaders($headers); } public function meRedirect() diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index 7202f7c6e..f4cac26be 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -80,7 +80,7 @@ class SiteController extends Controller { $page = Cache::remember('site:privacy', now()->addDays(120), function() { $slug = '/site/privacy'; - $page = Page::whereSlug($slug)->whereActive(true)->first(); + return Page::whereSlug($slug)->whereActive(true)->first(); }); return View::make('site.privacy')->with(compact('page'))->render(); } diff --git a/app/Services/AdminStatsService.php b/app/Services/AdminStatsService.php index 2117207f3..9e345355a 100644 --- a/app/Services/AdminStatsService.php +++ b/app/Services/AdminStatsService.php @@ -113,7 +113,7 @@ class AdminStatsService protected static function additionalDataSummary() { $ttl = now()->addHours(24); - return Cache::remember('admin:dashboard:home:data:v0:24hr', $ttl, function() { + return Cache::remember('admin:dashboard:home:data-summary:v0:24hr', $ttl, function() { return [ 'statuses' => PrettyNumber::convert(Status::count()), 'profiles' => PrettyNumber::convert(Profile::count()), diff --git a/resources/views/admin/pages/edit.blade.php b/resources/views/admin/pages/edit.blade.php index de1a7feb8..5a3530e0d 100644 --- a/resources/views/admin/pages/edit.blade.php +++ b/resources/views/admin/pages/edit.blade.php @@ -1,27 +1,36 @@ -@extends('admin.partial.template') - -@include('admin.settings.sidebar') +@extends('admin.partial.template-full') @section('section') -
-

Edit Page

-

{{$page->slug}}

-
-
- -
+
+
+
+
+
+
+

Edit Page

+

{{$page->slug}}

+
+
+
+
+
+

Page URL: {{$page->url()}} {{-- Edit --}}

-
+
{!!$page->content!!}
+
+ + +
-
+
active?'checked="true"':''}}>
@@ -34,69 +43,69 @@
- +
@endsection @push('styles') - @endpush @push('scripts') - - -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/admin/pages/home.blade.php b/resources/views/admin/pages/home.blade.php index cb315c27b..bab294647 100644 --- a/resources/views/admin/pages/home.blade.php +++ b/resources/views/admin/pages/home.blade.php @@ -1,11 +1,56 @@ @extends('admin.partial.template-full') @section('section') -
-

Pages

-

Set custom page content

-
-
+
+
+
+
+
+
+

Pages

+

Manage public and custom page content

+
+ + @if($pages->count() < 4) +
+
+
+ @if(!$pages->contains('slug', '=', '/site/about')) +
+ @csrf + + +
+ @endif + @if(!$pages->contains('slug', '=', '/site/privacy')) +
+ @csrf + + +
+ @endif + @if(!$pages->contains('slug', '=', '/site/terms')) +
+ @csrf + + +
+ @endif + @if(!$pages->contains('slug', '=', '/site/kb/community-guidelines')) +
+ @csrf + + +
+ @endif +
+
+ @endif +
+
+
+
+
@if($pages->count())
@@ -46,57 +91,11 @@
{{$pages->links()}}
-
-
-
- @csrf - - - -
- @csrf - - - -
- @csrf - - - -
- @csrf - - - -
- @else -
+ @else +
-

No custom pages found

+

No custom pages found

-
-
-
- @csrf - - - -
- @csrf - - - -
- @csrf - - - -
- @csrf - - - -
@endif @endsection