mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-27 00:33:17 +00:00
commit
231d9aa162
6 changed files with 58 additions and 36 deletions
|
@ -24,8 +24,11 @@ use App\{
|
|||
FollowRequest,
|
||||
Hashtag,
|
||||
HashtagFollow,
|
||||
ImportData,
|
||||
ImportJob,
|
||||
Like,
|
||||
Media,
|
||||
MediaTag,
|
||||
Mention,
|
||||
Notification,
|
||||
OauthClient,
|
||||
|
@ -81,10 +84,29 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
|
||||
$id = $user->profile_id;
|
||||
|
||||
Bookmark::whereProfileId($user->profile_id)->forceDelete();
|
||||
ImportData::whereProfileId($id)
|
||||
->cursor()
|
||||
->each(function($data) {
|
||||
$path = storage_path('app/'.$data->path);
|
||||
if(is_file($path)) {
|
||||
unlink($path);
|
||||
}
|
||||
$data->delete();
|
||||
});
|
||||
ImportJob::whereProfileId($id)
|
||||
->cursor()
|
||||
->each(function($data) {
|
||||
$path = storage_path('app/'.$data->media_json);
|
||||
if(is_file($path)) {
|
||||
unlink($path);
|
||||
}
|
||||
$data->delete();
|
||||
});
|
||||
MediaTag::whereProfileId($id)->delete();
|
||||
Bookmark::whereProfileId($id)->forceDelete();
|
||||
EmailVerification::whereUserId($user->id)->forceDelete();
|
||||
StatusHashtag::whereProfileId($id)->delete();
|
||||
DirectMessage::whereFromId($user->profile_id)->delete();
|
||||
DirectMessage::whereFromId($id)->delete();
|
||||
FollowRequest::whereFollowingId($id)
|
||||
->orWhere('follower_id', $id)
|
||||
->forceDelete();
|
||||
|
@ -143,7 +165,14 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
});
|
||||
|
||||
DB::transaction(function() use ($user) {
|
||||
Status::whereProfileId($user->profile_id)->forceDelete();
|
||||
Status::whereProfileId($user->profile_id)
|
||||
->cursor()
|
||||
->each(function($status) {
|
||||
AccountInterstitial::where('item_type', 'App\Status')
|
||||
->where('item_id', $status->id)
|
||||
->delete();
|
||||
$status->forceDelete();
|
||||
});
|
||||
Report::whereUserId($user->id)->forceDelete();
|
||||
$this->deleteProfile($user);
|
||||
});
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Jobs\StatusPipeline;
|
|||
|
||||
use DB;
|
||||
use App\{
|
||||
AccountInterstitial,
|
||||
MediaTag,
|
||||
Notification,
|
||||
Report,
|
||||
|
@ -115,6 +116,10 @@ class StatusDelete implements ShouldQueue
|
|||
$tag->delete();
|
||||
});
|
||||
|
||||
AccountInterstitial::where('item_type', 'App\Status')
|
||||
->where('item_id', $status->id)
|
||||
->delete();
|
||||
|
||||
$status->forceDelete();
|
||||
});
|
||||
|
||||
|
|
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -6,7 +6,7 @@
|
|||
<button class="btn btn-dark px-4 rounded-pill font-weight-bold shadow" @click="syncNewPosts">Load New Posts</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="d-none d-md-block col-12 pl-3 pl-md-0 pt-3 pl-0">
|
||||
<div class="d-none col-12 pl-3 pl-md-0 pt-3 pl-0">
|
||||
<div class="d-none d-md-flex justify-content-between align-items-center">
|
||||
<p class="lead text-muted mb-0"><i :class="[scope == 'home' ? 'fas fa-home':'fas fa-stream']"></i> {{scope == 'local' ? 'Public' : 'Home'}} Timeline</p>
|
||||
<p class="mb-0">
|
||||
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
|
||||
<div v-if="index == 0 && showTips && !loading" class="mb-4 card-tips">
|
||||
<div v-if="index == 0 && showTips && !loading" class="my-4 card-tips">
|
||||
<announcements-card v-on:show-tips="showTips = $event"></announcements-card>
|
||||
</div>
|
||||
<div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
|
||||
|
@ -95,7 +95,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
|
||||
<div :class="index == 0 ? 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border mt-md-4' : 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border'">
|
||||
<div v-if="status" class="card-header d-inline-flex align-items-center bg-white">
|
||||
<!-- <img v-bind:src="status.account.avatar" width="38px" height="38px" class="cursor-pointer" style="border-radius: 38px;" @click="profileUrl(status)" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
|
||||
<!-- <div v-if="hasStory" class="has-story has-story-sm cursor-pointer shadow-sm" @click="profileUrl(status)">
|
||||
|
|
|
@ -33,40 +33,45 @@
|
|||
<div class="ml-auto">
|
||||
<ul class="navbar-nav align-items-center">
|
||||
<li class="nav-item px-md-2 d-none d-md-block">
|
||||
<a class="nav-link font-weight-bold text-muted" href="{{route('discover')}}" title="Discover" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="far fa-compass fa-lg"></i>
|
||||
<span class="sr-only">Discover</span>
|
||||
<a class="nav-link font-weight-bold text-dark" href="/" title="Home" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="fas fa-home fa-lg"></i>
|
||||
<span class="sr-only">Home</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item px-md-2 d-none d-md-block">
|
||||
<a class="nav-link font-weight-bold text-dark" href="/?a=co" title="Compose" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="far fa-plus-square fa-lg"></i>
|
||||
<span class="sr-only">Compose</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item px-md-2">
|
||||
<a class="nav-link font-weight-bold text-muted" href="/account/direct" title="Direct" data-toggle="tooltip" data-placement="bottom">
|
||||
<a class="nav-link font-weight-bold text-dark" href="/account/direct" title="Direct" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="far fa-comment-dots fa-lg"></i>
|
||||
<span class="sr-only">Direct</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item px-md-2 d-none d-md-block">
|
||||
<a class="nav-link font-weight-bold text-muted" href="/account/activity" title="Notifications" data-toggle="tooltip" data-placement="bottom">
|
||||
<a class="nav-link font-weight-bold text-dark" href="/account/activity" title="Notifications" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="far fa-bell fa-lg"></i>
|
||||
<span class="sr-only">Notifications</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown ml-2">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="User Menu" data-toggle="tooltip" data-placement="bottom">
|
||||
<i class="far fa-user fa-lg text-muted"></i>
|
||||
<i class="far fa-user fa-lg text-dark"></i>
|
||||
<span class="sr-only">User Menu</span>
|
||||
<img class="d-none" src="/storage/avatars/default.png?v=0" class="rounded-circle border shadow" width="34" height="34" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
<div class="dropdown-item font-weight-bold cursor-pointer" onclick="App.util.compose.post()">
|
||||
<span class="fas fa-camera pr-2 text-primary"></span>
|
||||
New Post
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item font-weight-bold" href="/">
|
||||
<a class="d-block d-md-none dropdown-item font-weight-bold" href="/">
|
||||
<span class="fas fa-home pr-2 text-lighter"></span>
|
||||
Home
|
||||
</a>
|
||||
<a class="dropdown-item font-weight-bold" href="{{route('discover')}}">
|
||||
<span class="far fa-compass pr-2 text-lighter"></span>
|
||||
{{__('navmenu.discover')}}
|
||||
</a>
|
||||
<a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}">
|
||||
<span class="fas fa-stream pr-2 text-lighter"></span>
|
||||
Public
|
||||
|
@ -75,33 +80,16 @@
|
|||
<span class="fas fa-history text-lighter pr-2"></span>
|
||||
Stories
|
||||
</a>
|
||||
{{-- <a class="dropdown-item font-weight-bold" href="#">
|
||||
<span class="fas fa-circle-notch pr-2 text-lighter"></span>
|
||||
Circles
|
||||
</a> --}}
|
||||
{{-- <a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}">
|
||||
<span class="fas fa-project-diagram fa-sm pr-2 text-lighter"></span>
|
||||
Network
|
||||
</a> --}}
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item font-weight-bold" href="/i/me">
|
||||
<span class="far fa-user pr-2 text-lighter"></span>
|
||||
{{__('navmenu.myProfile')}}
|
||||
</a>
|
||||
<a class="d-block d-md-none dropdown-item font-weight-bold" href="{{route('discover')}}">
|
||||
<span class="far fa-compass pr-2 text-lighter"></span>
|
||||
{{__('navmenu.discover')}}
|
||||
</a>
|
||||
<a class="dropdown-item font-weight-bold" href="{{route('notifications')}}">
|
||||
<span class="far fa-bell pr-2 text-lighter"></span>
|
||||
Notifications
|
||||
</a>
|
||||
<a class="dropdown-item font-weight-bold" href="{{route('settings')}}">
|
||||
<span class="fas fa-cog pr-2 text-lighter"></span>
|
||||
{{__('navmenu.settings')}}
|
||||
</a>
|
||||
@if(Auth::user()->is_admin == true)
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item font-weight-bold" href="{{ route('admin.home') }}">
|
||||
<span class="fas fa-shield-alt fa-sm pr-2 text-lighter"></span>
|
||||
{{__('navmenu.admin')}}
|
||||
|
|
Loading…
Reference in a new issue