diff options
| author | r <r@freesoftwareextremist.com> | 2019-12-21 05:48:48 +0000 | 
|---|---|---|
| committer | r <r@freesoftwareextremist.com> | 2019-12-21 05:48:48 +0000 | 
| commit | 2648484a1de4443fdb748edb144c90c4a7a37472 (patch) | |
| tree | 1bc612d580501ea57688b845f50c5e7bd908c70d /service/service.go | |
| parent | 889f8da49637e908f203d6d9d195f7d585f8cd03 (diff) | |
| download | bloat-2648484a1de4443fdb748edb144c90c4a7a37472.tar.gz bloat-2648484a1de4443fdb748edb144c90c4a7a37472.zip | |
Add about page
Diffstat (limited to 'service/service.go')
| -rw-r--r-- | service/service.go | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/service/service.go b/service/service.go index 63f74d3..4d74449 100644 --- a/service/service.go +++ b/service/service.go @@ -33,6 +33,7 @@ type Service interface {  	ServeThreadPage(ctx context.Context, client io.Writer, c *mastodon.Client, id string, reply bool) (err error)  	ServeNotificationPage(ctx context.Context, client io.Writer, c *mastodon.Client, maxID string, minID string) (err error)  	ServeUserPage(ctx context.Context, client io.Writer, c *mastodon.Client, id string, maxID string, minID string) (err error) +	ServeAboutPage(ctx context.Context, client io.Writer, c *mastodon.Client) (err error)  	Like(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error)  	UnLike(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error)  	Retweet(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error) @@ -411,6 +412,21 @@ func (svc *service) ServeUserPage(ctx context.Context, client io.Writer, c *mast  	return  } +func (svc *service) ServeAboutPage(ctx context.Context, client io.Writer, c *mastodon.Client) (err error) { +	navbarData, err := svc.getNavbarTemplateData(ctx, client, c) +	if err != nil { +		return +	} + +	data := renderer.NewAboutPageTemplateData(navbarData) +	err = svc.renderer.RenderAboutPage(ctx, client, data) +	if err != nil { +		return +	} + +	return +} +  func (svc *service) getNavbarTemplateData(ctx context.Context, client io.Writer, c *mastodon.Client) (data *renderer.NavbarTemplateData, err error) {  	notifications, err := c.GetNotifications(ctx, nil)  	if err != nil { | 
