Add mutes list
authorr <r@freesoftwareextremist.com>
Sun, 27 Sep 2020 09:44:52 +0000 (09:44 +0000)
committerr <r@freesoftwareextremist.com>
Sun, 27 Sep 2020 09:45:48 +0000 (09:45 +0000)
service/service.go
templates/user.tmpl

index de450b94a1685653e7d7502e8f0f9269ac3fcdc8..f268e30e04c0795687b2ab5a09c98cd52e6f5ac8 100644 (file)
@@ -517,6 +517,18 @@ func (svc *service) ServeUserPage(c *model.Client, id string, pageType string,
                        nextLink = fmt.Sprintf("/user/%s/bookmarks?max_id=%s",
                                id, pg.MaxID)
                }
+       case "mutes":
+               if !isCurrent {
+                       return errInvalidArgument
+               }
+               users, err = c.GetMutes(ctx, &pg)
+               if err != nil {
+                       return
+               }
+               if len(users) == 20 && len(pg.MaxID) > 0 {
+                       nextLink = fmt.Sprintf("/user/%s/mutes?max_id=%s",
+                               id, pg.MaxID)
+               }
        default:
                return errInvalidArgument
        }
index 3bb7523781236ac814fd5366e631129e1f6c6034..ce91091bf418eb6b796ce64cc6aefe9fd969b46e 100644 (file)
@@ -99,7 +99,8 @@
                </div>
                {{if .IsCurrent}}
                <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>
                </div>
                {{end}}
                <div>
 {{else}}
 <div class="no-data-found">No data found</div>
 {{end}}
+
+{{else if eq .Type "mutes"}}
+<div class="page-title"> Mutes </div>
+{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
 {{end}}
 
 <div class="pagination">