pull/587/head
Daniel Supernault 2018-11-22 13:21:36 -07:00
rodzic 10cfb02a9e
commit 580bfd0bbe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
8 zmienionych plików z 41 dodań i 15 usunięć

Wyświetl plik

@ -133,8 +133,11 @@ class StatusController extends Controller
if ($status->profile_id === Auth::user()->profile->id || Auth::user()->is_admin == true) {
StatusDelete::dispatch($status);
}
return redirect(Auth::user()->url());
if($request->wantsJson()) {
return response()->json(['Status successfully deleted.']);
} else {
return redirect(Auth::user()->url());
}
}
public function storeShare(Request $request)

Wyświetl plik

@ -38,15 +38,12 @@ class StatusDelete implements ShouldQueue
public function handle()
{
$status = $this->status;
$this->unlinkRemoveMedia($status);
}
public function unlinkRemoveMedia($status)
{
if ($status->media()->count() == 0) {
return;
}
foreach ($status->media as $media) {
$thumbnail = storage_path("app/{$media->thumbnail_path}");
$photo = storage_path("app/{$media->media_path}");

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -1,5 +1,5 @@
{
"/js/components.js": "/js/components.js?id=2be1a8411d833c2826ab",
"/js/components.js": "/js/components.js?id=b5ec6a460ae105e0f0ce",
"/js/app.js": "/js/app.js?id=763d01bb175be69c8ad3",
"/css/app.css": "/css/app.css?id=0f11643b1635ebda5e1b",
"/js/timeline.js": "/js/timeline.js?id=415bfde862ab8c5b4548",

Wyświetl plik

@ -114,4 +114,9 @@ $(document).ready(function() {
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
});
});
const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
const warningDescCSS = 'font-size: 18px;';
console.log('%cStop!', warningTitleCSS);
console.log("%cThis is a browser feature intended for developers. If someone told you to copy and paste something here to enable a Pixelfed feature or \"hack\" someone's account, it is a scam and will give them access to your Pixelfed account.", warningDescCSS);

Wyświetl plik

@ -37,6 +37,7 @@
<b-dropdown-item class="font-weight-bold" :href="comment.account.url">Profile</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item class="font-weight-bold" :href="'/i/report?type=post&id='+comment.id">Report</b-dropdown-item>
<b-dropdown-item class="font-weight-bold" v-on:click="deleteComment(comment.id, index)" v-if="comment.account.id == user.id">Delete</b-dropdown-item>
</b-dropdown>
</span>
</p>
@ -47,7 +48,7 @@
<script>
export default {
props: ['post-id', 'post-username'],
props: ['post-id', 'post-username', 'user'],
data() {
return {
results: {},
@ -67,6 +68,16 @@ export default {
embed(e) {
pixelfed.embed.build(e);
},
deleteComment(id, i) {
axios.post('/i/delete', {
type: 'comment',
item: id
}).then(res => {
this.results.splice(i, 1);
}).catch(err => {
swal('Something went wrong!', 'Please try again later', 'error');
});
},
l(e) {
let len = e.length;
if(len < 10) { return e; }

Wyświetl plik

@ -201,7 +201,7 @@
<span class="font-weight-bold pr-1">{{statusUsername}}</span>
<span class="comment-text"></span>
</p>
<post-comments :post-id="statusId" :post-username="statusUsername"></post-comments>
<post-comments :user="this.user" :post-id="statusId" :post-username="statusUsername"></post-comments>
</div>
</div>
<div class="card-body flex-grow-0 py-1">
@ -266,7 +266,7 @@
pixelfed.postComponent = {};
pixelfed.presenter = {
show: {
image: function(container, media) { console.log(234);
image: function(container, media) {
let wrapper = $('<div>');
wrapper.addClass(media[0]['filter_class']);
let el = $('<img>');
@ -345,9 +345,7 @@ export default {
},
showMuteBlock() {
let sid = this.status.account.id;
console.log('sid :' + sid);
let uid = this.user.id;
console.log('uid :' + uid);
if(sid != uid) {
$('.post-actions').removeClass('d-none');
}

Wyświetl plik

@ -26,7 +26,19 @@
<div class="media-body">
<h5 class="mt-0 font-weight-bold">{{$status->profile->username}}</h5>
<p class="mb-1">{!! $status->rendered !!}</p>
<p class="mb-0"><a href="{{$status->url()}}" class="text-muted">{{$status->created_at->diffForHumans()}}</a></p>
<div class="mb-0">
<a href="{{$status->url()}}" class="text-muted">
{{$status->created_at->diffForHumans()}}
</a>
@if(Auth::check() && $status->profile_id == Auth::user()->profile->id)
<form class="float-right" method="POST" action="/i/delete">
@csrf
<input type="hidden" name="item" value="{{$status->id}}">
<input type="hidden" name="type" value="status">
<button class="btn btn-outline-danger small font-weight-bold btn-sm py-1">Delete</button>
</form>
@endif
</div>
</div>
</div>
</div>