mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Squashed commit of the following:
commit 44b1c8c7ba8b45cb682973fb89b70445d0f5c478 Merge:489c15b7fd4dadb64af0Author: Sabe Jones <sabe@habitica.com> Date: Thu Feb 8 14:49:05 2024 -0600 Merge branch 'release' into phillip/panel_profile commit489c15b7fdAuthor: Phillip Thelen <phillip@habitica.com> Date: Wed Dec 14 13:29:32 2022 +0100 allow profiles to be edited in admin panel commit1afaaf4089Author: 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:
@@ -26,6 +26,11 @@
|
|||||||
:reset-counter="resetCounter"
|
:reset-counter="resetCounter"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<user-profile
|
||||||
|
:hero="hero"
|
||||||
|
:reset-counter="resetCounter"
|
||||||
|
/>
|
||||||
|
|
||||||
<party-and-quest
|
<party-and-quest
|
||||||
v-if="adminHasPrivForParty"
|
v-if="adminHasPrivForParty"
|
||||||
:user-id="hero._id"
|
:user-id="hero._id"
|
||||||
@@ -107,6 +112,7 @@
|
|||||||
import BasicDetails from './basicDetails';
|
import BasicDetails from './basicDetails';
|
||||||
import ItemsOwned from './itemsOwned';
|
import ItemsOwned from './itemsOwned';
|
||||||
import CronAndAuth from './cronAndAuth';
|
import CronAndAuth from './cronAndAuth';
|
||||||
|
import UserProfile from './userProfile';
|
||||||
import PartyAndQuest from './partyAndQuest';
|
import PartyAndQuest from './partyAndQuest';
|
||||||
import AvatarAndDrops from './avatarAndDrops';
|
import AvatarAndDrops from './avatarAndDrops';
|
||||||
import PrivilegesAndGems from './privilegesAndGems';
|
import PrivilegesAndGems from './privilegesAndGems';
|
||||||
@@ -130,6 +136,7 @@ export default {
|
|||||||
ContributorDetails,
|
ContributorDetails,
|
||||||
Transactions,
|
Transactions,
|
||||||
SubscriptionAndPerks,
|
SubscriptionAndPerks,
|
||||||
|
UserProfile,
|
||||||
Achievements,
|
Achievements,
|
||||||
},
|
},
|
||||||
mixins: [userStateMixin],
|
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)) {
|
if (updateData.flags && _.isBoolean(updateData.flags.chatShadowMuted)) {
|
||||||
hero.flags.chatShadowMuted = updateData.flags.chatShadowMuted;
|
hero.flags.chatShadowMuted = updateData.flags.chatShadowMuted;
|
||||||
}
|
}
|
||||||
|
if (updateData.profile) _.assign(hero.profile, updateData.profile);
|
||||||
|
|
||||||
if (updateData.secret) {
|
if (updateData.secret) {
|
||||||
if (typeof updateData.secret.text !== 'undefined') {
|
if (typeof updateData.secret.text !== 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user