Add blocks list

This commit is contained in:
r 2020-09-27 09:50:04 +00:00
parent 0df863ac40
commit 59692b7155
2 changed files with 18 additions and 1 deletions

View file

@ -529,6 +529,18 @@ func (svc *service) ServeUserPage(c *model.Client, id string, pageType string,
nextLink = fmt.Sprintf("/user/%s/mutes?max_id=%s", nextLink = fmt.Sprintf("/user/%s/mutes?max_id=%s",
id, pg.MaxID) id, pg.MaxID)
} }
case "blocks":
if !isCurrent {
return errInvalidArgument
}
users, err = c.GetBlocks(ctx, &pg)
if err != nil {
return
}
if len(users) == 20 && len(pg.MaxID) > 0 {
nextLink = fmt.Sprintf("/user/%s/blocks?max_id=%s",
id, pg.MaxID)
}
default: default:
return errInvalidArgument return errInvalidArgument
} }

View file

@ -100,7 +100,8 @@
{{if .IsCurrent}} {{if .IsCurrent}}
<div> <div>
<a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> - <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> -
<a href="/user/{{.User.ID}}/mutes"> mutes </a> <a href="/user/{{.User.ID}}/mutes"> mutes </a> -
<a href="/user/{{.User.ID}}/blocks"> blocks </a>
</div> </div>
{{end}} {{end}}
<div> <div>
@ -148,6 +149,10 @@
{{else if eq .Type "mutes"}} {{else if eq .Type "mutes"}}
<div class="page-title"> Mutes </div> <div class="page-title"> Mutes </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} {{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{else if eq .Type "blocks"}}
<div class="page-title"> Blocks </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{end}} {{end}}
<div class="pagination"> <div class="pagination">