mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-03 02:18:44 +00:00
Add search page
This commit is contained in:
parent
591360f2a8
commit
14bb18fbc7
10 changed files with 157 additions and 14 deletions
|
@ -61,10 +61,10 @@ type NotificationData struct {
|
|||
|
||||
type UserData struct {
|
||||
*CommonData
|
||||
User *mastodon.Account
|
||||
Statuses []*mastodon.Status
|
||||
HasNext bool
|
||||
NextLink string
|
||||
User *mastodon.Account
|
||||
Statuses []*mastodon.Status
|
||||
HasNext bool
|
||||
NextLink string
|
||||
}
|
||||
|
||||
type AboutData struct {
|
||||
|
@ -73,19 +73,29 @@ type AboutData struct {
|
|||
|
||||
type EmojiData struct {
|
||||
*CommonData
|
||||
Emojis []*mastodon.Emoji
|
||||
Emojis []*mastodon.Emoji
|
||||
}
|
||||
|
||||
type LikedByData struct {
|
||||
*CommonData
|
||||
Users []*mastodon.Account
|
||||
HasNext bool
|
||||
NextLink string
|
||||
Users []*mastodon.Account
|
||||
HasNext bool
|
||||
NextLink string
|
||||
}
|
||||
|
||||
type RetweetedByData struct {
|
||||
*CommonData
|
||||
Users []*mastodon.Account
|
||||
HasNext bool
|
||||
NextLink string
|
||||
Users []*mastodon.Account
|
||||
HasNext bool
|
||||
NextLink string
|
||||
}
|
||||
|
||||
type SearchData struct {
|
||||
*CommonData
|
||||
Q string
|
||||
Type string
|
||||
Users []*mastodon.Account
|
||||
Statuses []*mastodon.Status
|
||||
HasNext bool
|
||||
NextLink string
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ type Renderer interface {
|
|||
RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiData) (err error)
|
||||
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)
|
||||
}
|
||||
|
||||
type renderer struct {
|
||||
|
@ -91,6 +92,10 @@ func (r *renderer) RenderRetweetedByPage(ctx context.Context, writer io.Writer,
|
|||
return r.template.ExecuteTemplate(writer, "retweetedby.tmpl", data)
|
||||
}
|
||||
|
||||
func (r *renderer) RenderSearchPage(ctx context.Context, writer io.Writer, data *SearchData) (err error) {
|
||||
return r.template.ExecuteTemplate(writer, "search.tmpl", data)
|
||||
}
|
||||
|
||||
func EmojiFilter(content string, emojis []mastodon.Emoji) string {
|
||||
var replacements []string
|
||||
for _, e := range emojis {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue