Files
habitica/website/client/components/challenges/sidebar.vue
Keith Holliday a317b351be Sept 23 fixes (#9074)
* Discover challenges

* Fixed hero loading

* Moved add task button

* Fixed bailey showing

* Added logs for bad sub data

* Fixed blurb editing

* Added confirmation for deleteing message

* Reset invite modals on invite

* fixed group member sorting

* Fixed chat time styles

* Fixed hover on liked

* Fixed like count

* Added reverse

* Fixed editing party

* Added leader conditions

* Added search

* Added loading

* Reset members when leaving party

* Rounded pending

* Fixed overflow on collecting quests

* Added to invite friends

* Hid summary from party

* Fixed button styles

* Fixed button class

* Removed okay button

* Fixed renav for profile modal

* Added subscription back to menu

* Fixed static link

* Added daily due setting

* Added local auth adding

* Fixed centering of text

* Removed message locally

* Added count for new message

* Added style fix for profile pet

* Fixed achievement popovers

* Fixed white boxes

* Added plain color backgrounds

* fixed challenge mutability

* Fixed challenge editing

* Added notation for large numbers

* Add color text to guild sizes

* Removed membership filters from discover challenges

* Added invites to group

* Cmd + enter send message

* Made leader clickable

* Updated group validation

* Added cancelling autocomplete

* Added mention icon

* Added removing member

* Removed extra string
2017-09-25 13:02:12 -05:00

165 lines
4.0 KiB
Vue

<template lang="pug">
.col-2.standard-sidebar
.form-group
input.form-control.search(type="text", :placeholder="$t('search')", v-model='searchTerm')
form
h2(v-once) {{ $t('filter') }}
.form-group
h3 Category
.form-check(
v-for="group in categoryOptions",
:key="group.key",
)
label.custom-control.custom-checkbox
input.custom-control-input(type="checkbox", :value='group.key' v-model="categoryFilters")
span.custom-control-indicator
span.custom-control-description(v-once) {{ $t(group.label) }}
.form-group(v-if='$route.name !== "findChallenges"')
h3 Membership
.form-check(
v-for="group in roleOptions",
:key="group.key",
)
label.custom-control.custom-checkbox
input.custom-control-input(type="checkbox", :value='group.key' v-model="roleFilters")
span.custom-control-indicator
span.custom-control-description(v-once) {{ $t(group.label) }}
.form-group
h3 Ownership
.form-check(
v-for="group in ownershipOptions",
:key="group.key",
)
label.custom-control.custom-checkbox
input.custom-control-input(type="checkbox", :value='group.key' v-model="ownershipFilters")
span.custom-control-indicator
span.custom-control-description(v-once) {{ $t(group.label) }}
</template>
<script>
import throttle from 'lodash/throttle';
export default {
data () {
return {
categoryFilters: [],
categoryOptions: [
{
label: 'habitica_official',
key: 'habitica_official',
},
{
label: 'academics',
key: 'academics',
},
{
label: 'advocacy_causes',
key: 'advocacy_causes',
},
{
label: 'creativity',
key: 'creativity',
},
{
label: 'entertainment',
key: 'entertainment',
},
{
label: 'finance',
key: 'finance',
},
{
label: 'health_fitness',
key: 'health_fitness',
},
{
label: 'hobbies_occupations',
key: 'hobbies_occupations',
},
{
label: 'location_based',
key: 'location_based',
},
{
label: 'mental_health',
key: 'mental_health ',
},
{
label: 'getting_organized',
key: 'getting_organized ',
},
{
label: 'self_improvement',
key: 'self_improvement ',
},
{
label: 'spirituality',
key: 'spirituality ',
},
{
label: 'time_management',
key: 'time_management',
},
],
roleFilters: [],
roleOptions: [
{
label: 'participating',
key: 'participating',
},
{
label: 'not_participating',
key: 'not_participating',
},
// {
// label: 'either',
// key: 'either',
// },
],
ownershipFilters: [],
ownershipOptions: [
{
label: 'owned',
key: 'owned',
},
{
label: 'not_owned',
key: 'not_owned',
},
// {
// label: 'either',
// key: 'either',
// },
],
searchTerm: '',
};
},
watch: {
categoryFilters: function categoryFilters () {
this.emitFilters();
},
roleFilters: function roleFilters () {
this.emitFilters();
},
ownershipFilters: function ownershipFilters () {
this.emitFilters();
},
searchTerm: throttle(function searchTerm (newSearch) {
this.$emit('search', {
searchTerm: newSearch,
});
}, 250),
},
methods: {
emitFilters () {
this.$emit('filter', {
categories: this.categoryFilters,
roles: this.roleFilters,
ownership: this.ownershipFilters,
});
},
},
};
</script>