Files
habitica/website/client/components/hall/patrons.vue
Keith Holliday 16b244d5c6 New client random catchup (#8891)
* Added initial challenge pages

* Added challenge item and find guilds page

* Added challenge detail

* Added challenge modals

* Ported over challenge service code

* Ported over challenge ctrl code

* Added styles and column

* Minor modal updates

* Removed duplicate keys

* Fixed casing

* Added initial chat component

* Added copy as todo modal

* Added sync

* Added chat to groups

* Fixed lint

* Added notification service

* Added tag services

* Added notifications

* Added hall

* Added analytics

* Added http interceptor

* Added initial autocomplete

* Added initial footer component

* Began coding and designing footer

* Added inital hall

* Ported over inital group plan ctrl code

* Added initial invite modal

* Added initial member detail modal

* Added initial notification menu

* Ported over inital notification code

* Fixed import line

* Fixed autocomplete import casing
2017-07-25 08:24:40 -06:00

54 lines
1.6 KiB
Vue

<template lang="pug">
.row
small.muted {{ $t('blurbHallPatrons') }}
.table-responsive
table.table.table-striped(infinite-scroll="loadMore()")
thead
tr
th {{ $t('name') }}
th(v-if='user.contributor.admin') {{ $t('UUID') }}
th {{ $t('backerTier') }}
tbody
tr(v-for='patron in patrons')
td
a.label.label-default(v-class='userLevelStyle(patron)', @click='clickMember(patron._id, true)')
| {{patron.profile.name}}
td(v-if='user.contributor.admin') {{patron._id}}
td {{patron.backer.tier}}
</template>
<script>
import { mapState } from 'client/libs/store';
export default {
data () {
return {
patrons: [],
};
},
async mounted () {
this.patrons = await this.$store.dispatch('hall:getPatrons', { page: 0 });
},
computed: {
...mapState({user: 'user.data'}),
},
methods: {
// @TODO: This is used to style usernames. WE should abstract this to helper mixer
userLevelStyle (user, style) {
style = style || '';
let npc = user && user.backer && user.backer.npc ? user.backer.npc : '';
let level = user && user.contributor && user.contributor.level ? user.contributor.level : '';
style += this.userLevelStyleFromLevel(level, npc, style);
return style;
},
userLevelStyleFromLevel (level, npc, style) {
style = style || '';
if (npc) style += ' label-npc';
if (level) style += ` label-contributor-${level}`;
return style;
},
//@TODO: Import member modal - clickMember()
},
};
</script>