Merge branch 'feature/improve-status-header-and-spacing' into 'develop'

Re-do status header a bit, add more consistent spacing to status

Closes #264

See merge request pleroma/pleroma-fe!617
This commit is contained in:
Shpuld Shpludson 2019-03-02 16:35:38 +00:00
commit 11113dd7c4
8 changed files with 188 additions and 127 deletions

View file

@ -628,6 +628,16 @@ nav {
color: $fallback--faint; color: $fallback--faint;
color: var(--faint, $fallback--faint); color: var(--faint, $fallback--faint);
} }
.faint-link {
color: $fallback--faint;
color: var(--faint, $fallback--faint);
&:hover {
text-decoration: underline;
}
}
@media all and (min-width: 800px) { @media all and (min-width: 800px) {
.logo { .logo {
opacity: 1 !important; opacity: 1 !important;
@ -661,6 +671,10 @@ nav {
border-radius: var(--inputRadius, $fallback--inputRadius); border-radius: var(--inputRadius, $fallback--inputRadius);
} }
.button-icon {
font-size: 1.2em;
}
@keyframes shakeError { @keyframes shakeError {
0% { 0% {
transform: translateX(0); transform: translateX(0);
@ -705,16 +719,6 @@ nav {
margin: 0.5em 0 0.5em 0; margin: 0.5em 0 0.5em 0;
} }
.button-icon {
font-size: 1.2em;
}
.status .status-actions {
div {
max-width: 4em;
}
}
.menu-button { .menu-button {
display: block; display: block;
margin-right: 0.8em; margin-right: 0.8em;

View file

@ -88,7 +88,7 @@
.attachment { .attachment {
position: relative; position: relative;
margin: 0.5em 0.5em 0em 0em; margin-top: 0.5em;
align-self: flex-start; align-self: flex-start;
line-height: 0; line-height: 0;

View file

@ -36,6 +36,9 @@
box-sizing: border-box; box-sizing: border-box;
// to make failed images a bit more noticeable on chromium // to make failed images a bit more noticeable on chromium
min-width: 2em; min-width: 2em;
&:last-child {
margin: 0;
}
} }
.image-attachment { .image-attachment {

View file

@ -24,10 +24,6 @@
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
// TODO: clean up the random margins in attachments, this makes preview line
// up with attachments...
margin-right: 0.5em;
.card-image { .card-image {
flex-shrink: 0; flex-shrink: 0;
width: 120px; width: 120px;

View file

@ -23,7 +23,7 @@ const Status = {
'highlight', 'highlight',
'compact', 'compact',
'replies', 'replies',
'noReplyLinks', 'isPreview',
'noHeading', 'noHeading',
'inlineExpanded' 'inlineExpanded'
], ],

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="status-el" v-if="!hideStatus" :class="[{ 'status-el_focused': isFocused }, { 'status-conversation': inlineExpanded }]"> <div class="status-el" v-if="!hideStatus" :class="[{ 'status-el_focused': isFocused }, { 'status-conversation': inlineExpanded }]">
<template v-if="muted && !noReplyLinks"> <template v-if="muted && !isPreview">
<div class="media status container muted"> <div class="media status container muted">
<small> <small>
<router-link :to="userProfileLink"> <router-link :to="userProfileLink">
@ -13,7 +13,7 @@
</template> </template>
<template v-else> <template v-else>
<div v-if="retweet && !noHeading" :class="[repeaterClass, { highlighted: repeaterStyle }]" :style="[repeaterStyle]" class="media container retweet-info"> <div v-if="retweet && !noHeading" :class="[repeaterClass, { highlighted: repeaterStyle }]" :style="[repeaterStyle]" class="media container retweet-info">
<UserAvatar v-if="retweet" :betterShadow="betterShadow" :src="statusoid.user.profile_image_url_original"/> <UserAvatar class="media-left" v-if="retweet" :betterShadow="betterShadow" :src="statusoid.user.profile_image_url_original"/>
<div class="media-body faint"> <div class="media-body faint">
<span class="user-name"> <span class="user-name">
<router-link v-if="retweeterHtml" :to="retweeterProfileLink" v-html="retweeterHtml"/> <router-link v-if="retweeterHtml" :to="retweeterProfileLink" v-html="retweeterHtml"/>
@ -31,57 +31,69 @@
</router-link> </router-link>
</div> </div>
<div class="status-body"> <div class="status-body">
<div class="usercard media-body" v-if="userExpanded"> <div class="usercard" v-if="userExpanded">
<user-card-content :user="status.user" :switcher="false"></user-card-content> <user-card-content :user="status.user" :switcher="false"></user-card-content>
</div> </div>
<div v-if="!noHeading" class="media-body container media-heading"> <div v-if="!noHeading" class="media-heading">
<div class="media-heading-left"> <div class="heading-name-row">
<div class="name-and-links"> <div class="name-and-account-name">
<h4 class="user-name" v-if="status.user.name_html" v-html="status.user.name_html"></h4> <h4 class="user-name" v-if="status.user.name_html" v-html="status.user.name_html"></h4>
<h4 class="user-name" v-else>{{status.user.name}}</h4> <h4 class="user-name" v-else>{{status.user.name}}</h4>
<span class="links"> <router-link class="account-name" :to="userProfileLink">
<router-link :to="userProfileLink">
{{status.user.screen_name}} {{status.user.screen_name}}
</router-link> </router-link>
<span v-if="isReply" class="faint reply-info">
<i class="icon-right-open"></i>
<router-link :to="replyProfileLink">
{{replyToName}}
</router-link>
</span>
<a v-if="isReply && !noReplyLinks" href="#" @click.prevent="gotoOriginal(status.in_reply_to_status_id)" :aria-label="$t('tool_tip.reply')">
<i class="button-icon icon-reply" @mouseenter="replyEnter(status.in_reply_to_status_id, $event)" @mouseout="replyLeave()"></i>
</a>
</span>
</div> </div>
<h4 class="replies" v-if="inConversation && !noReplyLinks">
<small v-if="replies.length">Replies:</small> <span class="heading-right">
<small class="reply-link" v-bind:key="reply.id" v-for="reply in replies"> <router-link class="timeago faint-link" :to="{ name: 'conversation', params: { id: status.id } }">
<a href="#" @click.prevent="gotoOriginal(reply.id)" @mouseenter="replyEnter(reply.id, $event)" @mouseout="replyLeave()">{{reply.name}}&nbsp;</a>
</small>
</h4>
</div>
<div class="media-heading-right">
<router-link class="timeago" :to="{ name: 'conversation', params: { id: status.id } }">
<timeago :since="status.created_at" :auto-update="60"></timeago> <timeago :since="status.created_at" :auto-update="60"></timeago>
</router-link> </router-link>
<div class="button-icon visibility-icon" v-if="status.visibility"> <div class="button-icon visibility-icon" v-if="status.visibility">
<i :class="visibilityIcon(status.visibility)" :title="status.visibility | capitalize"></i> <i :class="visibilityIcon(status.visibility)" :title="status.visibility | capitalize"></i>
</div> </div>
<a :href="status.external_url" target="_blank" v-if="!status.is_local" class="source_url" title="Source"> <a :href="status.external_url" target="_blank" v-if="!status.is_local && !isPreview" class="source_url" title="Source">
<i class="button-icon icon-link-ext-alt"></i> <i class="button-icon icon-link-ext-alt"></i>
</a> </a>
<template v-if="expandable"> <template v-if="expandable && !isPreview">
<a href="#" @click.prevent="toggleExpanded" title="Expand"> <a href="#" @click.prevent="toggleExpanded" title="Expand">
<i class="button-icon icon-plus-squared"></i> <i class="button-icon icon-plus-squared"></i>
</a> </a>
</template> </template>
<a href="#" @click.prevent="toggleMute" v-if="unmuted"><i class="button-icon icon-eye-off"></i></a> <a href="#" @click.prevent="toggleMute" v-if="unmuted"><i class="button-icon icon-eye-off"></i></a>
</span>
</div>
<div class="heading-reply-row">
<div v-if="isReply" class="reply-to-and-accountname">
<a class="reply-to"
href="#" @click.prevent="gotoOriginal(status.in_reply_to_status_id)"
:aria-label="$t('tool_tip.reply')"
@mouseenter.prevent.stop="replyEnter(status.in_reply_to_status_id, $event)"
@mouseleave.prevent.stop="replyLeave()"
>
<i class="button-icon icon-reply" v-if="!isPreview"></i>
<span class="faint-link reply-to-text">{{$t('status.reply_to')}}</span>
</a>
<router-link :to="replyProfileLink">
{{replyToName}}
</router-link>
<span class="faint replies-separator" v-if="replies.length">
-
</span>
</div>
<div class="replies" v-if="inConversation && !isPreview">
<span class="faint" v-if="replies.length">{{$t('status.replies_list')}}</span>
<span class="reply-link faint" v-for="reply in replies">
<a href="#" @click.prevent="gotoOriginal(reply.id)" @mouseenter="replyEnter(reply.id, $event)" @mouseout="replyLeave()">{{reply.name}}</a>
</span>
</div> </div>
</div> </div>
</div>
<div v-if="showPreview" class="status-preview-container"> <div v-if="showPreview" class="status-preview-container">
<status class="status-preview" v-if="preview" :noReplyLinks="true" :statusoid="preview" :compact=true></status> <status class="status-preview" v-if="preview" :isPreview="true" :statusoid="preview" :compact=true></status>
<div class="status-preview status-preview-loading" v-else> <div class="status-preview status-preview-loading" v-else>
<i class="icon-spin4 animate-spin"></i> <i class="icon-spin4 animate-spin"></i>
</div> </div>
@ -123,7 +135,7 @@
<link-preview :card="status.card" :size="attachmentSize" :nsfw="nsfwClickthrough" /> <link-preview :card="status.card" :size="attachmentSize" :nsfw="nsfwClickthrough" />
</div> </div>
<div v-if="!noHeading && !noReplyLinks" class='status-actions media-body'> <div v-if="!noHeading && !isPreview" class='status-actions media-body'>
<div v-if="loggedIn"> <div v-if="loggedIn">
<a href="#" v-on:click.prevent="toggleReplying" :title="$t('tool_tip.reply')"> <a href="#" v-on:click.prevent="toggleReplying" :title="$t('tool_tip.reply')">
<i class="button-icon icon-reply" :class="{'icon-reply-active': replying}"></i> <i class="button-icon icon-reply" :class="{'icon-reply-active': replying}"></i>
@ -147,6 +159,8 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
$status-margin: 0.75em;
.status-body { .status-body {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
@ -202,13 +216,16 @@
} }
} }
.media-left {
margin-right: $status-margin;
}
.status-el { .status-el {
hyphens: auto; hyphens: auto;
overflow-wrap: break-word; overflow-wrap: break-word;
word-wrap: break-word; word-wrap: break-word;
word-break: break-word; word-break: break-word;
border-left-width: 0px; border-left-width: 0px;
line-height: 18px;
min-width: 0; min-width: 0;
border-color: $fallback--border; border-color: $fallback--border;
border-color: var(--border, $fallback--border); border-color: var(--border, $fallback--border);
@ -229,22 +246,34 @@
.media-body { .media-body {
flex: 1; flex: 1;
padding: 0; padding: 0;
margin: 0 0 0.25em 0.8em;
} }
.usercard { .usercard {
margin-bottom: .7em margin: 0;
margin-bottom: $status-margin;
}
.user-name {
white-space: nowrap;
font-size: 14px;
overflow: hidden;
flex-shrink: 0;
max-width: 85%;
font-weight: bold;
img {
width: 14px;
height: 14px;
vertical-align: middle;
object-fit: contain
}
} }
.media-heading { .media-heading {
flex-wrap: nowrap;
line-height: 18px;
}
.media-heading-left {
padding: 0; padding: 0;
vertical-align: bottom; vertical-align: bottom;
flex-basis: 100%; flex-basis: 100%;
margin-bottom: 0.5em;
a { a {
display: inline-block; display: inline-block;
@ -254,83 +283,102 @@
small { small {
font-weight: lighter; font-weight: lighter;
} }
h4 {
white-space: nowrap; .heading-name-row {
font-size: 14px; padding: 0;
margin-right: 0.25em; display: flex;
justify-content: space-between;
line-height: 18px;
.name-and-account-name {
display: flex;
min-width: 0;
}
.user-name {
flex-shrink: 1;
margin-right: 0.4em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.name-and-links {
padding: 0; .account-name {
flex: 1 0; min-width: 1.6em;
margin-right: 0.4em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1 1 0;
}
}
.heading-right {
display: flex;
flex-shrink: 0;
}
.timeago {
margin-right: 0.2em;
}
.heading-reply-row {
align-content: baseline;
font-size: 12px;
line-height: 18px;
max-width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: baseline; align-items: stretch;
.user-name {
margin-right: .45em;
img {
width: 14px;
height: 14px;
vertical-align: middle;
object-fit: contain
}
}
}
.links {
display: flex;
font-size: 12px;
color: $fallback--link;
color: var(--link, $fallback--link);
max-width: 100%;
a { a {
max-width: 100%; max-width: 100%;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
& > span { }
text-overflow: ellipsis;
.reply-to-and-accountname {
display: flex;
height: 18px;
margin-right: 0.5em;
overflow: hidden; overflow: hidden;
white-space: nowrap; max-width: 100%;
} .icon-reply {
& > a:last-child { transform: scaleX(-1);
flex-shrink: 0;
} }
} }
.reply-info { .reply-info {
display: flex; display: flex;
} }
.reply-to {
display: flex;
}
.reply-to-text {
overflow: hidden;
text-overflow: ellipsis;
margin: 0 0.4em 0 0.2em;
}
.replies-separator {
margin-left: 0.4em;
}
.replies { .replies {
line-height: 16px; line-height: 18px;
}
.reply-link {
margin-right: 0.2em;
}
}
.media-heading-right {
display: inline-flex;
flex-shrink: 0;
flex-wrap: nowrap;
margin-left: .25em;
align-self: baseline;
.timeago {
margin-right: 0.2em;
font-size: 12px; font-size: 12px;
align-self: last baseline; display: flex;
flex-wrap: wrap;
& > * {
margin-right: 0.4em;
}
} }
> * { .reply-link {
margin-left: 0.2em; height: 17px;
}
a:hover i {
color: $fallback--text;
color: var(--text, $fallback--text);
} }
} }
@ -366,8 +414,8 @@
} }
.status-content { .status-content {
margin-right: 0.5em;
font-family: var(--postFont, sans-serif); font-family: var(--postFont, sans-serif);
line-height: 1.4em;
img, video { img, video {
max-width: 100%; max-width: 100%;
@ -390,9 +438,11 @@
} }
p { p {
margin: 0; margin: 0 0 1em 0;
margin-top: 0.2em; }
margin-bottom: 0.5em;
p:last-child {
margin: 0 0 0 0;
} }
h1 { h1 {
@ -417,7 +467,7 @@
} }
.retweet-info { .retweet-info {
padding: 0.4em 0.6em 0 0.6em; padding: 0.4em $status-margin;
margin: 0; margin: 0;
.avatar.still-image { .avatar.still-image {
@ -488,10 +538,10 @@
.status-actions { .status-actions {
width: 100%; width: 100%;
display: flex; display: flex;
margin-top: $status-margin;
div, favorite-button { div, favorite-button {
padding-top: 0.25em; max-width: 4em;
max-width: 6em;
flex: 1; flex: 1;
} }
} }
@ -517,9 +567,9 @@
.status { .status {
display: flex; display: flex;
padding: 0.6em; padding: $status-margin;
&.is-retweet { &.is-retweet {
padding-top: 0.1em; padding-top: 0;
} }
} }

View file

@ -360,6 +360,10 @@
"no_more_statuses": "No more statuses", "no_more_statuses": "No more statuses",
"no_statuses": "No statuses" "no_statuses": "No statuses"
}, },
"status": {
"reply_to": "Reply to",
"replies_list": "Replies:"
},
"user_card": { "user_card": {
"approve": "Approve", "approve": "Approve",
"block": "Block", "block": "Block",

View file

@ -221,6 +221,10 @@
"up_to_date": "Ajantasalla", "up_to_date": "Ajantasalla",
"no_more_statuses": "Ei enempää viestejä" "no_more_statuses": "Ei enempää viestejä"
}, },
"status": {
"reply_to": "Vastaus",
"replies_list": "Vastaukset:"
},
"user_card": { "user_card": {
"approve": "Hyväksy", "approve": "Hyväksy",
"block": "Estä", "block": "Estä",