2016-11-24 18:17:09 +01:00
|
|
|
<template>
|
2019-07-05 10:17:44 +03:00
|
|
|
<div
|
2020-09-29 10:18:37 +00:00
|
|
|
v-if="!hideStatus"
|
|
|
|
:style="hiddenStyle"
|
2020-07-28 01:27:11 +03:00
|
|
|
class="Conversation"
|
|
|
|
:class="{ '-expanded' : isExpanded, 'panel' : isExpanded }"
|
2019-07-05 10:17:44 +03:00
|
|
|
>
|
|
|
|
<div
|
|
|
|
v-if="isExpanded"
|
2022-04-19 23:06:57 +03:00
|
|
|
class="panel-heading conversation-heading -sticky"
|
2019-07-05 10:17:44 +03:00
|
|
|
>
|
2018-08-30 20:16:36 +03:00
|
|
|
<span class="title"> {{ $t('timeline.conversation') }} </span>
|
2020-11-24 12:32:42 +02:00
|
|
|
<button
|
|
|
|
v-if="collapsable"
|
|
|
|
class="button-unstyled -link"
|
|
|
|
@click.prevent="toggleExpanded"
|
|
|
|
>
|
|
|
|
{{ $t('timeline.collapse') }}
|
|
|
|
</button>
|
2017-02-04 13:52:26 +01:00
|
|
|
</div>
|
2021-08-08 12:40:17 -04:00
|
|
|
<div class="conversation-body panel-body">
|
|
|
|
<div
|
|
|
|
v-if="isTreeView"
|
|
|
|
class="thread-body"
|
|
|
|
>
|
2022-03-06 13:50:15 -05:00
|
|
|
<div
|
|
|
|
v-if="shouldShowAllConversationButton"
|
|
|
|
class="conversation-dive-to-top-level-box"
|
|
|
|
>
|
2022-03-23 16:31:34 +02:00
|
|
|
<i18n-t
|
|
|
|
keypath="status.show_all_conversation_with_icon"
|
2022-03-06 13:50:15 -05:00
|
|
|
tag="button"
|
|
|
|
class="button-unstyled -link"
|
|
|
|
@click.prevent="diveToTopLevel"
|
2022-03-29 15:46:21 +03:00
|
|
|
scope="global"
|
2022-03-06 13:50:15 -05:00
|
|
|
>
|
2022-03-23 16:31:34 +02:00
|
|
|
<template #icon>
|
|
|
|
<FAIcon
|
|
|
|
icon="angle-double-left"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #text>
|
|
|
|
<span>
|
|
|
|
{{ $tc('status.show_all_conversation', otherTopLevelCount, { numStatus: otherTopLevelCount }) }}
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</i18n-t>
|
2022-03-06 13:50:15 -05:00
|
|
|
</div>
|
2021-08-10 23:58:27 -04:00
|
|
|
<div
|
2021-09-15 23:35:17 -04:00
|
|
|
v-if="shouldShowAncestors"
|
2021-08-10 23:58:27 -04:00
|
|
|
class="thread-ancestors"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
v-for="status in ancestorsOf(diveRoot)"
|
|
|
|
:key="status.id"
|
|
|
|
class="thread-ancestor"
|
2022-03-06 14:13:35 -05:00
|
|
|
:class="{'thread-ancestor-has-other-replies': getReplies(status.id).length > 1, '-faded': shouldFadeAncestors}"
|
2021-08-10 23:58:27 -04:00
|
|
|
>
|
|
|
|
<status
|
|
|
|
ref="statusComponent"
|
|
|
|
:inline-expanded="collapsable && isExpanded"
|
|
|
|
:statusoid="status"
|
|
|
|
:expandable="!isExpanded"
|
|
|
|
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
|
|
|
:focused="focused(status.id)"
|
|
|
|
:in-conversation="isExpanded"
|
|
|
|
:highlight="getHighlight()"
|
|
|
|
:replies="getReplies(status.id)"
|
|
|
|
:in-profile="inProfile"
|
|
|
|
:profile-user-id="profileUserId"
|
|
|
|
class="conversation-status status-fadein panel-body"
|
|
|
|
|
2021-09-05 16:35:47 -04:00
|
|
|
:simple-tree="treeViewIsSimple"
|
2021-08-10 23:58:27 -04:00
|
|
|
:toggle-thread-display="toggleThreadDisplay"
|
|
|
|
:thread-display-status="threadDisplayStatus"
|
|
|
|
:show-thread-recursively="showThreadRecursively"
|
|
|
|
:total-reply-count="totalReplyCount"
|
|
|
|
:total-reply-depth="totalReplyDepth"
|
2021-09-05 16:35:47 -04:00
|
|
|
:show-other-replies-as-button="showOtherRepliesButtonInsideStatus"
|
|
|
|
:dive="() => diveIntoStatus(status.id)"
|
2021-08-10 23:58:27 -04:00
|
|
|
|
|
|
|
:controlled-showing-tall="statusContentProperties[status.id].showingTall"
|
|
|
|
:controlled-expanding-subject="statusContentProperties[status.id].expandingSubject"
|
|
|
|
:controlled-showing-long-subject="statusContentProperties[status.id].showingLongSubject"
|
2021-09-16 00:29:14 -04:00
|
|
|
:controlled-replying="statusContentProperties[status.id].replying"
|
|
|
|
:controlled-media-playing="statusContentProperties[status.id].mediaPlaying"
|
2021-08-10 23:58:27 -04:00
|
|
|
:controlled-toggle-showing-tall="() => toggleStatusContentProperty(status.id, 'showingTall')"
|
|
|
|
:controlled-toggle-expanding-subject="() => toggleStatusContentProperty(status.id, 'expandingSubject')"
|
|
|
|
:controlled-toggle-showing-long-subject="() => toggleStatusContentProperty(status.id, 'showingLongSubject')"
|
2021-09-16 00:29:14 -04:00
|
|
|
:controlled-toggle-replying="() => toggleStatusContentProperty(status.id, 'replying')"
|
|
|
|
:controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)"
|
2021-08-10 23:58:27 -04:00
|
|
|
|
|
|
|
@goto="setHighlight"
|
|
|
|
@toggleExpanded="toggleExpanded"
|
|
|
|
/>
|
|
|
|
<div
|
2021-09-05 16:35:47 -04:00
|
|
|
v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1"
|
2021-08-10 23:58:27 -04:00
|
|
|
class="thread-ancestor-dive-box"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="thread-ancestor-dive-box-inner"
|
|
|
|
>
|
2022-03-23 16:31:34 +02:00
|
|
|
<i18n-t
|
2021-08-10 23:58:27 -04:00
|
|
|
tag="button"
|
2022-03-29 15:46:21 +03:00
|
|
|
scope="global"
|
2022-03-23 16:31:34 +02:00
|
|
|
keypath="status.ancestor_follow_with_icon"
|
2021-08-10 23:58:27 -04:00
|
|
|
class="button-unstyled -link thread-tree-show-replies-button"
|
|
|
|
@click.prevent="diveIntoStatus(status.id)"
|
|
|
|
>
|
2022-03-23 16:31:34 +02:00
|
|
|
<template #icon>
|
|
|
|
<FAIcon
|
|
|
|
icon="angle-double-right"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #text>
|
|
|
|
<span>
|
|
|
|
{{ $tc('status.ancestor_follow', getReplies(status.id).length - 1, { numReplies: getReplies(status.id).length - 1 }) }}
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</i18n-t>
|
2021-08-10 23:58:27 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-08-08 12:40:17 -04:00
|
|
|
<thread-tree
|
|
|
|
v-for="status in showingTopLevel"
|
|
|
|
:key="status.id"
|
|
|
|
ref="statusComponent"
|
|
|
|
:depth="0"
|
2021-08-06 20:18:27 -04:00
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
:status="status"
|
|
|
|
:in-profile="inProfile"
|
|
|
|
:conversation="conversation"
|
|
|
|
:collapsable="collapsable"
|
|
|
|
:is-expanded="isExpanded"
|
|
|
|
:pinned-status-ids-object="pinnedStatusIdsObject"
|
|
|
|
:profile-user-id="profileUserId"
|
2021-08-06 20:18:27 -04:00
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
:focused="focused"
|
|
|
|
:get-replies="getReplies"
|
|
|
|
:highlight="maybeHighlight"
|
|
|
|
:set-highlight="setHighlight"
|
|
|
|
:toggle-expanded="toggleExpanded"
|
2021-08-07 00:33:06 -04:00
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
:simple="treeViewIsSimple"
|
|
|
|
:toggle-thread-display="toggleThreadDisplay"
|
|
|
|
:thread-display-status="threadDisplayStatus"
|
|
|
|
:show-thread-recursively="showThreadRecursively"
|
|
|
|
:total-reply-count="totalReplyCount"
|
|
|
|
:total-reply-depth="totalReplyDepth"
|
|
|
|
:status-content-properties="statusContentProperties"
|
|
|
|
:set-status-content-property="setStatusContentProperty"
|
|
|
|
:toggle-status-content-property="toggleStatusContentProperty"
|
|
|
|
:dive="canDive ? diveIntoStatus : undefined"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
v-if="isLinearView"
|
|
|
|
class="thread-body"
|
|
|
|
>
|
|
|
|
<status
|
|
|
|
v-for="status in conversation"
|
|
|
|
:key="status.id"
|
|
|
|
ref="statusComponent"
|
|
|
|
:inline-expanded="collapsable && isExpanded"
|
|
|
|
:statusoid="status"
|
|
|
|
:expandable="!isExpanded"
|
|
|
|
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
|
|
|
:focused="focused(status.id)"
|
|
|
|
:in-conversation="isExpanded"
|
|
|
|
:highlight="getHighlight()"
|
|
|
|
:replies="getReplies(status.id)"
|
|
|
|
:in-profile="inProfile"
|
|
|
|
:profile-user-id="profileUserId"
|
|
|
|
class="conversation-status status-fadein panel-body"
|
2021-08-07 11:59:10 -04:00
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
:toggle-thread-display="toggleThreadDisplay"
|
|
|
|
:thread-display-status="threadDisplayStatus"
|
|
|
|
:show-thread-recursively="showThreadRecursively"
|
|
|
|
:total-reply-count="totalReplyCount"
|
|
|
|
:total-reply-depth="totalReplyDepth"
|
|
|
|
:status-content-properties="statusContentProperties"
|
|
|
|
:set-status-content-property="setStatusContentProperty"
|
|
|
|
:toggle-status-content-property="toggleStatusContentProperty"
|
2021-08-07 11:59:10 -04:00
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
@goto="setHighlight"
|
|
|
|
@toggleExpanded="toggleExpanded"
|
|
|
|
/>
|
|
|
|
</div>
|
2021-08-06 20:18:27 -04:00
|
|
|
</div>
|
2016-11-24 18:17:09 +01:00
|
|
|
</div>
|
2020-09-29 10:18:37 +00:00
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
:style="hiddenStyle"
|
|
|
|
/>
|
2016-11-24 18:17:09 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./conversation.js"></script>
|
2019-03-11 16:24:37 -04:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2020-07-28 01:27:11 +03:00
|
|
|
.Conversation {
|
2021-08-10 23:58:27 -04:00
|
|
|
.conversation-dive-to-top-level-box {
|
2022-03-07 19:28:38 -05:00
|
|
|
padding: var(--status-margin, $status-margin);
|
2021-08-08 12:55:04 -04:00
|
|
|
border-bottom-width: 1px;
|
|
|
|
border-bottom-style: solid;
|
|
|
|
border-bottom-color: var(--border, $fallback--border);
|
|
|
|
border-radius: 0;
|
2021-08-08 13:29:49 -04:00
|
|
|
/* Make the button stretch along the whole row */
|
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
flex-direction: column;
|
2021-08-07 11:59:10 -04:00
|
|
|
}
|
2021-08-08 12:40:17 -04:00
|
|
|
|
2021-08-11 00:30:27 -04:00
|
|
|
.thread-ancestors {
|
2022-03-07 19:28:38 -05:00
|
|
|
margin-left: var(--status-margin, $status-margin);
|
2021-08-11 00:30:27 -04:00
|
|
|
border-left: 2px solid var(--border, $fallback--border);
|
|
|
|
}
|
|
|
|
|
2022-03-06 14:13:35 -05:00
|
|
|
.thread-ancestor.-faded .StatusContent {
|
2021-08-10 23:58:27 -04:00
|
|
|
--link: var(--faintLink);
|
|
|
|
--text: var(--faint);
|
|
|
|
color: var(--text);
|
|
|
|
}
|
2022-04-25 23:50:22 +03:00
|
|
|
|
2021-08-10 23:58:27 -04:00
|
|
|
.thread-ancestor-dive-box {
|
2022-03-07 19:28:38 -05:00
|
|
|
padding-left: var(--status-margin, $status-margin);
|
2021-08-10 23:58:27 -04:00
|
|
|
border-bottom-width: 1px;
|
|
|
|
border-bottom-style: solid;
|
|
|
|
border-bottom-color: var(--border, $fallback--border);
|
|
|
|
border-radius: 0;
|
|
|
|
/* Make the button stretch along the whole row */
|
2021-08-13 18:53:31 -04:00
|
|
|
&, &-inner {
|
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2021-08-10 23:58:27 -04:00
|
|
|
}
|
|
|
|
.thread-ancestor-dive-box-inner {
|
2022-03-07 19:28:38 -05:00
|
|
|
padding: var(--status-margin, $status-margin);
|
2021-08-10 23:58:27 -04:00
|
|
|
}
|
|
|
|
|
2020-07-28 01:27:11 +03:00
|
|
|
.conversation-status {
|
2021-08-10 21:28:13 -04:00
|
|
|
border-bottom-width: 1px;
|
|
|
|
border-bottom-style: solid;
|
|
|
|
border-bottom-color: var(--border, $fallback--border);
|
2020-07-28 01:27:11 +03:00
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
|
2021-08-10 23:58:27 -04:00
|
|
|
.thread-ancestor-has-other-replies .conversation-status,
|
2021-08-11 00:49:38 -04:00
|
|
|
.thread-ancestor:last-child .conversation-status,
|
|
|
|
.thread-ancestor:last-child .thread-ancestor-dive-box,
|
2021-08-10 21:28:13 -04:00
|
|
|
&.-expanded .thread-tree .conversation-status {
|
|
|
|
border-bottom: none;
|
2021-08-08 12:40:17 -04:00
|
|
|
}
|
|
|
|
|
2022-04-25 23:50:22 +03:00
|
|
|
&:last-child .conversation-status {
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
|
2021-08-11 00:49:38 -04:00
|
|
|
.thread-ancestors + .thread-tree > .conversation-status {
|
|
|
|
border-top-width: 1px;
|
|
|
|
border-top-style: solid;
|
|
|
|
border-top-color: var(--border, $fallback--border);
|
|
|
|
}
|
|
|
|
|
2021-08-08 12:40:17 -04:00
|
|
|
/* expanded conversation in timeline */
|
|
|
|
&.status-fadein.-expanded .thread-body {
|
|
|
|
border-left-width: 4px;
|
|
|
|
border-left-style: solid;
|
|
|
|
border-left-color: $fallback--cRed;
|
|
|
|
border-left-color: var(--cRed, $fallback--cRed);
|
|
|
|
border-radius: 0 0 $fallback--panelRadius $fallback--panelRadius;
|
|
|
|
border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
|
|
|
|
border-bottom: 1px solid var(--border, $fallback--border);
|
|
|
|
}
|
2022-04-10 19:28:52 +03:00
|
|
|
|
|
|
|
&.-expanded.status-fadein {
|
2022-04-10 14:47:47 +03:00
|
|
|
margin: calc(var(--status-margin, $status-margin) / 2);
|
|
|
|
}
|
2019-03-11 16:24:37 -04:00
|
|
|
}
|
|
|
|
</style>
|