Merge branch 'fix/show-fav-and-rt-counts' into 'develop'

Show fav/RT counts even if not logged in.

See merge request pleroma/pleroma-fe!199
This commit is contained in:
Shpuld Shpludson 2018-02-02 05:36:35 +00:00
commit 47a7a3ae6f
5 changed files with 24 additions and 18 deletions

View File

@ -1,5 +1,5 @@
const FavoriteButton = {
props: ['status'],
props: ['status', 'loggedIn'],
data () {
return {
animated: false

View File

@ -1,6 +1,10 @@
<template>
<div>
<i :class='classes' class='favorite-button base09' @click.prevent='favorite()'/>
<div v-if="loggedIn">
<i :class='classes' class='favorite-button fav-active base09' @click.prevent='favorite()'/>
<span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
</div>
<div v-else>
<i :class='classes' class='favorite-button base09'/>
<span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
</div>
</template>
@ -8,7 +12,7 @@
<script src="./favorite_button.js" ></script>
<style lang='scss'>
.favorite-button {
.fav-active {
cursor: pointer;
animation-duration: 0.6s;
&:hover {

View File

@ -1,5 +1,5 @@
const RetweetButton = {
props: ['status'],
props: ['status', 'loggedIn'],
data () {
return {
animated: false

View File

@ -1,6 +1,10 @@
<template>
<div>
<i :class='classes' class='icon-retweet base09' v-on:click.prevent='retweet()'></i>
<div v-if="loggedIn">
<i :class='classes' class='icon-retweet rt-active base09' v-on:click.prevent='retweet()'></i>
<span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
</div>
<div v-else>
<i :class='classes' class='icon-retweet base09'></i>
<span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
</div>
</template>
@ -9,7 +13,7 @@
<style lang='scss'>
@import '../../_variables.scss';
.icon-retweet {
.rt-active {
cursor: pointer;
animation-duration: 0.6s;
&:hover {

View File

@ -105,20 +105,18 @@
</div>
</div>
<div v-if="loggedIn">
<div class='status-actions'>
<div>
<div v-if="loggedIn">
<a href="#" v-on:click.prevent="toggleReplying">
<i class="base09 icon-reply" :class="{'icon-reply-active': replying}"></i>
</a>
</div>
<retweet-button :status=status></retweet-button>
<favorite-button :status=status></favorite-button>
<retweet-button :loggedIn="loggedIn" :status=status></retweet-button>
<favorite-button :loggedIn="loggedIn" :status=status></favorite-button>
<delete-button :status=status></delete-button>
</div>
</div>
</div>
</div>
<div class="status base00-background container" v-if="replying">
<div class="reply-left"/>
<post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying"/>