Fix retweet button for private/direct post

This commit is contained in:
r 2021-05-30 06:59:34 +00:00
parent 045be151bd
commit 07978649f1
1 changed files with 2 additions and 7 deletions

View File

@ -193,24 +193,19 @@
</a> </a>
</div> </div>
<div class="status-action"> <div class="status-action">
{{if or (eq .Visibility "private") (eq .Visibility "direct")}}
<a class="status-retweet" href="" title="this status cannot be retweeted">
retweet
</a>
{{else}}
{{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}} {{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}}
<form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self"> <form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}"> <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
<input type="submit" value="{{$rt}}" class="btn-link"> <input type="submit" value="{{$rt}}" class="btn-link"
{{if or (eq .Visibility "private") (eq .Visibility "direct")}}title="this status cannot be retweeted" disabled{{end}}>
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list"> <a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
{{if and (not $.Ctx.AntiDopamineMode) .ReblogsCount}} {{if and (not $.Ctx.AntiDopamineMode) .ReblogsCount}}
({{DisplayInteractionCount .ReblogsCount}}) ({{DisplayInteractionCount .ReblogsCount}})
{{end}} {{end}}
</a> </a>
</form> </form>
{{end}}
</div> </div>
<div class="status-action"> <div class="status-action">
{{$like := "like"}} {{if .Favourited}} {{$like = "unlike"}} {{end}} {{$like := "like"}} {{if .Favourited}} {{$like = "unlike"}} {{end}}