aboutsummaryrefslogtreecommitdiff
path: root/renderer
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-27 08:06:43 +0000
committerr <r@freesoftwareextremist.com>2019-12-27 08:09:40 +0000
commitb9d7eb05beb57926181f91685a75b3069d1f8cf8 (patch)
tree1aa0b5a28fd8cc0c3fc425c227eb747d8528c910 /renderer
parent14bb18fbc7e6cdea57f27a44093d645d97bacb64 (diff)
downloadbloat-b9d7eb05beb57926181f91685a75b3069d1f8cf8.tar.gz
bloat-b9d7eb05beb57926181f91685a75b3069d1f8cf8.zip
Add settings page
Diffstat (limited to 'renderer')
-rw-r--r--renderer/model.go15
-rw-r--r--renderer/renderer.go5
2 files changed, 15 insertions, 5 deletions
diff --git a/renderer/model.go b/renderer/model.go
index ffeb2d1..12fa90f 100644
--- a/renderer/model.go
+++ b/renderer/model.go
@@ -92,10 +92,15 @@ type RetweetedByData struct {
type SearchData struct {
*CommonData
- Q string
- Type string
- Users []*mastodon.Account
- Statuses []*mastodon.Status
- HasNext bool
+ Q string
+ Type string
+ Users []*mastodon.Account
+ Statuses []*mastodon.Status
+ HasNext bool
NextLink string
}
+
+type SettingsData struct {
+ *CommonData
+ Settings *model.Settings
+}
diff --git a/renderer/renderer.go b/renderer/renderer.go
index 5e5f005..a46cfd2 100644
--- a/renderer/renderer.go
+++ b/renderer/renderer.go
@@ -24,6 +24,7 @@ type Renderer interface {
RenderLikedByPage(ctx context.Context, writer io.Writer, data *LikedByData) (err error)
RenderRetweetedByPage(ctx context.Context, writer io.Writer, data *RetweetedByData) (err error)
RenderSearchPage(ctx context.Context, writer io.Writer, data *SearchData) (err error)
+ RenderSettingsPage(ctx context.Context, writer io.Writer, data *SettingsData) (err error)
}
type renderer struct {
@@ -96,6 +97,10 @@ func (r *renderer) RenderSearchPage(ctx context.Context, writer io.Writer, data
return r.template.ExecuteTemplate(writer, "search.tmpl", data)
}
+func (r *renderer) RenderSettingsPage(ctx context.Context, writer io.Writer, data *SettingsData) (err error) {
+ return r.template.ExecuteTemplate(writer, "settings.tmpl", data)
+}
+
func EmojiFilter(content string, emojis []mastodon.Emoji) string {
var replacements []string
for _, e := range emojis {