mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-09 21:38:45 +00:00
Add about page
This commit is contained in:
parent
889f8da496
commit
2648484a1d
8 changed files with 75 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue