Update PostComponent.vue, update styling

This commit is contained in:
Daniel Supernault 2020-03-24 21:20:41 -06:00
parent 4c3b0b7d52
commit 844566b9e7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -137,15 +137,21 @@
<div v-if="showComments"> <div v-if="showComments">
<hr> <hr>
<div class="postCommentsLoader text-center"> <div class="postCommentsLoader text-center py-2">
<div class="spinner-border" role="status"> <div class="spinner-border" role="status">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
</div> </div>
<div class="postCommentsContainer d-none"> <div class="postCommentsContainer d-none">
<p v-if="status.reply_count > 10"class="mb-1 text-center load-more-link d-none"><a href="#" class="text-muted" v-on:click="loadMore">Load more comments</a></p> <p v-if="status.reply_count > 10" class="mb-1 text-center load-more-link d-none my-3">
<a href="#" class="text-dark" v-on:click="loadMore" title="Load more comments" data-toggle="tooltip" data-placement="bottom">
<svg class="bi bi-plus-circle" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" style="font-size:2em;"> <path fill-rule="evenodd" d="M8 3.5a.5.5 0 01.5.5v4a.5.5 0 01-.5.5H4a.5.5 0 010-1h3.5V4a.5.5 0 01.5-.5z" clip-rule="evenodd"/> <path fill-rule="evenodd" d="M7.5 8a.5.5 0 01.5-.5h4a.5.5 0 010 1H8.5V12a.5.5 0 01-1 0V8z" clip-rule="evenodd"/> <path fill-rule="evenodd" d="M8 15A7 7 0 108 1a7 7 0 000 14zm0 1A8 8 0 108 0a8 8 0 000 16z" clip-rule="evenodd"/></svg>
</a>
</p>
<div class="comments"> <div class="comments">
<div v-for="(reply, index) in results" class="pb-3" :key="'tl' + reply.id + '_' + index"> <div v-for="(reply, index) in results" class="pb-4 media" :key="'tl' + reply.id + '_' + index">
<img :src="reply.account.avatar" class="rounded-circle border mr-3" width="42px" height="42px">
<div class="media-body">
<div v-if="reply.sensitive == true"> <div v-if="reply.sensitive == true">
<span class="py-3"> <span class="py-3">
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a> <a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a>
@ -161,9 +167,9 @@
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a> <a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a>
<span class="text-break " v-html="reply.content"></span> <span class="text-break " v-html="reply.content"></span>
</span> </span>
<span class="pl-2" style="min-width:38px"> <span class="pl-2">
<span v-on:click="likeReply(reply, $event)"><i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span> <!-- <span v-on:click="likeReply(reply, $event)"><i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span> -->
<post-menu :status="reply" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block pl-2" v-on:deletePost="deleteComment(reply.id, index)"></post-menu> <post-menu :status="reply" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block px-2" v-on:deletePost="deleteComment(reply.id, index)"></post-menu>
</span> </span>
</p> </p>
<p class=""> <p class="">
@ -171,12 +177,14 @@
<span v-if="reply.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3">{{reply.favourites_count == 1 ? '1 like' : reply.favourites_count + ' likes'}}</span> <span v-if="reply.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3">{{reply.favourites_count == 1 ? '1 like' : reply.favourites_count + ' likes'}}</span>
<span class="text-muted comment-reaction font-weight-bold cursor-pointer" v-on:click="replyFocus(reply, index)">Reply</span> <span class="text-muted comment-reaction font-weight-bold cursor-pointer" v-on:click="replyFocus(reply, index)">Reply</span>
</p> </p>
<div v-if="reply.reply_count > 0" class="cursor-pointer" style="margin-left:30px;" v-on:click="toggleReplies(reply)"> <div v-if="reply.reply_count > 0" class="cursor-pointer" v-on:click="toggleReplies(reply)">
<span class="show-reply-bar"></span> <span class="show-reply-bar"></span>
<span class="comment-reaction font-weight-bold text-muted">{{reply.thread ? 'Hide' : 'View'}} Replies ({{reply.reply_count}})</span> <span class="comment-reaction font-weight-bold text-muted">{{reply.thread ? 'Hide' : 'View'}} Replies ({{reply.reply_count}})</span>
</div> </div>
<div v-if="reply.thread == true" class="comment-thread"> <div v-if="reply.thread == true" class="comment-thread">
<div v-for="(s, sindex) in reply.replies" class="pb-3" :key="'cr' + s.id + '_' + index"> <div v-for="(s, sindex) in reply.replies" class="pb-3 media" :key="'cr' + s.id + '_' + index">
<img :src="s.account.avatar" class="rounded-circle border mr-3" width="25px" height="25px">
<div class="media-body">
<p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;"> <p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;">
<span> <span>
<a class="text-dark font-weight-bold mr-1" :href="s.account.url" :title="s.account.username">{{s.account.username}}</a> <a class="text-dark font-weight-bold mr-1" :href="s.account.url" :title="s.account.username">{{s.account.username}}</a>
@ -198,6 +206,8 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
@ -467,9 +477,8 @@
</infinite-loading> </infinite-loading>
</div> </div>
</b-modal> </b-modal>
<b-modal <b-modal ref="lightboxModal"
id="lightbox" id="lightbox"
ref="lightboxModal"
:hide-header="true" :hide-header="true"
:hide-footer="true" :hide-footer="true"
centered centered
@ -544,8 +553,7 @@
width: 24px; width: 24px;
} }
.comment-thread { .comment-thread {
margin: 4px 0 0 40px; margin-top: 1rem;
width: calc(100% - 40px);
} }
.emoji-reactions .nav-item { .emoji-reactions .nav-item {
font-size: 1.2rem; font-size: 1.2rem;
@ -557,6 +565,12 @@
height: 0px; height: 0px;
background: transparent; background: transparent;
} }
@media (min-width: 1200px) {
.container {
max-width: 1100px;
}
}
</style> </style>
<style type="text/css" scoped> <style type="text/css" scoped>
.momentui .bg-dark { .momentui .bg-dark {
@ -647,6 +661,7 @@ export default {
updated() { updated() {
$('.carousel').carousel(); $('.carousel').carousel();
// $('[data-toggle="tooltip"]').tooltip();
if(this.showReadMore == true) { if(this.showReadMore == true) {
window.pixelfed.readmore(); window.pixelfed.readmore();
} }
@ -1010,6 +1025,7 @@ export default {
$('.load-more-link').addClass('d-none'); $('.load-more-link').addClass('d-none');
return; return;
} }
$('.load-more-link').addClass('d-none');
$('.postCommentsLoader').removeClass('d-none'); $('.postCommentsLoader').removeClass('d-none');
let next = this.pagination.links.next; let next = this.pagination.links.next;
axios.get(next) axios.get(next)
@ -1021,6 +1037,7 @@ export default {
this.results.unshift(res[i]); this.results.unshift(res[i]);
} }
this.pagination = response.data.meta.pagination; this.pagination = response.data.meta.pagination;
$('.load-more-link').removeClass('d-none');
}); });
}, },