Show retweet info in status

This commit is contained in:
r 2019-12-14 10:57:14 +00:00
parent 3847954687
commit 59eaff9512
2 changed files with 91 additions and 55 deletions

View File

@ -1,6 +1,9 @@
.status-container-container {
margin: 16px 0;
}
.status-container { .status-container {
display: flex; display: flex;
margin: 16px 0;
} }
.status-content { .status-content {
@ -107,3 +110,22 @@
.signin-form input { .signin-form input {
margin: 4px 0; margin: 4px 0;
} }
.retweet-info {
margin: 8px 0 4px 24px;
}
.retweet-info .status-profile-img {
height: 24px;
width: 24px;
margin-bottom: -8px;
object-fit: contain;
}
.retweet-info .status-dname{
margin-left: 4px
}
.retweet-info .icon.dripicons-retweet.retweeted {
vertical-align: sub;
}

View File

@ -1,64 +1,78 @@
<div class="status-container"> <div class="status-container-container">
<div> {{if .Reblog}}
<div class="retweet-info">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
<span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span>
<span class="icon dripicons-retweet retweeted"></span>
repeated
</div> </div>
<div class="status"> {{template "status" .Reblog}}
<div class="status-name"> {{else}}
<span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span> {{block "status" .}}
<span class="status-uname"> {{.Account.Acct}} </span> <div class="status-container">
<div>
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</div> </div>
<div class="status-content"> {{WithEmojis .Content .Emojis}} </div> <div class="status">
<div class="status-media-container"> <div class="status-name">
{{range .MediaAttachments}} <span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span>
{{if eq .Type "image"}} <span class="status-uname"> {{.Account.Acct}} </span>
<a href="{{.URL}}" target="_blank"> </div>
<img class="status-image" src="{{.URL}}" alt="status-image" /> <div class="status-content"> {{WithEmojis .Content .Emojis}} </div>
</a> <div class="status-media-container">
{{else if eq .Type "audio"}} {{range .MediaAttachments}}
<audio class="status-audio" controls preload="none"> {{if eq .Type "image"}}
<source src="{{.URL}}"> <a href="{{.URL}}" target="_blank">
<p> Your browser doesn't support HTML5 audio </p> <img class="status-image" src="{{.URL}}" alt="status-image" />
</audio>
{{else if eq .Type "video"}}
<video class="status-video" controls preload="none">
<source src="{{.URL}}">
<p> Your browser doesn't support HTML5 video </p>
</video>
{{else}}
<a href="{{.URL}}" target="_blank"> attachment </a>
{{end}}
{{end}}
</div>
<div class="status-action">
<a class="status-you" href="/thread/{{.ID}}?reply=true" title="reply">
<span class="icon dripicons-reply"></span>
<span> {{DisplayInteractionCount .RepliesCount}} </span>
</a>
{{if .Reblogged}}
<a class="status-retweet" href="/unretweet/{{.ID}}" title="undo repost">
<span class="icon dripicons-retweet retweeted"></span>
<span> {{DisplayInteractionCount .ReblogsCount}} </span>
</a> </a>
{{else if eq .Type "audio"}}
<audio class="status-audio" controls preload="none">
<source src="{{.URL}}">
<p> Your browser doesn't support HTML5 audio </p>
</audio>
{{else if eq .Type "video"}}
<video class="status-video" controls preload="none">
<source src="{{.URL}}">
<p> Your browser doesn't support HTML5 video </p>
</video>
{{else}} {{else}}
<a class="status-retweet" href="/retweet/{{.ID}}" title="repost"> <a href="{{.URL}}" target="_blank"> attachment </a>
<span class="icon dripicons-retweet"></span>
<span> {{DisplayInteractionCount .ReblogsCount}} </span>
</a>
{{end}} {{end}}
{{if .Favourited}}
<a class="status-like" href="/unlike/{{.ID}}" title="unlike">
<span class="icon dripicons-star liked"></span>
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
</a>
{{else}}
<a class="status-like" href="/like/{{.ID}}" title="like">
<span class="icon dripicons-star"></span>
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
</a>
{{end}} {{end}}
<a class="status-time" href="/thread/{{.ID}}"> </div>
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{.CreatedAt}}"> {{TimeSince .CreatedAt}} </time> <div class="status-action">
</a> <a class="status-you" href="/thread/{{.ID}}?reply=true" title="reply">
<span class="icon dripicons-reply"></span>
<span> {{DisplayInteractionCount .RepliesCount}} </span>
</a>
{{if .Reblogged}}
<a class="status-retweet" href="/unretweet/{{.ID}}" title="undo repost">
<span class="icon dripicons-retweet retweeted"></span>
<span> {{DisplayInteractionCount .ReblogsCount}} </span>
</a>
{{else}}
<a class="status-retweet" href="/retweet/{{.ID}}" title="repost">
<span class="icon dripicons-retweet"></span>
<span> {{DisplayInteractionCount .ReblogsCount}} </span>
</a>
{{end}}
{{if .Favourited}}
<a class="status-like" href="/unlike/{{.ID}}" title="unlike">
<span class="icon dripicons-star liked"></span>
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
</a>
{{else}}
<a class="status-like" href="/like/{{.ID}}" title="like">
<span class="icon dripicons-star"></span>
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
</a>
{{end}}
<a class="status-time" href="/thread/{{.ID}}">
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{.CreatedAt}}"> {{TimeSince .CreatedAt}} </time>
</a>
</div>
</div> </div>
</div> </div>
{{end}}
{{end}}
</div> </div>