New client many fixes (#8981)

* Footer style fixes

* Limited string display

* Fixed background reload

* Began adding more avatar items

* Fixed challenge updated cats and official to be seen by admins

* Fixed min prize

* Fixed required fields

* Added my challenges and find challenges to menu

* Removed nav to party page when have no party

* Updated user and notifications icon

* Added accept, reject and messages

* Added selfcare

* Underline links

* Added forgot password

* Fixed task adding

* Disabled habit options that should be

* Added markdown to tags

* Added confirm to delete

* Fixed cancel/delete style

* Fixed rounding

* Added gold icon

* Fixed task icon styles

* Fixed margin botton

* Fixed some repeat styles

* Fixed custom reward style

* Hide like count 0

* Added new tavern images

* Redirect to party page after create

* Hid leader options from non leaders

* Removed manager options from non group plan

* Fixed some nav styles

* Fixed overlay color

* Prevented edit data from being transfered to create

* Added hover state for spells

* Add performance fixes for chat avatars

* Fixed merge conflicts

* Updated fron navigation

* Fixed reg gryphon logo

* Began adding gem modal functionality

* Added purchase gems with gold

* Fixed restore

* Replaced description with summary

* Spells that target tasks fix

* Added initial challenge task load

* Fixed lint issue
This commit is contained in:
Keith Holliday
2017-08-22 21:58:13 -06:00
committed by GitHub
parent 69662f84df
commit f529a5c64c
42 changed files with 586 additions and 305 deletions

View File

@@ -34,9 +34,12 @@
.form-check(
v-for="group in categoryOptions",
:key="group.key",
v-if='group.key !== "habitica_official" || user.contributor.admin'
)
label.custom-control.custom-checkbox
input.custom-control-input(type="checkbox", :value="group.key" v-model="workingChallenge.categories")
input.custom-control-input(type="checkbox",
:value='group.key',
v-model="workingChallenge.categories")
span.custom-control-indicator
span.custom-control-description(v-once) {{ $t(group.label) }}
button.btn.btn-primary(@click.prevent="toggleCategorySelect") {{$t('close')}}
@@ -47,7 +50,7 @@
.form-group
label
strong(v-once) {{$t('prize')}}
input(type='number', min='1', :max='maxPrize', v-model="workingChallenge.prize")
input(type='number', :min='minPrize', :max='maxPrize', v-model="workingChallenge.prize")
.row.footer-wrap
.col-12.text-center.submit-button-wrapper
.alert.alert-warning(v-if='insufficientGemsForTavernChallenge')
@@ -220,6 +223,13 @@ export default {
if (this.challenge) {
Object.assign(this.workingChallenge, this.challenge);
this.workingChallenge.categories = [];
if (this.challenge.categories) {
this.challenge.categories.forEach(category => {
this.workingChallenge.categories.push(category.slug);
});
}
this.creating = false;
}
});
@@ -230,6 +240,7 @@ export default {
this.groups.push({
name: party.name,
_id: party._id,
privacy: 'private',
});
}
@@ -256,7 +267,13 @@ export default {
userBalance = userBalance * 4;
let groupBalance = 0;
let group = find(this.groups, { _id: this.workingChallenge.group });
let group;
this.groups.forEach(item => {
if (item._id === this.workingChallenge.group) {
group = item;
return;
}
});
if (group && group.balance && group.leader === this.user._id) {
groupBalance = group.balance * 4;
@@ -264,6 +281,18 @@ export default {
return userBalance + groupBalance;
},
minPrize () {
let groupFound;
this.groups.forEach(group => {
if (group._id === this.workingChallenge.group) {
groupFound = group;
return;
}
});
if (groupFound && groupFound.privacy === 'private') return 0;
return 1;
},
insufficientGemsForTavernChallenge () {
let balance = this.user.balance || 0;
let isForTavern = this.workingChallenge.group === TAVERN_ID;
@@ -320,6 +349,17 @@ export default {
}
},
updateChallenge () {
let categoryKeys = this.workingChallenge.categories;
let serverCategories = [];
categoryKeys.forEach(key => {
let catName = this.categoriesHashByKey[key];
serverCategories.push({
slug: key,
name: catName,
});
});
this.workingChallenge.categories = serverCategories;
this.$emit('updatedChallenge', {
challenge: this.workingChallenge,
});