forked from AkkomaGang/akkoma-fe
Wrap action buttons below user names
for more readable notification panel
This commit is contained in:
parent
14e789cf7a
commit
0a56cf37a9
2 changed files with 99 additions and 262 deletions
|
@ -97,14 +97,13 @@
|
||||||
.user-info {
|
.user-info {
|
||||||
color: $fallback--lightText;
|
color: $fallback--lightText;
|
||||||
color: var(--lightText, $fallback--lightText);
|
color: var(--lightText, $fallback--lightText);
|
||||||
padding: 0 26px;
|
padding: 0 1.5em;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 16px 0 6px;
|
padding: 16px 0 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
max-height: 56px;
|
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
@ -165,7 +164,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-summary {
|
.user-summary {
|
||||||
display: block;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
margin-left: 0.6em;
|
margin-left: 0.6em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -184,6 +184,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-names {
|
||||||
|
flex-grow: 1;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.user-name {
|
.user-name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -228,6 +233,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-line {
|
||||||
|
display: flex;
|
||||||
|
min-width: 10em;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.user-meta {
|
.user-meta {
|
||||||
margin-bottom: .15em;
|
margin-bottom: .15em;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -1,188 +1,84 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div class="user-card" :class="classes">
|
||||||
class="user-card"
|
<div :class="{ 'hide-bio': hideBio }" :style="style" class="background-image" />
|
||||||
:class="classes"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
:class="{ 'hide-bio': hideBio }"
|
|
||||||
:style="style"
|
|
||||||
class="background-image"
|
|
||||||
/>
|
|
||||||
<div class="panel-heading -flexible-height">
|
<div class="panel-heading -flexible-height">
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a
|
<a v-if="allowZoomingAvatar" class="user-info-avatar-link" @click="zoomAvatar">
|
||||||
v-if="allowZoomingAvatar"
|
<UserAvatar :better-shadow="betterShadow" :user="user" />
|
||||||
class="user-info-avatar-link"
|
|
||||||
@click="zoomAvatar"
|
|
||||||
>
|
|
||||||
<UserAvatar
|
|
||||||
:better-shadow="betterShadow"
|
|
||||||
:user="user"
|
|
||||||
/>
|
|
||||||
<div class="user-info-avatar-link-overlay">
|
<div class="user-info-avatar-link-overlay">
|
||||||
<FAIcon
|
<FAIcon class="fa-scale-110 fa-old-padding" icon="search-plus" />
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="search-plus"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<router-link
|
<router-link v-else :to="userProfileLink(user)">
|
||||||
v-else
|
<UserAvatar :better-shadow="betterShadow" :user="user" />
|
||||||
:to="userProfileLink(user)"
|
|
||||||
>
|
|
||||||
<UserAvatar
|
|
||||||
:better-shadow="betterShadow"
|
|
||||||
:user="user"
|
|
||||||
/>
|
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="user-summary">
|
<div class="user-summary">
|
||||||
<div class="top-line">
|
<div class="user-names">
|
||||||
<RichContent
|
<div class="top-line">
|
||||||
:title="user.name"
|
<RichContent :title="user.name" class="user-name" :html="user.name" :emoji="user.emoji" />
|
||||||
class="user-name"
|
</div>
|
||||||
:html="user.name"
|
<div class="bottom-line">
|
||||||
:emoji="user.emoji"
|
<router-link class="user-screen-name" :title="user.screen_name_ui" :to="userProfileLink(user)">
|
||||||
/>
|
@{{ user.screen_name_ui }}
|
||||||
<button
|
</router-link>
|
||||||
v-if="!isOtherUser && user.is_local"
|
<template v-if="!hideBio">
|
||||||
class="button-unstyled edit-profile-button"
|
<span v-if="user.deactivated" class="alert user-role">
|
||||||
@click.stop="openProfileTab"
|
{{ $t('user_card.deactivated') }}
|
||||||
>
|
</span>
|
||||||
<FAIcon
|
<span v-if="!!visibleRole" class="alert user-role">
|
||||||
fixed-width
|
{{ $t(`general.role.${visibleRole}`) }}
|
||||||
class="icon"
|
</span>
|
||||||
icon="edit"
|
<span v-if="user.bot" class="alert user-role">
|
||||||
:title="$t('user_card.edit_profile')"
|
{{ $t('user_card.bot') }}
|
||||||
/>
|
</span>
|
||||||
</button>
|
</template>
|
||||||
<a
|
<span v-if="user.locked">
|
||||||
v-if="isOtherUser && !user.is_local"
|
<FAIcon class="lock-icon" icon="lock" size="sm" />
|
||||||
:href="user.statusnet_profile_url"
|
</span>
|
||||||
target="_blank"
|
<span v-if="!mergedConfig.hideUserStats && !hideBio" class="dailyAvg">{{ dailyAvg }} {{
|
||||||
class="button-unstyled external-link-button"
|
$t('user_card.per_day') }}</span>
|
||||||
:title="$t('user_card.external_source')"
|
</div>
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
class="icon"
|
|
||||||
icon="external-link-alt"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
v-if="fediLinkURL && showFediLinks && !hideBio"
|
|
||||||
:href="fediLinkURL"
|
|
||||||
target="_blank"
|
|
||||||
class="button-unstyled external-link-button"
|
|
||||||
:title="$t('user_card.open_fedi_link')"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
class="icon"
|
|
||||||
:icon="['fac', 'activity-pub']"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
v-if="isOtherUser"
|
|
||||||
:href="user.statusnet_profile_url + '.rss'"
|
|
||||||
target="_blank"
|
|
||||||
class="button-unstyled external-link-button"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
class="icon"
|
|
||||||
icon="rss"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<AccountActions
|
|
||||||
v-if="isOtherUser && loggedIn"
|
|
||||||
:user="user"
|
|
||||||
:relationship="relationship"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-line">
|
<div class="button-line">
|
||||||
<router-link
|
<button v-if="!isOtherUser && user.is_local" class="button-unstyled edit-profile-button"
|
||||||
class="user-screen-name"
|
@click.stop="openProfileTab">
|
||||||
:title="user.screen_name_ui"
|
<FAIcon fixed-width class="icon" icon="edit" :title="$t('user_card.edit_profile')" />
|
||||||
:to="userProfileLink(user)"
|
</button>
|
||||||
>
|
<a v-if="isOtherUser && !user.is_local" :href="user.statusnet_profile_url" target="_blank"
|
||||||
@{{ user.screen_name_ui }}
|
class="button-unstyled external-link-button" :title="$t('user_card.external_source')">
|
||||||
</router-link>
|
<FAIcon class="icon" icon="external-link-alt" />
|
||||||
<template v-if="!hideBio">
|
</a>
|
||||||
<span
|
<a v-if="fediLinkURL && showFediLinks && !hideBio" :href="fediLinkURL" target="_blank"
|
||||||
v-if="user.deactivated"
|
class="button-unstyled external-link-button" :title="$t('user_card.open_fedi_link')">
|
||||||
class="alert user-role"
|
<FAIcon class="icon" :icon="['fac', 'activity-pub']" />
|
||||||
>
|
</a>
|
||||||
{{ $t('user_card.deactivated') }}
|
<a v-if="isOtherUser" :href="user.statusnet_profile_url + '.rss'" target="_blank"
|
||||||
</span>
|
class="button-unstyled external-link-button">
|
||||||
<span
|
<FAIcon class="icon" icon="rss" />
|
||||||
v-if="!!visibleRole"
|
</a>
|
||||||
class="alert user-role"
|
<AccountActions v-if="isOtherUser && loggedIn" :user="user" :relationship="relationship" />
|
||||||
>
|
|
||||||
{{ $t(`general.role.${visibleRole}`) }}
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
v-if="user.bot"
|
|
||||||
class="alert user-role"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.bot') }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<span v-if="user.locked">
|
|
||||||
<FAIcon
|
|
||||||
class="lock-icon"
|
|
||||||
icon="lock"
|
|
||||||
size="sm"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
v-if="!mergedConfig.hideUserStats && !hideBio"
|
|
||||||
class="dailyAvg"
|
|
||||||
>{{ dailyAvg }} {{ $t('user_card.per_day') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-meta">
|
<div class="user-meta">
|
||||||
<div
|
<div v-if="relationship.blocked_by && loggedIn && isOtherUser" class="blocking">
|
||||||
v-if="relationship.blocked_by && loggedIn && isOtherUser"
|
|
||||||
class="blocking"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.blocks_you') }}
|
{{ $t('user_card.blocks_you') }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="relationship.followed_by && loggedIn && isOtherUser" class="following">
|
||||||
v-if="relationship.followed_by && loggedIn && isOtherUser"
|
|
||||||
class="following"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.follows_you') }}
|
{{ $t('user_card.follows_you') }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="relationship.requested_by && loggedIn && isOtherUser" class="requested_by">
|
||||||
v-if="relationship.requested_by && loggedIn && isOtherUser"
|
|
||||||
class="requested_by"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.requested_by') }}
|
{{ $t('user_card.requested_by') }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="isOtherUser && (loggedIn || !switcher)" class="highlighter">
|
||||||
v-if="isOtherUser && (loggedIn || !switcher)"
|
|
||||||
class="highlighter"
|
|
||||||
>
|
|
||||||
<!-- id's need to be unique, otherwise vue confuses which user-card checkbox belongs to -->
|
<!-- id's need to be unique, otherwise vue confuses which user-card checkbox belongs to -->
|
||||||
<input
|
<input v-if="userHighlightType !== 'disabled'" :id="'userHighlightColorTx' + user.id"
|
||||||
v-if="userHighlightType !== 'disabled'"
|
v-model="userHighlightColor" class="userHighlightText" type="text">
|
||||||
:id="'userHighlightColorTx'+user.id"
|
<input v-if="userHighlightType !== 'disabled'" :id="'userHighlightColor' + user.id" v-model="userHighlightColor"
|
||||||
v-model="userHighlightColor"
|
class="userHighlightCl" type="color">
|
||||||
class="userHighlightText"
|
|
||||||
type="text"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
v-if="userHighlightType !== 'disabled'"
|
|
||||||
:id="'userHighlightColor'+user.id"
|
|
||||||
v-model="userHighlightColor"
|
|
||||||
class="userHighlightCl"
|
|
||||||
type="color"
|
|
||||||
>
|
|
||||||
{{ ' ' }}
|
{{ ' ' }}
|
||||||
<Select
|
<Select :id="'userHighlightSel' + user.id" v-model="userHighlightType" class="userHighlightSel">
|
||||||
:id="'userHighlightSel'+user.id"
|
|
||||||
v-model="userHighlightType"
|
|
||||||
class="userHighlightSel"
|
|
||||||
>
|
|
||||||
<option value="disabled">
|
<option value="disabled">
|
||||||
{{ $t('user_card.highlight.disabled') }}
|
{{ $t('user_card.highlight.disabled') }}
|
||||||
</option>
|
</option>
|
||||||
|
@ -198,141 +94,70 @@
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="loggedIn && isOtherUser" class="user-interactions">
|
||||||
v-if="loggedIn && isOtherUser"
|
|
||||||
class="user-interactions"
|
|
||||||
>
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<FollowButton
|
<FollowButton :relationship="relationship" :user="user" :disabled="relationship.blocked_by" />
|
||||||
:relationship="relationship"
|
|
||||||
:user="user"
|
|
||||||
:disabled="relationship.blocked_by"
|
|
||||||
/>
|
|
||||||
<template v-if="relationship.following">
|
<template v-if="relationship.following">
|
||||||
<ProgressButton
|
<ProgressButton v-if="!relationship.subscribing" class="btn button-default" :click="subscribeUser"
|
||||||
v-if="!relationship.subscribing"
|
:title="$t('user_card.subscribe')">
|
||||||
class="btn button-default"
|
|
||||||
:click="subscribeUser"
|
|
||||||
:title="$t('user_card.subscribe')"
|
|
||||||
>
|
|
||||||
<FAIcon icon="bell" />
|
<FAIcon icon="bell" />
|
||||||
</ProgressButton>
|
</ProgressButton>
|
||||||
<ProgressButton
|
<ProgressButton v-else class="btn button-default toggled" :click="unsubscribeUser"
|
||||||
v-else
|
:title="$t('user_card.unsubscribe')">
|
||||||
class="btn button-default toggled"
|
|
||||||
:click="unsubscribeUser"
|
|
||||||
:title="$t('user_card.unsubscribe')"
|
|
||||||
>
|
|
||||||
<FALayers>
|
<FALayers>
|
||||||
<FAIcon
|
<FAIcon icon="rss" transform="left-5 shrink-6 up-3 rotate-20" flip="horizontal" />
|
||||||
icon="rss"
|
<FAIcon icon="rss" transform="right-5 shrink-6 up-3 rotate-20" />
|
||||||
transform="left-5 shrink-6 up-3 rotate-20"
|
|
||||||
flip="horizontal"
|
|
||||||
/>
|
|
||||||
<FAIcon
|
|
||||||
icon="rss"
|
|
||||||
transform="right-5 shrink-6 up-3 rotate-20"
|
|
||||||
/>
|
|
||||||
<FAIcon icon="bell" />
|
<FAIcon icon="bell" />
|
||||||
</FALayers>
|
</FALayers>
|
||||||
</ProgressButton>
|
</ProgressButton>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button v-if="relationship.muting" class="btn button-default btn-block toggled" :disabled="user.deactivated"
|
||||||
v-if="relationship.muting"
|
@click="unmuteUser">
|
||||||
class="btn button-default btn-block toggled"
|
|
||||||
:disabled="user.deactivated"
|
|
||||||
@click="unmuteUser"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.muted') }}
|
{{ $t('user_card.muted') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button v-else class="btn button-default btn-block" :disabled="user.deactivated" @click="muteUser">
|
||||||
v-else
|
|
||||||
class="btn button-default btn-block"
|
|
||||||
:disabled="user.deactivated"
|
|
||||||
@click="muteUser"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.mute') }}
|
{{ $t('user_card.mute') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="btn button-default btn-block" :disabled="user.deactivated" @click="mentionUser">
|
||||||
class="btn button-default btn-block"
|
|
||||||
:disabled="user.deactivated"
|
|
||||||
@click="mentionUser"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.mention') }}
|
{{ $t('user_card.mention') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<ModerationTools
|
<ModerationTools v-if="loggedIn.role === 'admin'" :user="user" />
|
||||||
v-if="loggedIn.role === 'admin'"
|
|
||||||
:user="user"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="!loggedIn && user.is_local" class="user-interactions">
|
||||||
v-if="!loggedIn && user.is_local"
|
|
||||||
class="user-interactions"
|
|
||||||
>
|
|
||||||
<RemoteFollow :user="user" />
|
<RemoteFollow :user="user" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="!hideBio" class="panel-body">
|
||||||
v-if="!hideBio"
|
<div v-if="!mergedConfig.hideUserStats && switcher" class="user-counts">
|
||||||
class="panel-body"
|
<div class="user-count" @click.prevent="setProfileView('statuses')">
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-if="!mergedConfig.hideUserStats && switcher"
|
|
||||||
class="user-counts"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="user-count"
|
|
||||||
@click.prevent="setProfileView('statuses')"
|
|
||||||
>
|
|
||||||
<h5>{{ $t('user_card.statuses') }}</h5>
|
<h5>{{ $t('user_card.statuses') }}</h5>
|
||||||
<span>{{ user.statuses_count }} <br></span>
|
<span>{{ user.statuses_count }} <br></span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="user-count" @click.prevent="setProfileView('friends')">
|
||||||
class="user-count"
|
|
||||||
@click.prevent="setProfileView('friends')"
|
|
||||||
>
|
|
||||||
<h5>{{ $t('user_card.followees') }}</h5>
|
<h5>{{ $t('user_card.followees') }}</h5>
|
||||||
<span>{{ hideFollowsCount ? $t('user_card.hidden') : user.friends_count }}</span>
|
<span>{{ hideFollowsCount ? $t('user_card.hidden') : user.friends_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="user-count" @click.prevent="setProfileView('followers')">
|
||||||
class="user-count"
|
|
||||||
@click.prevent="setProfileView('followers')"
|
|
||||||
>
|
|
||||||
<h5>{{ $t('user_card.followers') }}</h5>
|
<h5>{{ $t('user_card.followers') }}</h5>
|
||||||
<span>{{ hideFollowersCount ? $t('user_card.hidden') : user.followers_count }}</span>
|
<span>{{ hideFollowersCount ? $t('user_card.hidden') : user.followers_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<RichContent
|
<RichContent v-if="!hideBio" class="user-card-bio" :html="user.description_html" :emoji="user.emoji"
|
||||||
v-if="!hideBio"
|
:handle-links="true" />
|
||||||
class="user-card-bio"
|
|
||||||
:html="user.description_html"
|
|
||||||
:emoji="user.emoji"
|
|
||||||
:handle-links="true"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<teleport to="#modal">
|
<teleport to="#modal">
|
||||||
<confirm-modal
|
<confirm-modal v-if="showingConfirmMute" :title="$t('user_card.mute_confirm_title')"
|
||||||
v-if="showingConfirmMute"
|
|
||||||
:title="$t('user_card.mute_confirm_title')"
|
|
||||||
:confirm-text="$t('user_card.mute_confirm_accept_button')"
|
:confirm-text="$t('user_card.mute_confirm_accept_button')"
|
||||||
:cancel-text="$t('user_card.mute_confirm_cancel_button')"
|
:cancel-text="$t('user_card.mute_confirm_cancel_button')" @accepted="doMuteUser" @cancelled="hideConfirmMute">
|
||||||
@accepted="doMuteUser"
|
<i18n-t keypath="user_card.mute_confirm" tag="span">
|
||||||
@cancelled="hideConfirmMute"
|
|
||||||
>
|
|
||||||
<i18n-t
|
|
||||||
keypath="user_card.mute_confirm"
|
|
||||||
tag="span"
|
|
||||||
>
|
|
||||||
<template #user>
|
<template #user>
|
||||||
<span
|
<span v-text="user.screen_name_ui" />
|
||||||
v-text="user.screen_name_ui"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</confirm-modal>
|
</confirm-modal>
|
||||||
|
|
Loading…
Reference in a new issue