diff options
author | r <r@freesoftwareextremist.com> | 2019-12-22 18:10:42 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2019-12-22 18:10:42 +0000 |
commit | 08cc2a6adeb591c687d68c22bac9bc5b5f9f62b6 (patch) | |
tree | fb4a475f9328b2d27f19c8e63ad2b56f7eb9980b /renderer | |
parent | 967a9c954e9709d57e860b8ea5c4e7f495402848 (diff) | |
download | bloat-08cc2a6adeb591c687d68c22bac9bc5b5f9f62b6.tar.gz bloat-08cc2a6adeb591c687d68c22bac9bc5b5f9f62b6.zip |
Add emojis page
Diffstat (limited to 'renderer')
-rw-r--r-- | renderer/model.go | 12 | ||||
-rw-r--r-- | renderer/renderer.go | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/renderer/model.go b/renderer/model.go index 9380b7f..2719dbe 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -97,3 +97,15 @@ func NewAboutPageTemplateData(navbarData *NavbarTemplateData) *AboutPageTemplate NavbarData: navbarData, } } + +type EmojiPageTemplateData struct { + NavbarData *NavbarTemplateData + Emojis []*mastodon.Emoji +} + +func NewEmojiPageTemplateData(navbarData *NavbarTemplateData, emojis []*mastodon.Emoji) *EmojiPageTemplateData { + return &EmojiPageTemplateData{ + NavbarData: navbarData, + Emojis: emojis, + } +} diff --git a/renderer/renderer.go b/renderer/renderer.go index 8009d99..4415b0b 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -20,6 +20,7 @@ type Renderer interface { RenderNotificationPage(ctx context.Context, writer io.Writer, data *NotificationPageTemplateData) (err error) RenderUserPage(ctx context.Context, writer io.Writer, data *UserPageTemplateData) (err error) RenderAboutPage(ctx context.Context, writer io.Writer, data *AboutPageTemplateData) (err error) + RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiPageTemplateData) (err error) } type renderer struct { @@ -76,6 +77,10 @@ func (r *renderer) RenderAboutPage(ctx context.Context, writer io.Writer, data * return r.template.ExecuteTemplate(writer, "about.tmpl", data) } +func (r *renderer) RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiPageTemplateData) (err error) { + return r.template.ExecuteTemplate(writer, "emoji.tmpl", data) +} + func EmojiFilter(content string, emojis []mastodon.Emoji) string { var replacements []string for _, e := range emojis { |