fix links in statuses

This commit is contained in:
Nolan Lawson 2018-01-28 17:10:03 -08:00
parent 9d42970493
commit cda9566eb0
4 changed files with 46 additions and 12 deletions

View file

@ -6,7 +6,9 @@
<img src="{{profile.avatar}}" aria-hidden="true">
</div>
<div class="account-profile-name">
<a rel="noopener" target="_blank" href="{{profile.url}}">
{{profile.display_name}}
</a>
</div>
<div class="account-profile-username">
{{'@' + profile.acct}}
@ -127,6 +129,14 @@
text-overflow: ellipsis;
min-width: 0;
}
.account-profile-name a {
color: var(--body-text-color);
text-decoration: none;
}
.account-profile-name a:hover {
color: var(--body-text-color);
text-decoration: underline;
}
.account-profile-note {
grid-area: note;
padding: 10px 0;

View file

@ -7,22 +7,37 @@
<use xlink:href="#fa-retweet" />
</svg>
<span>
<a href="/accounts/{{status.account.id}}">
{{status.account.username}}
</a> boosted
{{#if timelineType === 'account' && timelineValue === status.account.id}}
<a rel="noopener" target="_blank" href="{{status.account.url}}">{{status.account.username}}</a>
{{else}}
<a href="/accounts/{{status.account.id}}">{{status.account.username}}</a>
{{/if}}
boosted
</span>
</div>
{{/if}}
<div class="status-author">
{{#if timelineType === 'account' && timelineValue === originalAccount.id}}
<a class="status-author-name" rel="noopener" target="_blank" href="{{originalAccount.url}}">
{{originalAccount.display_name || originalAccount.username}}
</a>
{{else}}
<a class="status-author-name" href="/accounts/{{originalAccount.id}}">
{{originalAccount.display_name || originalAccount.username}}
</a>
{{/if}}
<span class="status-author-handle">
{{'@' + originalAccount.acct}}
</span>
{{#if timelineType === 'status'}}
<a class="status-author-date" rel="noopener" target="_blank" href="{{originalStatus.url}}">
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time>
</a>
{{else}}
<a class="status-author-date" href="/statuses/{{originalStatus.id}}">
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time>
</a>
{{/if}}
</div>
<Avatar account={{originalAccount}} className="status-sidebar"/>
{{#if originalStatus.spoiler_text}}

View file

@ -1,4 +1,9 @@
<Status status="{{virtualProps}}" index="{{virtualIndex}}" length="{{virtualLength}}" on:recalculateHeight />
<Status status="{{virtualProps.status}}"
timelineType="{{virtualProps.timelineType}}"
timelineValue="{{virtualProps.timelineValue}}"
index="{{virtualIndex}}"
length="{{virtualLength}}"
on:recalculateHeight />
<script>
import Status from '../status/Status.html'

View file

@ -33,7 +33,11 @@
LoadingFooter: LoadingFooter
}),
computed: {
makeProps: ($currentInstance) => (statusId) => database.getStatus($currentInstance, statusId),
makeProps: ($currentInstance, timelineType, timelineValue) => async (statusId) => ({
timelineType: timelineType,
timelineValue: timelineValue,
status: await database.getStatus($currentInstance, statusId)
}),
label: (timeline, $currentInstance, timelineType, timelineValue) => {
if (timelines[timeline]) {
return `${timelines[timeline].label} timeline for ${$currentInstance}`