mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
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:
@@ -4,11 +4,11 @@
|
||||
.form-group
|
||||
label
|
||||
strong(v-once) {{$t('name')}} *
|
||||
b-form-input(type="text", :placeholder="$t('newGuildPlaceholder')", v-model="workingGuild.name")
|
||||
.form-group(v-if='workingGuild.id && members.length > 0')
|
||||
b-form-input(type="text", :placeholder="$t('newGuildPlaceholder')", v-model="workingGroup.name")
|
||||
.form-group(v-if='workingGroup.id && members.length > 0')
|
||||
label
|
||||
strong(v-once) {{$t('guildOrPartyLeader')}} *
|
||||
select.form-control(v-model="workingGuild.newLeader")
|
||||
select.form-control(v-model="workingGroup.newLeader")
|
||||
option(v-for='member in members', :value="member._id") {{ member.profile.name }}
|
||||
|
||||
.form-group
|
||||
@@ -16,7 +16,7 @@
|
||||
strong(v-once) {{$t('privacySettings')}} *
|
||||
br
|
||||
label.custom-control.custom-checkbox
|
||||
input.custom-control-input(type="checkbox", v-model="workingGuild.onlyLeaderCreatesChallenges")
|
||||
input.custom-control-input(type="checkbox", v-model="workingGroup.onlyLeaderCreatesChallenges")
|
||||
span.custom-control-indicator
|
||||
span.custom-control-description(v-once) {{ $t('onlyLeaderCreatesChallenges') }}
|
||||
b-tooltip.icon(:content="$t('privateDescription')")
|
||||
@@ -24,13 +24,13 @@
|
||||
|
||||
// br
|
||||
// @TODO Implement in V2 label.custom-control.custom-checkbox
|
||||
input.custom-control-input(type="checkbox", v-model="workingGuild.guildLeaderCantBeMessaged")
|
||||
input.custom-control-input(type="checkbox", v-model="workingGroup.guildLeaderCantBeMessaged")
|
||||
span.custom-control-indicator
|
||||
span.custom-control-description(v-once) {{ $t('guildLeaderCantBeMessaged') }}
|
||||
|
||||
br
|
||||
label.custom-control.custom-checkbox(v-if='!isParty')
|
||||
input.custom-control-input(type="checkbox", v-model="workingGuild.privateGuild")
|
||||
input.custom-control-input(type="checkbox", v-model="workingGroup.privateGuild")
|
||||
span.custom-control-indicator
|
||||
span.custom-control-description(v-once) {{ $t('privateGuild') }}
|
||||
b-tooltip.icon(:content="$t('privateDescription')")
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// br
|
||||
// @TODO: Implement in v2 label.custom-control.custom-checkbox(v-if='!creatingParty')
|
||||
input.custom-control-input(type="checkbox", v-model="workingGuild.allowGuildInvationsFromNonMembers")
|
||||
input.custom-control-input(type="checkbox", v-model="workingGroup.allowGuildInvationsFromNonMembers")
|
||||
span.custom-control-indicator
|
||||
span.custom-control-description(v-once) {{ $t('allowGuildInvationsFromNonMembers') }}
|
||||
|
||||
@@ -46,16 +46,16 @@
|
||||
label
|
||||
strong(v-once) {{$t('guildSummary')}} *
|
||||
div.summary-count {{charactersRemaining}} {{ $t('charactersRemaining') }}
|
||||
textarea.form-control.summary-textarea(:placeholder="$t('guildSummaryPlaceholder')", v-model="workingGuild.summary")
|
||||
textarea.form-control.summary-textarea(:placeholder="isParty ? $t('partyDescriptionPlaceHolder') : $t('guildSummaryPlaceholder')", v-model="workingGroup.summary")
|
||||
// @TODO: need summary only for PUBLIC GUILDS, not for tavern, private guilds, or party
|
||||
|
||||
.form-group
|
||||
label
|
||||
strong(v-once) {{$t('groupDescription')}} *
|
||||
a.float-right {{ $t('markdownFormattingHelp') }}
|
||||
b-form-input.description-textarea(type="text", textarea, :placeholder="creatingParty ? $t('partyDescriptionPlaceholder') : $t('guildDescriptionPlaceholder')", v-model="workingGuild.description")
|
||||
b-form-input.description-textarea(type="text", textarea, :placeholder="isParty ? $t('partyDescriptionPlaceholder') : $t('guildDescriptionPlaceholder')", v-model="workingGroup.description")
|
||||
|
||||
.form-group(v-if='creatingParty && !workingGuild.id')
|
||||
.form-group(v-if='creatingParty && !workingGroup.id')
|
||||
span
|
||||
toggleSwitch(:label="$t('inviteMembersNow')", v-model='inviteMembers')
|
||||
|
||||
@@ -63,21 +63,21 @@
|
||||
label
|
||||
strong(v-once) {{$t('categories')}} *
|
||||
div.category-wrap(@click.prevent="toggleCategorySelect")
|
||||
span.category-select(v-if='workingGuild.categories.length === 0') {{$t('none')}}
|
||||
.category-label(v-for='category in workingGuild.categories') {{$t(categoriesHashByKey[category])}}
|
||||
span.category-select(v-if='workingGroup.categories.length === 0') {{$t('none')}}
|
||||
.category-label(v-for='category in workingGroup.categories') {{$t(categoriesHashByKey[category])}}
|
||||
.category-box(v-if="showCategorySelect")
|
||||
.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="workingGuild.categories")
|
||||
input.custom-control-input(type="checkbox", :value="group.key", v-model="workingGroup.categories")
|
||||
span.custom-control-indicator
|
||||
span.custom-control-description(v-once) {{ $t(group.label) }}
|
||||
button.btn.btn-primary(@click.prevent="toggleCategorySelect") {{$t('close')}}
|
||||
// @TODO: need categories only for PUBLIC GUILDS, not for tavern, private guilds, or party
|
||||
|
||||
.form-group(v-if='inviteMembers && !workingGuild.id')
|
||||
.form-group(v-if='inviteMembers && !workingGroup.id')
|
||||
label
|
||||
strong(v-once) Invite via Email or User ID
|
||||
p(v-once) {{$t('inviteMembersHowTo')}} *
|
||||
@@ -91,12 +91,12 @@
|
||||
button(@click.prevent='addMemberToInvite()') Add
|
||||
|
||||
.form-group.text-center
|
||||
div.item-with-icon(v-if='!this.workingGuild.id')
|
||||
div.item-with-icon(v-if='!this.workingGroup.id')
|
||||
.svg-icon(v-html="icons.gem")
|
||||
span.count 4
|
||||
button.btn.btn-primary.btn-md(v-if='!workingGuild.id', :disabled='!workingGuild.name || !workingGuild.description') {{ creatingParty ? $t('createParty') : $t('createGuild') }}
|
||||
button.btn.btn-primary.btn-md(v-if='workingGuild.id', :disabled='!workingGuild.name || !workingGuild.description') {{ isParty ? $t('updateParty') : $t('updateGuild') }}
|
||||
.gem-description(v-once, v-if='!this.workingGuild.id') {{ $t('guildGemCostInfo') }}
|
||||
button.btn.btn-primary.btn-md(v-if='!workingGroup.id', :disabled='!workingGroup.name || !workingGroup.description') {{ creatingParty ? $t('createParty') : $t('createGuild') }}
|
||||
button.btn.btn-primary.btn-md(v-if='workingGroup.id', :disabled='!workingGroup.name || !workingGroup.description') {{ isParty ? $t('updateParty') : $t('updateGuild') }}
|
||||
.gem-description(v-once, v-if='!this.workingGroup.id') {{ $t('guildGemCostInfo') }}
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
let data = {
|
||||
workingGuild: {
|
||||
workingGroup: {
|
||||
id: '',
|
||||
name: '',
|
||||
type: 'guild',
|
||||
@@ -286,25 +286,34 @@ export default {
|
||||
// @TODO: do we need this? Maybe us computed. If we need, then make it on show a specific modal
|
||||
this.$root.$on('shown::modal', () => {
|
||||
let editingGroup = this.$store.state.editingGroup;
|
||||
if (!editingGroup._id) return;
|
||||
this.workingGuild.name = editingGroup.name;
|
||||
this.workingGuild.type = editingGroup.type;
|
||||
this.workingGuild.privacy = editingGroup.privacy;
|
||||
if (editingGroup.summary) this.workingGuild.summary = editingGroup.summary;
|
||||
if (editingGroup.description) this.workingGuild.description = editingGroup.description;
|
||||
if (editingGroup._id) this.workingGuild.id = editingGroup._id;
|
||||
if (editingGroup.leader._id) this.workingGuild.newLeader = editingGroup.leader._id;
|
||||
if (!editingGroup._id) {
|
||||
this.resetWorkingGroup();
|
||||
return;
|
||||
}
|
||||
|
||||
this.workingGroup.name = editingGroup.name;
|
||||
this.workingGroup.type = editingGroup.type;
|
||||
|
||||
this.workingGroup.privateGuild = true;
|
||||
if (editingGroup.privacy === 'public') {
|
||||
this.workingGroup.privateGuild = false;
|
||||
}
|
||||
|
||||
if (editingGroup.summary) this.workingGroup.summary = editingGroup.summary;
|
||||
if (editingGroup.description) this.workingGroup.description = editingGroup.description;
|
||||
if (editingGroup._id) this.workingGroup.id = editingGroup._id;
|
||||
if (editingGroup.leader._id) this.workingGroup.newLeader = editingGroup.leader._id;
|
||||
if (editingGroup._id) this.getMembers();
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
charactersRemaining () {
|
||||
let currentLength = this.workingGuild.summary ? this.workingGuild.summary.length : 0;
|
||||
let currentLength = this.workingGroup.summary ? this.workingGroup.summary.length : 0;
|
||||
return MAX_SUMMARY_SIZE_FOR_GUILDS - currentLength;
|
||||
},
|
||||
title () {
|
||||
if (this.creatingParty) return this.$t('createParty');
|
||||
if (!this.workingGuild.id) return this.$t('createGuild');
|
||||
if (!this.workingGroup.id) return this.$t('createGuild');
|
||||
if (this.isParty) return this.$t('updateParty');
|
||||
return this.$t('updateGuild');
|
||||
},
|
||||
@@ -312,14 +321,14 @@ export default {
|
||||
return this.$store.state.groupFormOptions.createParty;
|
||||
},
|
||||
isParty () {
|
||||
return this.workingGuild.type === 'party';
|
||||
return this.workingGroup.type === 'party';
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async getMembers () {
|
||||
if (!this.workingGuild.id) return;
|
||||
if (!this.workingGroup.id) return;
|
||||
let members = await this.$store.dispatch('members:getGroupMembers', {
|
||||
groupId: this.workingGuild.id,
|
||||
groupId: this.workingGroup.id,
|
||||
includeAllPublicFields: true,
|
||||
});
|
||||
this.members = members;
|
||||
@@ -339,51 +348,51 @@ export default {
|
||||
this.showCategorySelect = !this.showCategorySelect;
|
||||
},
|
||||
async submit () {
|
||||
if (this.$store.state.user.data.balance < 1 && !this.workingGuild.id) {
|
||||
if (this.$store.state.user.data.balance < 1 && !this.workingGroup.id) {
|
||||
// @TODO: Add proper notifications
|
||||
alert('Not enough gems');
|
||||
return;
|
||||
// @TODO return $rootScope.openModal('buyGems', {track:"Gems > Create Group"});
|
||||
}
|
||||
|
||||
if (!this.workingGuild.name || !this.workingGuild.description) {
|
||||
if (!this.workingGroup.name || !this.workingGroup.description) {
|
||||
// @TODO: Add proper notifications - split this out into two, make errors translatable. Suggestion: `<% fieldName %> is required` for all errors where possible, where `fieldName` is inserted as the translatable string that's used for the field header.
|
||||
alert('Enter a name and description');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.workingGuild.summary) {
|
||||
if (!this.workingGroup.summary) {
|
||||
// @TODO: Add proper notifications. Summary is mandatory for only public guilds (not tavern, private guilds, parties)
|
||||
alert('Enter a summary');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.workingGuild.summary.length > MAX_SUMMARY_SIZE_FOR_GUILDS) {
|
||||
if (this.workingGroup.summary.length > MAX_SUMMARY_SIZE_FOR_GUILDS) {
|
||||
// @TODO: Add proper notifications. Summary is mandatory for only public guilds (not tavern, private guilds, parties)
|
||||
alert('Summary is too long');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.workingGuild.categories || this.workingGuild.categories.length === 0) {
|
||||
if (!this.workingGroup.categories || this.workingGroup.categories.length === 0) {
|
||||
// @TODO: Add proper notifications
|
||||
alert('One or more categories must be selected');
|
||||
return;
|
||||
}
|
||||
|
||||
// @TODO: Add proper notifications
|
||||
if (!this.workingGuild.id && !confirm(this.$t('confirmGuild'))) return;
|
||||
if (!this.workingGroup.id && !confirm(this.$t('confirmGuild'))) return;
|
||||
|
||||
if (!this.workingGuild.privateGuild) {
|
||||
this.workingGuild.privacy = 'public';
|
||||
if (!this.workingGroup.privateGuild) {
|
||||
this.workingGroup.privacy = 'public';
|
||||
}
|
||||
|
||||
if (!this.workingGuild.onlyLeaderCreatesChallenges) {
|
||||
this.workingGuild.leaderOnly = {
|
||||
if (!this.workingGroup.onlyLeaderCreatesChallenges) {
|
||||
this.workingGroup.leaderOnly = {
|
||||
challenges: true,
|
||||
};
|
||||
}
|
||||
|
||||
let categoryKeys = this.workingGuild.categories;
|
||||
let categoryKeys = this.workingGroup.categories;
|
||||
let serverCategories = [];
|
||||
categoryKeys.forEach(key => {
|
||||
let catName = this.categoriesHashByKey[key];
|
||||
@@ -392,22 +401,22 @@ export default {
|
||||
name: catName,
|
||||
});
|
||||
});
|
||||
this.workingGuild.categories = serverCategories;
|
||||
this.workingGroup.categories = serverCategories;
|
||||
|
||||
let newgroup;
|
||||
if (this.workingGuild.id) {
|
||||
await this.$store.dispatch('guilds:update', {group: this.workingGuild});
|
||||
this.$root.$emit('updatedGroup', this.workingGuild);
|
||||
if (this.workingGroup.id) {
|
||||
await this.$store.dispatch('guilds:update', {group: this.workingGroup});
|
||||
this.$root.$emit('updatedGroup', this.workingGroup);
|
||||
// @TODO: this doesn't work because of the async resource
|
||||
// if (updatedGroup.type === 'party') this.$store.state.party = {data: updatedGroup};
|
||||
} else {
|
||||
newgroup = await this.$store.dispatch('guilds:create', {group: this.workingGuild});
|
||||
newgroup = await this.$store.dispatch('guilds:create', {group: this.workingGroup});
|
||||
this.$store.state.user.data.balance -= 1;
|
||||
}
|
||||
|
||||
this.$store.state.editingGroup = {};
|
||||
|
||||
this.workingGuild = {
|
||||
this.workingGroup = {
|
||||
name: '',
|
||||
type: 'guild',
|
||||
privacy: 'private',
|
||||
@@ -424,6 +433,19 @@ export default {
|
||||
}
|
||||
this.$root.$emit('hide::modal', 'guild-form');
|
||||
},
|
||||
resetWorkingGroup () {
|
||||
this.workingGroup = {
|
||||
name: '',
|
||||
type: 'guild',
|
||||
privacy: 'private',
|
||||
description: '',
|
||||
categories: [],
|
||||
onlyLeaderCreatesChallenges: true,
|
||||
guildLeaderCantBeMessaged: true,
|
||||
privateGuild: true,
|
||||
allowGuildInvationsFromNonMembers: true,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user