2017-06-02 20:55:02 +00:00
|
|
|
|
<template lang="pug">
|
|
|
|
|
|
div
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.item-with-icon(@click="$root.$emit('show::modal','members-modal')")
|
|
|
|
|
|
.svg-icon.shield(v-html="icons.goldGuildBadgeIcon")
|
|
|
|
|
|
span.number {{group.memberCount}}
|
|
|
|
|
|
div(v-once) {{ $t('members') }}
|
2017-06-02 20:55:02 +00:00
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
b-modal#members-modal(:title="$t('createGuild')", size='lg')
|
2017-06-06 05:21:37 +00:00
|
|
|
|
.header-wrap(slot="modal-header")
|
|
|
|
|
|
.row
|
|
|
|
|
|
.col-6
|
2017-06-08 21:27:22 +00:00
|
|
|
|
h1(v-once) {{$t('members')}}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
.col-6
|
|
|
|
|
|
button(type="button" aria-label="Close" class="close")
|
|
|
|
|
|
span(aria-hidden="true") ×
|
|
|
|
|
|
.row
|
|
|
|
|
|
.form-group.col-6
|
|
|
|
|
|
input.form-control.search(type="text", :placeholder="$t('search')", v-model='searchTerm')
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.col-4.offset-2
|
2017-06-06 05:21:37 +00:00
|
|
|
|
span.dropdown-label {{ $t('sortBy') }}
|
|
|
|
|
|
b-dropdown(:text="$t('sort')", right=true)
|
2017-06-08 21:27:22 +00:00
|
|
|
|
b-dropdown-item(v-for='sortOption in sortOptions', @click='sort(sortOption.value)', :key='sortOption.value') {{sortOption.text}}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
.row(v-for='member in members', :key='member', )
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.col-8.offset-1
|
2017-06-27 20:02:55 +00:00
|
|
|
|
member-details(:member='member')
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.col-3.actions
|
2017-06-06 05:21:37 +00:00
|
|
|
|
b-dropdown(:text="$t('sort')", right=true)
|
2017-06-08 21:27:22 +00:00
|
|
|
|
b-dropdown-item(@click='sort(option.value)')
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.svg-icon(v-html="icons.removeIcon")
|
2017-06-08 21:27:22 +00:00
|
|
|
|
| {{$t('removeMember')}}
|
|
|
|
|
|
b-dropdown-item(@click='sort(option.value)')
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.svg-icon(v-html="icons.messageIcon")
|
2017-06-08 21:27:22 +00:00
|
|
|
|
| {{$t('sendMessage')}}
|
|
|
|
|
|
b-dropdown-item(@click='sort(option.value)')
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.svg-icon(v-html="icons.starIcon")
|
2017-06-08 21:27:22 +00:00
|
|
|
|
| {{$t('promoteToLeader')}}
|
|
|
|
|
|
b-dropdown-item(@click='sort(option.value)')
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.svg-icon(v-html="icons.starIcon")
|
2017-06-08 21:27:22 +00:00
|
|
|
|
| {{$t('addManager')}}
|
|
|
|
|
|
b-dropdown-item(@click='sort(option.value)')
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.svg-icon(v-html="icons.removeIcon")
|
2017-06-08 21:27:22 +00:00
|
|
|
|
| {{$t('removeManager2')}}
|
2017-06-27 20:02:55 +00:00
|
|
|
|
.row-fluid.gradient
|
2017-06-02 20:55:02 +00:00
|
|
|
|
|
|
|
|
|
|
b-modal#remove-member(:title="$t('confirmRemoveMember')")
|
|
|
|
|
|
button(@click='confirmRemoveMember(member)', v-once) {{$t('remove')}}
|
|
|
|
|
|
|
|
|
|
|
|
b-modal#private-message(:title="$t('confirmRemoveMember')")
|
|
|
|
|
|
button(@click='confirmRemoveMember(member)', v-once) {{$t('remove')}}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2017-06-27 20:02:55 +00:00
|
|
|
|
<style lang='scss' scoped>
|
2017-06-08 21:27:22 +00:00
|
|
|
|
header {
|
|
|
|
|
|
background-color: #edecee;
|
|
|
|
|
|
border-radius: 4px 4px 0 0;
|
|
|
|
|
|
}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.header-wrap {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
h1 {
|
|
|
|
|
|
color: #4f2a93;
|
|
|
|
|
|
}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.actions {
|
|
|
|
|
|
padding-top: 5em;
|
2017-06-06 05:21:37 +00:00
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
.action-icon {
|
|
|
|
|
|
margin-right: 1em;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-06-27 20:02:55 +00:00
|
|
|
|
|
|
|
|
|
|
#members-modal_modal_body {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
.col-8 {
|
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.member-details {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.member-stats {
|
|
|
|
|
|
width: 382px;
|
|
|
|
|
|
height: 147px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.gradient {
|
|
|
|
|
|
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
|
|
|
|
|
|
height: 200px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.item-with-icon {
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
|
|
|
|
|
|
padding: 1em;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.svg-icon.shield, .svg-icon.gem {
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
margin-right: 1em;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.number {
|
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
}
|
2017-06-06 05:21:37 +00:00
|
|
|
|
</style>
|
|
|
|
|
|
|
2017-06-02 20:55:02 +00:00
|
|
|
|
<script>
|
|
|
|
|
|
import bModal from 'bootstrap-vue/lib/components/modal';
|
2017-06-06 05:21:37 +00:00
|
|
|
|
import bDropdown from 'bootstrap-vue/lib/components/dropdown';
|
|
|
|
|
|
import bDropdownItem from 'bootstrap-vue/lib/components/dropdown-item';
|
|
|
|
|
|
|
2017-06-08 21:36:56 +00:00
|
|
|
|
import MemberDetails from '../memberDetails';
|
2017-06-27 20:02:55 +00:00
|
|
|
|
import removeIcon from 'assets/members/remove.svg';
|
|
|
|
|
|
import messageIcon from 'assets/members/message.svg';
|
|
|
|
|
|
import starIcon from 'assets/members/star.svg';
|
|
|
|
|
|
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge.svg';
|
2017-06-02 20:55:02 +00:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
props: ['group'],
|
|
|
|
|
|
components: {
|
|
|
|
|
|
bModal,
|
2017-06-06 05:21:37 +00:00
|
|
|
|
bDropdown,
|
|
|
|
|
|
bDropdownItem,
|
2017-06-08 21:36:56 +00:00
|
|
|
|
MemberDetails,
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
created () {
|
|
|
|
|
|
this.getMembers();
|
|
|
|
|
|
},
|
2017-06-02 20:55:02 +00:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2017-06-08 21:27:22 +00:00
|
|
|
|
members: [],
|
2017-06-02 20:55:02 +00:00
|
|
|
|
memberToRemove: '',
|
2017-06-08 21:27:22 +00:00
|
|
|
|
sortOptions: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'tier',
|
|
|
|
|
|
text: this.$t('tier'),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'name',
|
|
|
|
|
|
text: this.$t('name'),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'level',
|
|
|
|
|
|
text: this.$t('level'),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 'class',
|
|
|
|
|
|
text: this.$t('class'),
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
searchTerm: '',
|
2017-06-27 20:02:55 +00:00
|
|
|
|
icons: Object.freeze({
|
|
|
|
|
|
removeIcon,
|
|
|
|
|
|
messageIcon,
|
|
|
|
|
|
starIcon,
|
|
|
|
|
|
goldGuildBadgeIcon,
|
|
|
|
|
|
}),
|
2017-06-02 20:55:02 +00:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async getMembers () {
|
|
|
|
|
|
let members = await this.$store.dispatch('members:getGroupMembers', {
|
|
|
|
|
|
groupId: this.group._id,
|
|
|
|
|
|
includeAllPublicFields: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
this.members = members;
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async clickMember (uid, forceShow) {
|
2017-06-02 20:55:02 +00:00
|
|
|
|
let user = this.$store.state.user.data;
|
|
|
|
|
|
|
|
|
|
|
|
if (user._id === uid && !forceShow) {
|
|
|
|
|
|
if (this.$route.name === 'tasks') {
|
|
|
|
|
|
this.$route.router.go('options.profile.avatar');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.$route.router.go('tasks');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-06-08 21:27:22 +00:00
|
|
|
|
await this.$store.dispatch('members:selectMember', {
|
|
|
|
|
|
memberId: uid,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.$root.$emit('show::modal', 'members-modal');
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async removeMember (member) {
|
2017-06-02 20:55:02 +00:00
|
|
|
|
this.memberToRemove = member;
|
|
|
|
|
|
this.$root.$emit('show::modal', 'remove-member');
|
|
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async confirmRemoveMember (confirmation) {
|
2017-06-02 20:55:02 +00:00
|
|
|
|
if (!confirmation) {
|
|
|
|
|
|
this.memberToRemove = '';
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2017-06-08 21:27:22 +00:00
|
|
|
|
|
|
|
|
|
|
await this.$store.dispatch('members:removeMember', {
|
|
|
|
|
|
memberId: this.memberToRemove._id,
|
|
|
|
|
|
groupId: this.group._id,
|
|
|
|
|
|
message: this.removeMessage,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.memberToRemove = '';
|
|
|
|
|
|
this.removeMessage = '';
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async quickReply (uid) {
|
2017-06-02 20:55:02 +00:00
|
|
|
|
this.memberToReply = uid;
|
2017-06-08 21:27:22 +00:00
|
|
|
|
await this.$store.dispatch('members:selectMember', {
|
|
|
|
|
|
memberId: uid,
|
|
|
|
|
|
});
|
|
|
|
|
|
this.$root.$emit('show::modal', 'private-message'); // MemberModalCtrl
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async addManager (memberId) {
|
|
|
|
|
|
await this.$store.dispatch('group:addManager', {
|
|
|
|
|
|
memberId,
|
|
|
|
|
|
});
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
2017-06-08 21:27:22 +00:00
|
|
|
|
async removeManager (memberId) {
|
|
|
|
|
|
await this.$store.dispatch('group:removeManager', {
|
|
|
|
|
|
memberId,
|
|
|
|
|
|
});
|
2017-06-02 20:55:02 +00:00
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|