mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-26 17:03:01 +00:00
Show status numbers
This commit is contained in:
parent
b5ca78a2e6
commit
eb3bc15da9
@ -52,8 +52,8 @@ type Status struct {
|
|||||||
// Custom fields
|
// Custom fields
|
||||||
Pleroma StatusPleroma `json:"pleroma"`
|
Pleroma StatusPleroma `json:"pleroma"`
|
||||||
ShowReplies bool `json:"show_replies"`
|
ShowReplies bool `json:"show_replies"`
|
||||||
ReplyMap map[string][]ReplyInfo `json:"reply_map"`
|
IDReplies map[string][]ReplyInfo `json:"id_replies"`
|
||||||
ReplyNumber int `json:"reply_number"`
|
IDNumbers map[string]int `json:"id_numbers"`
|
||||||
RetweetedByID string `json:"retweeted_by_id"`
|
RetweetedByID string `json:"retweeted_by_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,12 +342,16 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
|
|||||||
|
|
||||||
statuses := append(append(context.Ancestors, status), context.Descendants...)
|
statuses := append(append(context.Ancestors, status), context.Descendants...)
|
||||||
replies := make(map[string][]mastodon.ReplyInfo)
|
replies := make(map[string][]mastodon.ReplyInfo)
|
||||||
|
idNumbers := make(map[string]int)
|
||||||
|
|
||||||
for i := range statuses {
|
for i := range statuses {
|
||||||
statuses[i].ShowReplies = true
|
statuses[i].ShowReplies = true
|
||||||
statuses[i].ReplyMap = replies
|
|
||||||
statuses[i].ReplyNumber = i
|
statuses[i].IDNumbers = idNumbers
|
||||||
addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i+1)
|
idNumbers[statuses[i].ID] = i + 1
|
||||||
|
|
||||||
|
statuses[i].IDReplies = replies
|
||||||
|
addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
commonData := svc.getCommonData(c, "post by "+status.Account.DisplayName)
|
commonData := svc.getCommonData(c, "post by "+status.Account.DisplayName)
|
||||||
|
@ -438,6 +438,7 @@ img.emoji {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
border: 1px solid #aaaaaa;
|
border: 1px solid #aaaaaa;
|
||||||
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-container:hover .more-content {
|
.more-container:hover .more-content {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="more-container">
|
<div class="more-container">
|
||||||
<div class="remote-link">
|
<div class="remote-link">
|
||||||
{{.Visibility}}
|
{{if .IDNumbers}}#{{index .IDNumbers .ID}}{{end}} {{.Visibility}}
|
||||||
</div>
|
</div>
|
||||||
<div class="more-content">
|
<div class="more-content">
|
||||||
<a class="more-link" href="{{.URL}}" target="_blank">
|
<a class="more-link" href="{{.URL}}" target="_blank">
|
||||||
@ -56,14 +56,14 @@
|
|||||||
{{if .InReplyToID}}
|
{{if .InReplyToID}}
|
||||||
<div class="status-reply-to">
|
<div class="status-reply-to">
|
||||||
<a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}">
|
<a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}">
|
||||||
in reply to {{if .Pleroma.InReplyToAccountAcct}}{{.Pleroma.InReplyToAccountAcct}}{{else if .ReplyNumber}}#{{.ReplyNumber}}{{else}}{{.InReplyToID}}{{end}}
|
in reply to {{if .IDNumbers}}#{{index .IDNumbers .InReplyToID}}{{end}} {{if .Pleroma.InReplyToAccountAcct}}{{.Pleroma.InReplyToAccountAcct}}{{else if not .IDNumbers}}{{.InReplyToID}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{if index .ReplyMap .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
|
{{if index .IDReplies .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .ShowReplies}}
|
{{if .ShowReplies}}
|
||||||
{{if index .ReplyMap .ID}} <span class="status-reply-text"> replies: </span> {{end}}
|
{{if index .IDReplies .ID}} <span class="status-reply-text"> replies: </span> {{end}}
|
||||||
{{range index .ReplyMap .ID}}
|
{{range index .IDReplies .ID}}
|
||||||
<div class="status-reply">
|
<div class="status-reply">
|
||||||
<a class="status-reply-link" href="#status-{{.ID}}">#{{.Number}}</a>
|
<a class="status-reply-link" href="#status-{{.ID}}">#{{.Number}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user