mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-06 03:48:45 +00:00
Added page about instance
This commit is contained in:
parent
fe304f60e9
commit
7dd90ac015
7 changed files with 81 additions and 0 deletions
|
@ -737,6 +737,19 @@ func (s *service) AboutPage(c *client) (err error) {
|
|||
return s.renderer.Render(c.rctx, c.w, renderer.AboutPage, data)
|
||||
}
|
||||
|
||||
func (s *service) AboutInstance(c *client) (err error) {
|
||||
cdata := s.cdata(c, "about", 0, 0, "")
|
||||
instance, err := c.GetInstance(c.ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
data := &renderer.AboutInstanceData{
|
||||
CommonData: cdata,
|
||||
Instance: instance,
|
||||
}
|
||||
return s.renderer.Render(c.rctx, c.w, renderer.AboutInstance, data)
|
||||
}
|
||||
|
||||
func (s *service) EmojiPage(c *client) (err error) {
|
||||
emojis, err := c.GetInstanceEmojis(c.ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -220,6 +220,10 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
|||
aboutPage := handle(func(c *client) error {
|
||||
return s.AboutPage(c)
|
||||
}, SESSION, HTML)
|
||||
|
||||
aboutInstance := handle(func(c *client) error {
|
||||
return s.AboutInstance(c)
|
||||
}, SESSION, HTML)
|
||||
|
||||
emojisPage := handle(func(c *client) error {
|
||||
return s.EmojiPage(c)
|
||||
|
@ -721,6 +725,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
|||
r.HandleFunc("/user/{id}/{type}", userPage).Methods(http.MethodGet)
|
||||
r.HandleFunc("/usersearch/{id}", userSearchPage).Methods(http.MethodGet)
|
||||
r.HandleFunc("/about", aboutPage).Methods(http.MethodGet)
|
||||
r.HandleFunc("/aboutinstance", aboutInstance).Methods(http.MethodGet)
|
||||
r.HandleFunc("/emojis", emojisPage).Methods(http.MethodGet)
|
||||
r.HandleFunc("/search", searchPage).Methods(http.MethodGet)
|
||||
r.HandleFunc("/settings", settingsPage).Methods(http.MethodGet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue