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