mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
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
106 lines
2.1 KiB
Vue
106 lines
2.1 KiB
Vue
<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>
|