mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update Timeline.vue, fix comment button
This commit is contained in:
parent
8a683a9285
commit
b6b5ce7c76
2 changed files with 60 additions and 2 deletions
|
@ -424,7 +424,7 @@
|
||||||
<div class="list-group-item border-0 py-1" v-for="(user, index) in following" :key="'following_'+index">
|
<div class="list-group-item border-0 py-1" v-for="(user, index) in following" :key="'following_'+index">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a :href="profileUrlRedirect(user)">
|
<a :href="profileUrlRedirect(user)">
|
||||||
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" loading="lazy">
|
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" loading="lazy" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0'">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body text-truncate">
|
<div class="media-body text-truncate">
|
||||||
<p class="mb-0" style="font-size: 14px">
|
<p class="mb-0" style="font-size: 14px">
|
||||||
|
@ -471,7 +471,7 @@
|
||||||
<div class="list-group-item border-0 py-1" v-for="(user, index) in followers" :key="'follower_'+index">
|
<div class="list-group-item border-0 py-1" v-for="(user, index) in followers" :key="'follower_'+index">
|
||||||
<div class="media mb-0">
|
<div class="media mb-0">
|
||||||
<a :href="profileUrlRedirect(user)">
|
<a :href="profileUrlRedirect(user)">
|
||||||
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" height="30px" loading="lazy">
|
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" height="30px" loading="lazy" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0'">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body mb-0">
|
<div class="media-body mb-0">
|
||||||
<p class="mb-0" style="font-size: 14px">
|
<p class="mb-0" style="font-size: 14px">
|
||||||
|
|
|
@ -942,6 +942,64 @@
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fetchStatusComments(status, card) {
|
||||||
|
let url = '/api/v2/comments/'+status.account.id+'/status/'+status.id;
|
||||||
|
axios.get(url)
|
||||||
|
.then(response => {
|
||||||
|
let self = this;
|
||||||
|
this.replies = _.reverse(response.data.data);
|
||||||
|
this.pagination = response.data.meta.pagination;
|
||||||
|
if(this.replies.length > 0) {
|
||||||
|
$('.load-more-link').removeClass('d-none');
|
||||||
|
}
|
||||||
|
$('.postCommentsLoader').addClass('d-none');
|
||||||
|
$('.postCommentsContainer').removeClass('d-none');
|
||||||
|
// setTimeout(function() {
|
||||||
|
// document.querySelectorAll('.status-comment .postCommentsContainer .comment-body a').forEach(function(i, e) {
|
||||||
|
// i.href = App.util.format.rewriteLinks(i);
|
||||||
|
// });
|
||||||
|
// }, 500);
|
||||||
|
}).catch(error => {
|
||||||
|
if(!error.response) {
|
||||||
|
$('.postCommentsLoader .lds-ring')
|
||||||
|
.attr('style','width:100%')
|
||||||
|
.addClass('pt-4 font-weight-bold text-muted')
|
||||||
|
.text('An error occurred, cannot fetch comments. Please try again later.');
|
||||||
|
} else {
|
||||||
|
switch(error.response.status) {
|
||||||
|
case 401:
|
||||||
|
$('.postCommentsLoader .lds-ring')
|
||||||
|
.attr('style','width:100%')
|
||||||
|
.addClass('pt-4 font-weight-bold text-muted')
|
||||||
|
.text('Please login to view.');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('.postCommentsLoader .lds-ring')
|
||||||
|
.attr('style','width:100%')
|
||||||
|
.addClass('pt-4 font-weight-bold text-muted')
|
||||||
|
.text('An error occurred, cannot fetch comments. Please try again later.');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
statusUrl(status) {
|
||||||
|
if(status.local == true) {
|
||||||
|
return status.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '/i/web/post/_/' + status.account.id + '/' + status.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
profileUrl(status) {
|
||||||
|
if(status.local == true) {
|
||||||
|
return status.account.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '/i/web/profile/_/' + status.account.id;
|
||||||
|
},
|
||||||
|
|
||||||
formatCount(count) {
|
formatCount(count) {
|
||||||
return App.util.format.count(count);
|
return App.util.format.count(count);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue