mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-22 05:38:46 +00:00
Squashed commit of the following:
commit 44b1c8c7ba8b45cb682973fb89b70445d0f5c478
Merge: 489c15b7fd 4dadb64af0
Author: Sabe Jones <sabe@habitica.com>
Date: Thu Feb 8 14:49:05 2024 -0600
Merge branch 'release' into phillip/panel_profile
commit 489c15b7fd0a2a14cbdd2ef381fc525b1550965a
Author: Phillip Thelen <phillip@habitica.com>
Date: Wed Dec 14 13:29:32 2022 +0100
allow profiles to be edited in admin panel
commit 1afaaf40891183ee6651d6b53e5d2b3bee4eb431
Author: Phillip Thelen <phillip@habitica.com>
Date: Wed Dec 14 12:50:47 2022 +0100
include month for next hourglass date in admin panel
This commit is contained in:
parent
4dadb64af0
commit
2f42422d35
3 changed files with 113 additions and 0 deletions
|
|
@ -26,6 +26,11 @@
|
|||
:reset-counter="resetCounter"
|
||||
/>
|
||||
|
||||
<user-profile
|
||||
:hero="hero"
|
||||
:reset-counter="resetCounter"
|
||||
/>
|
||||
|
||||
<party-and-quest
|
||||
v-if="adminHasPrivForParty"
|
||||
:user-id="hero._id"
|
||||
|
|
@ -107,6 +112,7 @@
|
|||
import BasicDetails from './basicDetails';
|
||||
import ItemsOwned from './itemsOwned';
|
||||
import CronAndAuth from './cronAndAuth';
|
||||
import UserProfile from './userProfile';
|
||||
import PartyAndQuest from './partyAndQuest';
|
||||
import AvatarAndDrops from './avatarAndDrops';
|
||||
import PrivilegesAndGems from './privilegesAndGems';
|
||||
|
|
@ -130,6 +136,7 @@ export default {
|
|||
ContributorDetails,
|
||||
Transactions,
|
||||
SubscriptionAndPerks,
|
||||
UserProfile,
|
||||
Achievements,
|
||||
},
|
||||
mixins: [userStateMixin],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<div class="accordion-group">
|
||||
<h3
|
||||
class="expand-toggle"
|
||||
:class="{'open': expand}"
|
||||
@click="expand = !expand"
|
||||
>
|
||||
Users Profile
|
||||
</h3>
|
||||
<div v-if="expand">
|
||||
<form @submit.prevent="saveHero({hero, msg: 'Users Profile'})">
|
||||
<div class="form-group">
|
||||
<label>Display name</label>
|
||||
<input
|
||||
v-model="hero.profile.name"
|
||||
class="form-control textField"
|
||||
type="text"
|
||||
>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Photo URL</label>
|
||||
<input
|
||||
v-model="hero.profile.imageUrl"
|
||||
class="form-control textField"
|
||||
type="text"
|
||||
>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>About</label>
|
||||
<div class="row about-row">
|
||||
<textarea
|
||||
v-model="hero.profile.blurb"
|
||||
class="form-control col"
|
||||
rows="10"
|
||||
></textarea>
|
||||
<div
|
||||
v-markdown="hero.profile.blurb"
|
||||
class="markdownPreview col"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
type="submit"
|
||||
value="Save"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.about-row {
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import markdownDirective from '@/directives/markdown';
|
||||
import saveHero from '../mixins/saveHero';
|
||||
|
||||
import { mapState } from '@/libs/store';
|
||||
import { userStateMixin } from '../../../mixins/userState';
|
||||
|
||||
function resetData (self) {
|
||||
self.expand = false;
|
||||
}
|
||||
|
||||
export default {
|
||||
directives: {
|
||||
markdown: markdownDirective,
|
||||
},
|
||||
mixins: [
|
||||
userStateMixin,
|
||||
saveHero,
|
||||
],
|
||||
computed: {
|
||||
...mapState({ user: 'user.data' }),
|
||||
},
|
||||
props: {
|
||||
resetCounter: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
hero: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
expand: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
resetCounter () {
|
||||
resetData(this);
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
resetData(this);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -403,6 +403,7 @@ api.updateHero = {
|
|||
if (updateData.flags && _.isBoolean(updateData.flags.chatShadowMuted)) {
|
||||
hero.flags.chatShadowMuted = updateData.flags.chatShadowMuted;
|
||||
}
|
||||
if (updateData.profile) _.assign(hero.profile, updateData.profile);
|
||||
|
||||
if (updateData.secret) {
|
||||
if (typeof updateData.secret.text !== 'undefined') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue