aboutsummaryrefslogtreecommitdiff
path: root/renderer
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-29 03:43:57 +0000
committerr <r@freesoftwareextremist.com>2019-12-29 03:43:57 +0000
commit72dbe50341179d345f8cbd1bf5a97809037db364 (patch)
treee11659a1178179ccbe7e88b794b280cb225746a2 /renderer
parentb9d7eb05beb57926181f91685a75b3069d1f8cf8 (diff)
downloadbloat-72dbe50341179d345f8cbd1bf5a97809037db364.tar.gz
bloat-72dbe50341179d345f8cbd1bf5a97809037db364.zip
Add following and followers page
Diffstat (limited to 'renderer')
-rw-r--r--renderer/model.go14
-rw-r--r--renderer/renderer.go10
2 files changed, 24 insertions, 0 deletions
diff --git a/renderer/model.go b/renderer/model.go
index 12fa90f..3d344b4 100644
--- a/renderer/model.go
+++ b/renderer/model.go
@@ -90,6 +90,20 @@ type RetweetedByData struct {
NextLink string
}
+type FollowingData struct {
+ *CommonData
+ Users []*mastodon.Account
+ HasNext bool
+ NextLink string
+}
+
+type FollowersData struct {
+ *CommonData
+ Users []*mastodon.Account
+ HasNext bool
+ NextLink string
+}
+
type SearchData struct {
*CommonData
Q string
diff --git a/renderer/renderer.go b/renderer/renderer.go
index a46cfd2..efc412d 100644
--- a/renderer/renderer.go
+++ b/renderer/renderer.go
@@ -23,6 +23,8 @@ type Renderer interface {
RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiData) (err error)
RenderLikedByPage(ctx context.Context, writer io.Writer, data *LikedByData) (err error)
RenderRetweetedByPage(ctx context.Context, writer io.Writer, data *RetweetedByData) (err error)
+ RenderFollowingPage(ctx context.Context, writer io.Writer, data *FollowingData) (err error)
+ RenderFollowersPage(ctx context.Context, writer io.Writer, data *FollowersData) (err error)
RenderSearchPage(ctx context.Context, writer io.Writer, data *SearchData) (err error)
RenderSettingsPage(ctx context.Context, writer io.Writer, data *SettingsData) (err error)
}
@@ -93,6 +95,14 @@ func (r *renderer) RenderRetweetedByPage(ctx context.Context, writer io.Writer,
return r.template.ExecuteTemplate(writer, "retweetedby.tmpl", data)
}
+func (r *renderer) RenderFollowingPage(ctx context.Context, writer io.Writer, data *FollowingData) (err error) {
+ return r.template.ExecuteTemplate(writer, "following.tmpl", data)
+}
+
+func (r *renderer) RenderFollowersPage(ctx context.Context, writer io.Writer, data *FollowersData) (err error) {
+ return r.template.ExecuteTemplate(writer, "followers.tmpl", data)
+}
+
func (r *renderer) RenderSearchPage(ctx context.Context, writer io.Writer, data *SearchData) (err error) {
return r.template.ExecuteTemplate(writer, "search.tmpl", data)
}