New client misc with some more misc (#8929)

* Added markdown

* Added styles and option for debug menu

* Added sm icons

* Began styling autocomplete

* Added autocomplete styles

* Added more challenge categories

* Updated challenge participants modal

* Fixed challenge list updating without reload

* Added close and delete challenge

* Fixed form placeholder, adjusted desc style and fixed create button style

* Fixed faq collapsing and style

* Fixed repeating ending

* Fixed delete account

* Fixed party fetch issue

* Fixed scope issue

* Added member count filters

* Fixed create button style

* Fixed badge color display

* Updated tavern styles

* Fixed some party styles

* Updated login styles

* Fixed login redirect

* Fixed initial login process

* Added done local
This commit is contained in:
Keith Holliday
2017-08-07 14:26:17 -06:00
committed by GitHub
parent 1896984777
commit 0b076311df
46 changed files with 671 additions and 206 deletions
@@ -1,7 +1,7 @@
<template lang="pug">
.row
challenge-modal(:challenge='challenge', v-on:updatedChallenge='updatedChallenge')
close-challenge-modal
close-challenge-modal(:members='members', :challengeId='challenge._id')
.col-8.standard-page
.row
@@ -39,10 +39,9 @@
div(v-if='isMember')
button.btn.btn-danger(v-once, @click='leaveChallenge()') {{$t('leaveChallenge')}}
div(v-if='isLeader')
b-dropdown(:text="$t('create')")
b-dropdown.create-dropdown(:text="$t('create')")
b-dropdown-item(v-for="type in columns", :key="type", @click="createTask(type)")
| {{$t(type)}}
//- button.btn.btn-success(v-once) {{$t('addTask')}}
task-modal(
:task="workingTask",
:purpose="taskFormPurpose",
@@ -129,6 +128,7 @@
div, button {
width: 60%;
margin: 0 auto;
margin-bottom: .5em;
text-align: center;
}
}
@@ -138,6 +138,14 @@
}
</style>
<style>
.create-dropdown button {
width: 100%;
font-size: 16px !important;
font-weight: bold !important;
}
</style>
<script>
import Vue from 'vue';
import bDropdown from 'bootstrap-vue/lib/components/dropdown';
@@ -220,7 +228,7 @@ export default {
createTask (type) {
this.taskFormPurpose = 'create';
this.creatingTask = taskDefaults({type, text: ''});
this.workingTask = this.editingTask;
this.workingTask = this.creatingTask;
// Necessary otherwise the first time the modal is not rendered
Vue.nextTick(() => {
this.$root.$emit('show::modal', 'task-modal');
@@ -240,6 +248,7 @@ export default {
this.tasksByType[task.type].splice(index, 1, task);
},
showMemberModal () {
this.$store.state.groupId = 'challenge'; // @TODO: change these terrible settings
this.$store.state.viewingMembers = this.members;
this.$root.$emit('show::modal', 'members-modal');
},
@@ -106,6 +106,7 @@
color: $gray-200;
margin-top: 2em;
margin-bottom: 2em;
overflow: hidden;
}
.well-wrapper {
@@ -8,7 +8,7 @@
.form-group
label
strong(v-once) {{$t('shortName')}}*
b-form-input(type="text", :placeholder="$t('challengeNamePlaceHolder')", v-model="workingChallenge.shortName")
b-form-input(type="text", :placeholder="$t('shortNamePlaceholder')", v-model="workingChallenge.shortName")
.form-group
label
strong(v-once) {{$t('description')}}*
@@ -110,7 +110,8 @@
}
.category-box {
top: -40px !important;
top: -120px !important;
z-index: 10;
}
}
</style>
@@ -134,49 +135,101 @@ export default {
},
data () {
let categoryOptions = [
{
label: 'Habitica Official',
key: 'habitica_official',
},
{
label: 'Academic',
key: 'academic',
},
{
label: 'Accountability',
key: 'accountability',
},
{
label: 'Advocacy & Causes',
key: 'advocacy_causes',
},
{
label: 'animals',
key: 'animals',
},
{
label: 'artDesign',
key: 'art_design',
label: 'Creativity',
key: 'creativity',
},
{
label: 'booksWriting',
key: 'books_writing',
label: 'Entertainment & Fandom',
key: 'entertainment_fandom',
},
{
label: 'comicsHobbies',
key: 'comics_hobbies',
label: 'Finance',
key: 'finance',
},
{
label: 'diyCrafts',
key: 'diy_crafts',
},
{
label: 'education',
key: 'education',
},
{
label: 'foodCooking',
label: 'Food & Cooking',
key: 'food_cooking',
},
{
label: 'healthFitness',
label: 'Games & Gaming',
key: 'games_gaming',
},
{
label: 'Health + Fitness',
key: 'health_fitness',
},
{
label: 'music',
key: 'music',
label: 'Hobbies',
key: 'hobbies',
},
{
label: 'relationship',
key: 'relationship',
label: 'Language & Literature',
key: 'language_literature',
},
{
label: 'scienceTech',
key: 'science_tech ',
label: 'Location-based',
key: 'location_based',
},
{
label: 'Mental Health',
key: 'mental_health ',
},
{
label: 'Occupations',
key: 'occupations ',
},
{
label: 'Online Communities',
key: 'online_communities ',
},
{
label: 'Getting Organized',
key: 'getting_organized ',
},
{
label: 'Recovery',
key: 'recovery ',
},
{
label: 'Role-Play',
key: 'role_play ',
},
{
label: 'Self-Care',
key: 'self_care ',
},
{
label: 'Self-Improvement',
key: 'self_improvement ',
},
{
label: 'Spirituality',
key: 'spirituality ',
},
{
label: 'Time-Management',
key: 'time_management',
},
];
let hashedCategories = {};
@@ -205,11 +258,13 @@ export default {
});
this.groups = await this.$store.dispatch('guilds:getMyGuilds');
let party = await this.$store.dispatch('guilds:getGroup', {groupId: 'party'});
this.groups.push({
name: party.name,
_id: party._id,
});
if (this.user.party._id) {
let party = await this.$store.dispatch('guilds:getGroup', {groupId: 'party'});
this.groups.push({
name: party.name,
_id: party._id,
});
}
this.groups.push({
name: 'Public',
@@ -10,11 +10,10 @@ div
.col-12
strong(v-once) {{$t('selectChallengeWinnersDescription')}}
.col-12
b-dropdown(:text="$t('sort')", right=true)
b-dropdown-item(@click='sort(option.value)')
| Member
select.form-control(v-model='winnerId')
option(v-for='member in members', :value='member._id') {{member.profile.name}}
.col-12
button.btn.btn-primary(v-once) {{$t('awardWinners')}}
button.btn.btn-primary(v-once, @click='closeChallenge') {{$t('awardWinners')}}
.col-12
hr
.or {{$t('or')}}
@@ -78,26 +77,29 @@ import bDropdown from 'bootstrap-vue/lib/components/dropdown';
import bDropdownItem from 'bootstrap-vue/lib/components/dropdown-item';
export default {
props: ['challenge'],
props: ['challengeId', 'members'],
components: {
bModal,
bDropdown,
bDropdownItem,
},
data () {
return {
winnerId: '',
};
},
methods: {
closeChallenge () {
// this.challenge = this.$store.dispatch('challenges:selectChallengeWinner', {
// challengeId: this.challengeId,
// winnerId: this.winnerId,
// });
async closeChallenge () {
this.challenge = await this.$store.dispatch('challenges:selectChallengeWinner', {
challengeId: this.challengeId,
winnerId: this.winnerId,
});
this.$router.push('/challenges/myChallenges');
},
deleteChallenge () {
// this.challenge = this.$store.dispatch('challenges:deleteChallenge', {challengeId: this.challengeId});
async deleteChallenge () {
if (!confirm('Are you sure you want to delete this challenge?')) return;
this.challenge = await this.$store.dispatch('challenges:deleteChallenge', {challengeId: this.challengeId});
this.$router.push('/challenges/myChallenges');
},
},
};
@@ -1,6 +1,6 @@
<template lang="pug">
.row
challenge-modal
challenge-modal(v-on:createChallenge='challengeCreated')
sidebar(v-on:search="updateSearch", v-on:filter="updateFilters")
.col-10.standard-page
@@ -127,6 +127,9 @@ export default {
async loadchallanges () {
this.challenges = await this.$store.dispatch('challenges:getUserChallenges');
},
challengeCreated (challenge) {
this.challenges.push(challenge);
},
},
};
</script>
@@ -7,7 +7,7 @@ div
h4(v-once) {{ $t('haveNoChallenges') }}
p(v-once) {{ $t('challengeDescription') }}
button.btn.btn-secondary(v-once, @click='createChallenge()') {{ $t('createChallenge') }}
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }", v-for='challenge in challenges')
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }", v-for='challenge in challenges',:key='challenge._id')
.col-12.challenge-item
.row
.col-9
@@ -26,7 +26,7 @@ div
button.btn.btn-secondary(@click='createChallenge()') {{ $t('createChallenge') }}
</template>
<style>
<style scoped>
.title {
color: #4E4A57;
}
@@ -1,6 +1,6 @@
<template lang="pug">
.row
challenge-modal
challenge-modal(v-on:createChallenge='challengeCreated')
sidebar(v-on:search="updateSearch", v-on:filter="updateFilters")
.col-10.standard-page
@@ -151,6 +151,9 @@ export default {
async loadchallanges () {
this.challenges = await this.$store.dispatch('challenges:getUserChallenges');
},
challengeCreated (challenge) {
this.challenges.push(challenge);
},
},
};
</script>
@@ -46,24 +46,100 @@ export default {
categoryFilters: [],
categoryOptions: [
{
label: 'habiticaOfficial',
key: 'official',
label: 'Habitica Official',
key: 'habitica_official',
},
{
label: 'Academic',
key: 'academic',
},
{
label: 'Accountability',
key: 'accountability',
},
{
label: 'Advocacy & Causes',
key: 'advocacy_causes',
},
{
label: 'animals',
key: 'animals',
},
{
label: 'artDesign',
key: 'art_design',
label: 'Creativity',
key: 'creativity',
},
{
label: 'booksWriting',
key: 'books_writing',
label: 'Entertainment & Fandom',
key: 'entertainment_fandom',
},
{
label: 'comicsHobbies',
key: 'comics_hobbies',
label: 'Finance',
key: 'finance',
},
{
label: 'Food & Cooking',
key: 'food_cooking',
},
{
label: 'Games & Gaming',
key: 'games_gaming',
},
{
label: 'Health + Fitness',
key: 'health_fitness',
},
{
label: 'Hobbies',
key: 'hobbies',
},
{
label: 'Language & Literature',
key: 'language_literature',
},
{
label: 'Location-based',
key: 'location_based',
},
{
label: 'Mental Health',
key: 'mental_health ',
},
{
label: 'Occupations',
key: 'occupations ',
},
{
label: 'Online Communities',
key: 'online_communities ',
},
{
label: 'Getting Organized',
key: 'getting_organized ',
},
{
label: 'Recovery',
key: 'recovery ',
},
{
label: 'Role-Play',
key: 'role_play ',
},
{
label: 'Self-Care',
key: 'self_care ',
},
{
label: 'Self-Improvement',
key: 'self_improvement ',
},
{
label: 'Spirituality',
key: 'spirituality ',
},
{
label: 'Time-Management',
key: 'time_management',
},
],
roleFilters: [],