2018-02-11 00:31:26 +01:00
|
|
|
<div class="status-details">
|
2018-04-19 08:48:06 +02:00
|
|
|
<ExternalLink className="status-absolute-date"
|
2018-05-02 02:05:36 +02:00
|
|
|
href={originalStatus.url}
|
2018-08-27 00:38:45 +02:00
|
|
|
showIcon={true}
|
2018-05-02 02:05:36 +02:00
|
|
|
ariaLabel="{formattedDate} (opens in new window)"
|
2018-04-16 01:00:09 +02:00
|
|
|
>
|
2018-05-02 02:05:36 +02:00
|
|
|
<time datetime={createdAtDate} title={formattedDate}>{formattedDate}</time>
|
2018-02-11 00:31:26 +01:00
|
|
|
</ExternalLink>
|
2018-08-27 04:46:19 +02:00
|
|
|
{#if applicationName}
|
|
|
|
{#if applicationWebsite}
|
|
|
|
<ExternalLink className="status-application"
|
|
|
|
href={applicationWebsite}
|
|
|
|
showIcon={false}
|
|
|
|
ariaLabel="{applicationName} (opens in new window)">
|
|
|
|
<span class="status-application-span">
|
|
|
|
{applicationName}
|
|
|
|
</span>
|
|
|
|
</ExternalLink>
|
|
|
|
{:else}
|
|
|
|
<span class="status-application status-application-span">
|
2018-08-27 00:38:45 +02:00
|
|
|
{applicationName}
|
|
|
|
</span>
|
2018-08-27 04:46:19 +02:00
|
|
|
{/if}
|
2018-08-27 00:38:45 +02:00
|
|
|
{/if}
|
|
|
|
<a class="status-favs-reblogs status-reblogs"
|
2018-05-02 02:05:36 +02:00
|
|
|
href="/statuses/{originalStatusId}/reblogs"
|
|
|
|
aria-label={reblogsLabel}>
|
2018-03-16 16:42:10 +01:00
|
|
|
<svg class="status-favs-reblogs-svg">
|
2018-12-10 09:13:54 +01:00
|
|
|
<use xlink:href="#fa-retweet"/>
|
2018-02-11 00:31:26 +01:00
|
|
|
</svg>
|
2018-05-02 02:05:36 +02:00
|
|
|
<span>{numReblogs}</span>
|
2018-02-11 00:31:26 +01:00
|
|
|
</a>
|
2018-08-27 00:38:45 +02:00
|
|
|
<a class="status-favs-reblogs status-favs"
|
2018-05-02 02:05:36 +02:00
|
|
|
href="/statuses/{originalStatusId}/favorites"
|
|
|
|
aria-label={favoritesLabel}>
|
2018-03-16 16:42:10 +01:00
|
|
|
<svg class="status-favs-reblogs-svg">
|
2018-12-10 09:13:54 +01:00
|
|
|
<use xlink:href="#fa-star" />
|
2018-02-11 00:31:26 +01:00
|
|
|
</svg>
|
2018-05-02 02:05:36 +02:00
|
|
|
<span>{numFavs}</span>
|
2018-02-11 00:31:26 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<style>
|
|
|
|
.status-details {
|
|
|
|
grid-area: details;
|
|
|
|
display: grid;
|
2018-08-29 18:25:24 +02:00
|
|
|
grid-template-columns: minmax(0, max-content) repeat(3, max-content);
|
2018-02-11 00:31:26 +01:00
|
|
|
grid-gap: 20px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: left;
|
|
|
|
margin: 0 5px 10px;
|
|
|
|
}
|
|
|
|
:global(.status-absolute-date) {
|
|
|
|
font-size: 1.1em;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-absolute-date time) {
|
2018-08-27 00:38:45 +02:00
|
|
|
word-wrap: break-word;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-application) {
|
2018-02-11 00:31:26 +01:00
|
|
|
word-wrap: break-word;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: pre-wrap;
|
2018-08-27 00:38:45 +02:00
|
|
|
font-size: 1.1em;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-application, a.status-application, a.status-application:hover) {
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(a.status-application) {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-application-span {
|
|
|
|
word-wrap: break-word;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2018-02-11 00:31:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs {
|
|
|
|
font-size: 1.1em;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs span {
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs,
|
|
|
|
.status-favs-reblogs:hover,
|
|
|
|
.status-favs-reblogs:visited {
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
2018-03-16 16:42:10 +01:00
|
|
|
.status-favs-reblogs-svg {
|
2018-02-11 00:31:26 +01:00
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-absolute-date, .status-absolute-date:hover, .status-absolute-date:visited) {
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 479px) {
|
|
|
|
:global(.status-absolute-date) {
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
|
|
|
.status-favs-reblogs {
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
2018-08-27 00:38:45 +02:00
|
|
|
:global(.status-application) {
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
2018-02-11 00:31:26 +01:00
|
|
|
.status-details {
|
|
|
|
grid-gap: 5px;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
import ExternalLink from '../ExternalLink.html'
|
2018-08-27 00:38:45 +02:00
|
|
|
import { store } from '../../_store/store'
|
|
|
|
import { getDateFormatter, getShortDateFormatter } from '../../_utils/formatters'
|
2018-08-28 15:45:15 +02:00
|
|
|
import { on } from '../../_utils/eventBus'
|
2018-02-11 00:31:26 +01:00
|
|
|
|
|
|
|
export default {
|
2018-08-28 15:45:15 +02:00
|
|
|
oncreate () {
|
|
|
|
let { originalStatusId } = this.get()
|
|
|
|
on('statusUpdated', this, status => {
|
|
|
|
if (status.id === originalStatusId) {
|
|
|
|
this.set({
|
|
|
|
overrideNumReblogs: status.reblogs_count || 0,
|
|
|
|
overrideNumFavs: status.favourites_count || 0
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2018-08-27 00:38:45 +02:00
|
|
|
store: () => store,
|
2018-08-28 15:45:15 +02:00
|
|
|
data: () => ({
|
|
|
|
overrideNumReblogs: void 0,
|
|
|
|
overrideNumFavs: void 0
|
|
|
|
}),
|
2018-02-11 00:31:26 +01:00
|
|
|
computed: {
|
2018-08-28 15:45:15 +02:00
|
|
|
originalStatusId: ({ originalStatus }) => originalStatus.id,
|
2018-08-27 00:38:45 +02:00
|
|
|
application: ({ originalStatus }) => originalStatus.application,
|
2018-08-27 04:46:19 +02:00
|
|
|
applicationName: ({ application }) => (application && application.name),
|
2018-08-27 00:38:45 +02:00
|
|
|
applicationWebsite: ({ application }) => (application && application.website),
|
2018-05-02 02:05:36 +02:00
|
|
|
createdAtDate: ({ originalStatus }) => originalStatus.created_at,
|
2018-08-28 15:45:15 +02:00
|
|
|
numReblogs: ({ overrideNumReblogs, originalStatus }) => {
|
|
|
|
if (typeof overrideNumReblogs === 'number') {
|
|
|
|
return overrideNumReblogs
|
|
|
|
}
|
|
|
|
return originalStatus.reblogs_count || 0
|
|
|
|
},
|
|
|
|
numFavs: ({ overrideNumFavs, originalStatus }) => {
|
|
|
|
if (typeof overrideNumFavs === 'number') {
|
|
|
|
return overrideNumFavs
|
|
|
|
}
|
|
|
|
return originalStatus.favourites_count || 0
|
|
|
|
},
|
2018-08-27 00:38:45 +02:00
|
|
|
formattedDate: ({ createdAtDate, $isMobileSize }) => {
|
|
|
|
let formatter = $isMobileSize ? getShortDateFormatter() : getDateFormatter()
|
|
|
|
return formatter.format(new Date(createdAtDate))
|
|
|
|
},
|
2018-05-02 02:05:36 +02:00
|
|
|
reblogsLabel: ({ numReblogs }) => {
|
2018-02-22 03:39:53 +01:00
|
|
|
// TODO: intl
|
|
|
|
return numReblogs === 1
|
|
|
|
? `Boosted ${numReblogs} time`
|
|
|
|
: `Boosted ${numReblogs} times`
|
|
|
|
},
|
2018-05-02 02:05:36 +02:00
|
|
|
favoritesLabel: ({ numFavs }) => {
|
2018-02-22 03:39:53 +01:00
|
|
|
// TODO: intl
|
|
|
|
return numFavs === 1
|
|
|
|
? `Favorited ${numFavs} time`
|
|
|
|
: `Favorited ${numFavs} times`
|
|
|
|
}
|
2018-02-11 00:31:26 +01:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
ExternalLink
|
|
|
|
}
|
|
|
|
}
|
2018-12-10 09:13:54 +01:00
|
|
|
</script>
|