mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Client fixed sept 4 (#9019)
* Fixed background purchasing * Added challenge export * Fixed is leader filter * Fixed staff icon * Add block to profile modal * Added initial send gems modal * Added modal stack * Fixed lint issues * Updated notification styles * Updated level up styles * Fixed many achievement styles * Fixed notification navigate to same route with different param * Added mark chat seen and remove new messages * Added scroll to notifications * Updated hall loading
This commit is contained in:
@@ -4,6 +4,15 @@ div
|
||||
.row
|
||||
.col-6.offset-3
|
||||
button.btn.btn-secondary(@click='sendMessage()') Message
|
||||
button.btn.btn-secondary(v-if='userLoggedIn.inbox.blocks.indexOf(user._id) === -1', :tooltip="$t('unblock')",
|
||||
@click="blockUser()", tooltip-placement='right')
|
||||
span.glyphicon.glyphicon-plus
|
||||
| {{$t('block')}}
|
||||
button.btn.btn-secondary(v-if='user._id !== this.userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) !== -1',
|
||||
:tooltip="$t('unblock')", @click="unblockUser()", tooltip-placement='right')
|
||||
span.glyphicon.glyphicon-ban-circle
|
||||
| {{$t('unblock')}}
|
||||
button.btn.btn-secondary(@click='openSendGemsModal()') {{ $t('sendGems') }}
|
||||
.row
|
||||
.col-6.offset-3.text-center.nav
|
||||
.nav-item(@click='selectedPage = "profile"', :class="{active: selectedPage === 'profile'}") Profile
|
||||
@@ -255,6 +264,7 @@ div
|
||||
button.btn.btn-primary(popover-trigger='mouseenter', popover-placement='right',
|
||||
:popover='$t(statInfo.allocatepop)') +
|
||||
private-message-modal(:userIdToMessage='userIdToMessage')
|
||||
send-gems-modal(:userReceivingGems='userReceivingGems')
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -322,6 +332,7 @@ div
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import each from 'lodash/each';
|
||||
import { mapState } from 'client/libs/store';
|
||||
@@ -333,6 +344,7 @@ import autoAllocate from '../../../common/script/fns/autoAllocate';
|
||||
import allocate from '../../../common/script/ops/allocate';
|
||||
|
||||
import privateMessageModal from 'client/components/private-message-modal';
|
||||
import sendGemsModal from 'client/components/payments/sendGemsModal';
|
||||
import markdown from 'client/directives/markdown';
|
||||
import achievementsLib from '../../../common/script/libs/achievements';
|
||||
// @TODO: EMAILS.COMMUNITY_MANAGER_EMAIL
|
||||
@@ -348,10 +360,12 @@ export default {
|
||||
components: {
|
||||
bModal,
|
||||
privateMessageModal,
|
||||
sendGemsModal,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
userIdToMessage: '',
|
||||
userReceivingGems: '',
|
||||
editing: false,
|
||||
editingProfile: {
|
||||
name: '',
|
||||
@@ -536,6 +550,19 @@ export default {
|
||||
allocateNow () {
|
||||
autoAllocate(this.user);
|
||||
},
|
||||
blockUser () {
|
||||
this.userLoggedIn.inbox.blocks.push(this.user._id);
|
||||
axios.post(`/api/v3/user/block/${this.user._id}`);
|
||||
},
|
||||
unblockUser () {
|
||||
let index = this.userLoggedIn.inbox.blocks.indexOf(this.user._id);
|
||||
this.userLoggedIn.inbox.blocks.splice(index, 1);
|
||||
axios.post(`/api/v3/user/block/${this.user._id}`);
|
||||
},
|
||||
openSendGemsModal () {
|
||||
this.userReceivingGems = this.user;
|
||||
this.$root.$emit('show::modal', 'send-gems');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user