mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Merge pull request #1530 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
d3356e0265
3 changed files with 25 additions and 5 deletions
|
@ -73,7 +73,7 @@ class AvatarController extends Controller
|
|||
|
||||
public function buildPath($id)
|
||||
{
|
||||
$padded = str_pad($id, 12, 0, STR_PAD_LEFT);
|
||||
$padded = str_pad($id, 19, 0, STR_PAD_LEFT);
|
||||
$parts = str_split($padded, 3);
|
||||
foreach ($parts as $k => $part) {
|
||||
if ($k == 0) {
|
||||
|
@ -93,6 +93,21 @@ class AvatarController extends Controller
|
|||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 4) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 5) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4].'/'.$parts[5];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 6) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4].'/'.$parts[5].'/'.$parts[6];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
}
|
||||
|
||||
return $avatarpath;
|
||||
|
|
|
@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
|||
use Auth;
|
||||
use Cache;
|
||||
use App\Follower;
|
||||
use App\FollowRequest;
|
||||
use App\Profile;
|
||||
use App\User;
|
||||
use App\UserFilter;
|
||||
|
@ -67,8 +68,12 @@ class ProfileController extends Controller
|
|||
$is_following = ($owner == false && Auth::check()) ? $user->followedBy(Auth::user()->profile) : false;
|
||||
|
||||
if ($isPrivate == true || $isBlocked == true) {
|
||||
return view('profile.private', compact('user', 'is_following'));
|
||||
$requested = Auth::check() ? FollowRequest::whereFollowerId(Auth::user()->profile_id)
|
||||
->whereFollowingId($user->id)
|
||||
->exists() : false;
|
||||
return view('profile.private', compact('user', 'is_following', 'requested'));
|
||||
}
|
||||
|
||||
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
||||
$profile = $user;
|
||||
$settings = [
|
||||
|
|
|
@ -103,7 +103,7 @@ trait ExportSettings
|
|||
$this->validate($request, [
|
||||
'type' => 'required|string|in:ap,api'
|
||||
]);
|
||||
$limit = 300;
|
||||
$limit = 500;
|
||||
|
||||
$profile = Auth::user()->profile;
|
||||
$type = 'ap';
|
||||
|
@ -116,7 +116,7 @@ trait ExportSettings
|
|||
|
||||
$filename = 'outbox.json';
|
||||
if($type == 'ap') {
|
||||
$data = Cache::remember('account:export:profile:statuses:ap:'.Auth::user()->profile->id, now()->addDays(7), function() {
|
||||
$data = Cache::remember('account:export:profile:statuses:ap:'.Auth::user()->profile->id, now()->addHours(1), function() {
|
||||
$profile = Auth::user()->profile->statuses;
|
||||
$fractal = new Fractal\Manager();
|
||||
$fractal->setSerializer(new ArraySerializer());
|
||||
|
@ -125,7 +125,7 @@ trait ExportSettings
|
|||
});
|
||||
} else {
|
||||
$filename = 'api-statuses.json';
|
||||
$data = Cache::remember('account:export:profile:statuses:api:'.Auth::user()->profile->id, now()->addDays(7), function() {
|
||||
$data = Cache::remember('account:export:profile:statuses:api:'.Auth::user()->profile->id, now()->addHours(1), function() {
|
||||
$profile = Auth::user()->profile->statuses;
|
||||
$fractal = new Fractal\Manager();
|
||||
$fractal->setSerializer(new ArraySerializer());
|
||||
|
|
Loading…
Reference in a new issue