feat(content): upgrade profile page

This commit is contained in:
CuriousMagpie
2023-07-26 16:33:05 -04:00
parent 5c4aa664b5
commit 652dfa6ecc
2 changed files with 129 additions and 219 deletions

View File

@@ -1,173 +1,68 @@
<template> <template>
<div <div>
v-if="!user && userLoaded" <div
> v-if="!user && userLoaded"
<error404 /> >
</div> <error404 />
<div </div>
v-else-if="userLoaded" <div
class="profile" v-else-if="userLoaded"
> class="profile"
<div class="header"> >
<div class="profile-actions d-flex"> <!-- HEADER -->
<router-link <div class="header">
:to="{ path: '/private-messages', query: { uuid: user._id } }" <div class="profile-actions d-flex">
replace </div>
> <div class="row">
<button <div class="">
v-b-tooltip.hover.left="$t('sendMessage')" <member-details
class="btn btn-secondary message-icon" :member="user"
> :class-badge-position="'hidden'"
<div />
v-once </div>
class="svg-icon message-icon"
v-html="icons.message"
></div>
</button>
</router-link>
<button
v-b-tooltip.hover.bottom="$t('sendGems')"
class="btn btn-secondary gift-icon"
@click="openSendGemsModal()"
>
<div
class="svg-icon gift-icon"
v-html="icons.gift"
></div>
</button>
<button
v-if="user._id !== userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) === -1"
v-b-tooltip.hover.right="$t('blockWarning')"
class="btn btn-secondary block-icon d-flex justify-content-center align-items-center"
@click="blockUser()"
>
<div
v-once
class="svg-icon block-icon"
v-html="icons.block"
></div>
</button>
<button
v-if="user._id !== userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) !== -1"
v-b-tooltip.hover.right="$t('unblock')"
class="btn btn-secondary positive-icon"
@click="unblockUser()"
>
<div
class="svg-icon positive-icon"
v-html="icons.positive"
></div>
</button>
<button
v-if="hasPermission(userLoggedIn, 'moderator')"
v-b-tooltip.hover.right="'Admin - Toggle Tools'"
class="btn btn-secondary positive-icon d-flex justify-content-center align-items-center"
@click="toggleAdminTools()"
>
<div
class="svg-icon positive-icon"
v-html="icons.staff"
></div>
</button>
</div>
<div
v-if="hasPermission(userLoggedIn, 'moderator') && adminToolsLoaded"
class="row admin-profile-actions"
>
<div class="col-12 text-right">
<span
v-if="!hero.flags || (hero.flags && !hero.flags.chatShadowMuted)"
v-b-tooltip.hover.bottom="'Turn on Shadow Muting'"
class="admin-action"
@click="adminTurnOnShadowMuting()"
>shadow-mute</span>
<span
v-if="hero.flags && hero.flags.chatShadowMuted"
v-b-tooltip.hover.bottom="'Turn off Shadow Muting'"
class="admin-action"
@click="adminTurnOffShadowMuting()"
>un-shadow-mute</span>
<span
v-if="!hero.flags || (hero.flags && !hero.flags.chatRevoked)"
v-b-tooltip.hover.bottom="'Revoke Chat Privileges'"
class="admin-action"
@click="adminRevokeChat()"
>mute</span>
<span
v-if="hero.flags && hero.flags.chatRevoked"
v-b-tooltip.hover.bottom="'Reinstate Chat Privileges'"
class="admin-action"
@click="adminReinstateChat()"
>un-mute</span>
<span
v-if="!hero.auth.blocked"
v-b-tooltip.hover.bottom="'Ban User'"
class="admin-action"
@click="adminBlockUser()"
>ban</span>
<span
v-if="hero.auth.blocked"
v-b-tooltip.hover.bottom="'Un-Ban User'"
class="admin-action"
@click="adminUnblockUser()"
>un-ban</span>
<router-link
:to="{ name: 'adminPanelUser', params: { userIdentifier: userId } }"
replace
>
Admin Panel
</router-link>
</div> </div>
</div> </div>
<div class="row"> <!-- STATE CHANGES -->
<div class="col-12"> <div class="row state-pages">
<member-details :member="user" /> <div class="text-center nav">
</div> <div
</div> class="nav-item"
</div> :class="{active: selectedPage === 'profile'}"
<div class="row"> @click="selectPage('profile')"
<div class="text-center nav"> >
<div {{ $t('profile') }}
class="nav-item" </div>
:class="{active: selectedPage === 'profile'}" <div
@click="selectPage('profile')" class="nav-item"
> :class="{active: selectedPage === 'stats'}"
{{ $t('profile') }} @click="selectPage('stats')"
</div> >
<div {{ $t('stats') }}
class="nav-item" </div>
:class="{active: selectedPage === 'stats'}" <div
@click="selectPage('stats')" class="nav-item"
> :class="{active: selectedPage === 'achievements'}"
{{ $t('stats') }} @click="selectPage('achievements')"
</div> >
<div {{ $t('achievements') }}
class="nav-item" </div>
:class="{active: selectedPage === 'achievements'}"
@click="selectPage('achievements')"
>
{{ $t('achievements') }}
</div> </div>
</div> </div>
</div> </div>
<!-- SHOW PROFILE -->
<div <div
v-show="selectedPage === 'profile'" v-show="selectedPage === 'profile'"
v-if="user.profile" v-if="user.profile"
id="userProfile" id="userProfile"
class="standard-page" class="standard-page "
> >
<div class="row"> <div class="row">
<div class="col-12 col-md-8"> <div class="">
<div class="header mb-3"> <div class="header mb-3">
<h1>{{ user.profile.name }}</h1> <h1>{{ $t('about') }}</h1>
<div
v-if="user.auth && user.auth.local && user.auth.local.username"
class="name"
>
@{{ user.auth.local.username }}
</div>
</div> </div>
</div> </div>
<!-- EDIT BUTTON REPURPOSE FOR SEND MESSAGE/OTHER ACTIONS-->
<div class="col-12 col-md-4"> <div class="col-12 col-md-4">
<button <button
v-if="user._id === userLoggedIn._id" v-if="user._id === userLoggedIn._id"
@@ -179,13 +74,13 @@
</button> </button>
</div> </div>
</div> </div>
<!-- PROFILE STUFF -->
<div <div
v-if="!editing" v-if="!editing"
class="row" class="row"
> >
<div class="col-12 col-md-8"> <div class="">
<div class="about profile-section"> <div class="about profile-section">
<h2>{{ $t('about') }}</h2>
<p <p
v-if="user.profile.blurb" v-if="user.profile.blurb"
v-markdown="user.profile.blurb" v-markdown="user.profile.blurb"
@@ -206,9 +101,8 @@
</p> </p>
</div> </div>
</div> </div>
<div class="col-12 col-md-4"> <div class="">
<div class="info profile-section"> <div class="info profile-section">
<h2>{{ $t('info') }}</h2>
<div class="info-item"> <div class="info-item">
<div class="info-item-label"> <div class="info-item-label">
{{ $t('joined') }}: {{ $t('joined') }}:
@@ -252,12 +146,13 @@
<!-- @TODO: Implement in V2 .social--> <!-- @TODO: Implement in V2 .social-->
</div> </div>
</div> </div>
<!-- EDITING PROFILE -->
<div <div
v-if="editing" v-if="editing"
class="row" class="row"
> >
<h1>{{ $t('editProfile') }}</h1> <h1>{{ $t('editProfile') }}</h1>
<div class="col-12"> <div class="">
<div <div
class="alert alert-info alert-sm" class="alert alert-info alert-sm"
v-html="$t('communityGuidelinesWarning', managerEmail)" v-html="$t('communityGuidelinesWarning', managerEmail)"
@@ -292,9 +187,9 @@
<!-- include ../../shared/formatting-help--> <!-- include ../../shared/formatting-help-->
</div> </div>
</div> </div>
<div class="col-12 text-center"> <div class=" text-center">
<button <button
class="btn btn-primary mr-2" class="btn btn-primary"
@click="save()" @click="save()"
> >
{{ $t("save") }} {{ $t("save") }}
@@ -308,21 +203,22 @@
</div> </div>
</div> </div>
</div> </div>
<!-- ACHIEVEMENTS -->
<div <div
v-show="selectedPage === 'achievements'" v-show="selectedPage === 'achievements'"
v-if="user.achievements" v-if="user.achievements"
id="achievements" id="achievements"
class="standard-page container" class="standard-page container "
> >
<div <div
v-for="(category, key) in achievements" v-for="(category, key) in achievements"
:key="key" :key="key"
class="row category-row" class="row category-row"
> >
<h3 class="col-12 text-center mb-3"> <h3 class="text-center">
{{ $t(`${key}Achievs`) }} {{ $t(`${key}Achievs`) }}
</h3> </h3>
<div class="col-12"> <div class="">
<div class="row achievements-row justify-content-center"> <div class="row achievements-row justify-content-center">
<div <div
v-for="(achievement, achievKey) in achievementsCategory(key, category)" v-for="(achievement, achievKey) in achievementsCategory(key, category)"
@@ -378,14 +274,14 @@
</div> </div>
</div> </div>
</div> </div>
<hr class="col-12"> <hr class="">
<div class="row"> <div class="row">
<div <div
v-if="user.achievements.challenges" v-if="user.achievements.challenges"
class="col-12 col-md-6" class=""
> >
<div class="achievement-icon achievement-karaoke-2x"></div> <div class="achievement-icon achievement-karaoke-2x"></div>
<h3 class="text-center mt-2 mb-4"> <h3 class="text-center">
{{ $t('challengesWon') }} {{ $t('challengesWon') }}
</h3> </h3>
<div <div
@@ -398,10 +294,10 @@
</div> </div>
<div <div
v-if="user.achievements.quests" v-if="user.achievements.quests"
class="col-12 col-md-6" class=""
> >
<div class="achievement-icon achievement-alien2x"></div> <div class="achievement-icon achievement-alien2x"></div>
<h3 class="text-center mt-2 mb-4"> <h3 class="text-center">
{{ $t('questsCompleted') }} {{ $t('questsCompleted') }}
</h3> </h3>
<div <div
@@ -420,31 +316,48 @@
</div> </div>
</div> </div>
</div> </div>
<profileStats <!-- STATS -->
v-show="selectedPage === 'stats'" <div>
v-if="user.preferences" <profileStats
:user="user" v-show="selectedPage === 'stats'"
:show-allocation="showAllocation()" v-if="user.preferences"
/> :user="user"
:show-allocation="showAllocation()"
/>
</div>
</div> </div>
</template> </template>
<style lang="scss" > <style lang="scss" >
@import '~@/assets/scss/colors.scss'; @import '~@/assets/scss/colors.scss';
#profile {
.modal-header{
}
.modal-body {
padding: 0;
border-radius: 12px;
}
.modal-content {
background: $gray-700;
padding: 0;
}
}
.profile { .profile {
.member-details { .member-details {
.character-name, small, .small-text { margin-left: 24px;
color: #878190; background-color: $white;
&.character-name, small, .small-text {
color: $gray-50;
} }
} }
.standard-page { .standard-page {
padding-bottom: 0rem; padding: 0px;
}
.modal-content {
background: #f9f9f9;
} }
.progress-container > .progress { .progress-container > .progress {
@@ -538,22 +451,29 @@
} }
} }
.state-pages {
background-color: $gray-700;
}
.nav { .nav {
font-size: 0.875rem;
width: 100%; width: 100%;
font-weight: bold; font-weight: bold;
min-height: 40px; min-height: 40px;
justify-content: center; justify-content: center;
padding-top: 16px;
} }
.nav-item { .nav-item {
display: inline-block; display: inline-block;
margin: 0 1.2em; margin: 0 8px 8px 6px;
padding: 1em; color: $gray-50;
} }
.nav-item:hover, .nav-item.active { .nav-item:hover, .nav-item.active {
color: #4f2a93; color: $purple-300;
border-bottom: 2px solid #4f2a93; border-bottom: 2px solid $purple-300;
cursor: pointer; cursor: pointer;
} }
@@ -657,8 +577,8 @@
} }
.member-details { .member-details {
.character-name, small, .small-text { small, .small-text {
color: #878190; color: $gray-10;
} }
.progress-container > .progress { .progress-container > .progress {
@@ -673,21 +593,11 @@
size: 16px; size: 16px;
color: $gray-50; color: $gray-50;
} }
h2:after {
background-color: $gray-500;
content: "";
display: inline-block;
height: 1px;
position: relative;
vertical-align: middle;
width: 100%;
}
} }
.info { .info {
.info-item { .info-item {
color: $gray-200; color: $gray-50;
size: 14px; size: 14px;
margin-bottom: 8px; margin-bottom: 8px;

View File

@@ -120,27 +120,27 @@
</h2> </h2>
<div class="well pet-mount-well"> <div class="well pet-mount-well">
<div class="pet-mount-well-image"> <div class="pet-mount-well-image">
<div
class="box"
:class="{white: user.items.currentPet}"
>
<div <div
class="box" class="Pet"
:class="{white: user.items.currentPet}" :class="`Pet-${user.items.currentPet}`"
> ></div>
<div
class="Pet"
:class="`Pet-${user.items.currentPet}`"
></div>
</div>
</div> </div>
<div class="pet-mount-well-text"> </div>
<div>{{ formatAnimal(user.items.currentPet, 'pet') }}</div> <div class="pet-mount-well-text">
<div> <div>{{ formatAnimal(user.items.currentPet, 'pet') }}</div>
<strong>{{ $t('petsFound') }}:</strong> <div>
{{ totalCount(user.items.pets) }} <strong>{{ $t('petsFound') }}:</strong>
</div> {{ totalCount(user.items.pets) }}
<div>
<strong>{{ $t('beastMasterProgress') }}:</strong>
{{ beastMasterProgress(user.items.pets) }}
</div>
</div> </div>
<div>
<strong>{{ $t('beastMasterProgress') }}:</strong>
{{ beastMasterProgress(user.items.pets) }}
</div>
</div>
</div> </div>
</div> </div>
<div class="stats-section-mounts col-12 col-md-6"> <div class="stats-section-mounts col-12 col-md-6">