render

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigninPageTmpl       = "signin.tmpl"
	ErrorPageTmpl        = "error.tmpl"
	NavPageTmpl          = "nav.tmpl"
	RootPageTmpl         = "root.tmpl"
	TimelinePageTmpl     = "timeline.tmpl"
	ListsPageTmpl        = "lists.tmpl"
	ListPageTmpl         = "list.tmpl"
	ThreadPageTmpl       = "thread.tmpl"
	QuickReplyPageTmpl   = "quickreply.tmpl"
	NotificationPageTmpl = "notification.tmpl"
	UserPageTmpl         = "user.tmpl"
	UserSearchPageTmpl   = "usersearch.tmpl"
	AboutPageTmpl        = "about.tmpl"
	EmojiPageTmpl        = "emoji.tmpl"
	LikedByPageTmpl      = "likedby.tmpl"
	RetweetedByPageTmpl  = "retweetedby.tmpl"
	ReactionsPageTmpl    = "reactions.tmpl"
	SearchPageTmpl       = "search.tmpl"
	SettingsPageTmpl     = "settings.tmpl"
	FiltersPageTmpl      = "filters.tmpl"
	MutePageTmpl         = "mute.tmpl"
	StatusEditsTmpl      = "statusedits.tmpl"
)
View Source
const (
	UserPageStatuses  userPageType = "statuses"
	UserPagePinned    userPageType = "pinned"
	UserPageMedia     userPageType = "media"
	UserPageFollowers userPageType = "followers"
	UserPageFollowing userPageType = "following"
	UserPageBookmarks userPageType = "bookmarks"
	UserPageMutes     userPageType = "mutes"
	UserPageBlocks    userPageType = "blocks"
	UserPageLikes     userPageType = "likes"
	UserPageRequests  userPageType = "requests"
)

Variables

This section is empty.

Functions

func AboutPage

func AboutPage(rctx *Context) (err error)

func EditsPage

func EditsPage(rctx *Context, history []*masta.StatusHistory, current *masta.Status) error

func EmojiPage

func EmojiPage(rctx *Context, ems []*masta.Emoji) (err error)

func ErrorPage

func ErrorPage(rctx *Context, err error, retry bool) error

func FiltersPage

func FiltersPage(rctx *Context, filters []*masta.Filter) (err error)

func LikedByPage

func LikedByPage(rctx *Context, likers []*masta.Account) (err error)

func ListPage

func ListPage(rctx *Context, data *ListData) error

func ListsPage

func ListsPage(rctx *Context, lists []*masta.List) error

func MutePage

func MutePage(rctx *Context, acct *masta.Account) (err error)
func NavPage(rctx *Context, user *masta.Account) (err error)

func NotificationPage

func NotificationPage(rctx *Context, notifs []*masta.Notification) (err error)

func QuickReplyPage

func QuickReplyPage(rctx *Context, replyee *masta.Status, parent *masta.Status) (err error)

func ReactionsPage

func ReactionsPage(rctx *Context, reactions []masta.EmojiReaction) (err error)

func RetweetedByPage

func RetweetedByPage(rctx *Context, retweeters []*masta.Account) (err error)

func RootPage

func RootPage(rctx *Context) (err error)

func SearchPage

func SearchPage(rctx *Context, results *masta.Results, q string, qType string, offset int) (err error)

func SettingsPage

func SettingsPage(rctx *Context) (err error)

func SigninPage

func SigninPage(rctx *Context) error

func ThreadPage

func ThreadPage(rctx *Context, status *masta.Status, context *masta.Context, mutate bool, src *masta.Source) (err error)

func TimelinePage

func TimelinePage(rctx *Context, data *TimelineData) error

We don't abstract this stuff away that much because there's too many transport-level details and too little data reshuffling for the templating.

func UserPage

func UserPage[up userPageEntry](rctx *Context, user *masta.Account, rel *masta.Relationship, pdata up, page userPageType) (err error)

func UserSearchPage

func UserSearchPage(rctx *Context, offset int, res *masta.Results, acct *masta.Account, query string) (err error)

Types

type Context

type Context struct {
	Settings   Settings
	CSRFToken  string
	UserID     string
	Referrer   string
	W          io.Writer
	Pagination *masta.Pagination
	Conf       *conf.Configuration
	// contains filtered or unexported fields
}

func (*Context) Count

func (c *Context) Count() int

func (*Context) Next

func (c *Context) Next() string

func (*Context) RefreshInterval

func (c *Context) RefreshInterval() int

func (*Context) Target

func (c *Context) Target() string

func (*Context) Title

func (c *Context) Title() string

type EditContext

type EditContext struct {
	Source *masta.Source
	Status *masta.Status
}

type EmojiData

type EmojiData struct {
	Emojis []*masta.Emoji
}

type ErrorData

type ErrorData struct {
	*Context
	Err        string
	Retry      bool
	SessionErr bool
}

type FiltersData

type FiltersData struct {
	Filters []*masta.Filter
}

type HomePageData

type HomePageData struct {
	*Context
}

type LikedByData

type LikedByData struct {
	Users    []*masta.Account
	NextLink string
}

type ListData

type ListData struct {
	List           *masta.List
	Accounts       []*masta.Account
	Q              string
	SearchAccounts []*masta.Account
}

type ListsData

type ListsData struct {
	*Context
	Lists []*masta.List
}

type MuteData

type MuteData struct {
	User *masta.Account
}
type NavData struct {
	Context     *Context
	User        *masta.Account
	PostContext PostContext
}

type NotificationData

type NotificationData struct {
	Notifications []*masta.Notification
	UnmarkedCount int
	ReadID        string
	NextLink      string
}

type Page

type Page string

type PostContext

type PostContext struct {
	DefaultVisibility string
	DefaultFormat     string
	ReplyContext      *ReplyContext
	EditContext       *EditContext
	Formats           []conf.PostFormat
}

type QuickReplyData

type QuickReplyData struct {
	Ancestor    *masta.Status
	Status      *masta.Status
	PostContext PostContext
}

type ReactionsData

type ReactionsData struct {
	Reactions []masta.EmojiReaction
}

type ReplyContext

type ReplyContext struct {
	InReplyToID        string
	InReplyToName      string
	QuickReply         bool
	ReplyContent       string
	ReplySubjectHeader string
	ForceVisibility    bool
}

func (*ReplyContext) ReifiedSubjectHeader

func (r *ReplyContext) ReifiedSubjectHeader() string

type RetweetedByData

type RetweetedByData struct {
	Users    []*masta.Account
	NextLink string
}

type RootData

type RootData struct {
	*Context
	Title string
}

type SearchData

type SearchData struct {
	Q        string
	Type     string
	Users    []*masta.Account
	Statuses []*masta.Status
	NextLink string
}

type Settings

type Settings struct {
	DefaultVisibility     string `json:"dv,omitempty"`
	DefaultFormat         string `json:"df,omitempty"`
	CopyScope             bool   `json:"cs,omitempty"`
	ThreadInNewTab        bool   `json:"tnt,omitempty"`
	HideAttachments       bool   `json:"ha,omitempty"`
	MaskNSFW              bool   `json:"mn,omitempty"`
	NotificationInterval  int    `json:"ni,omitempty"`
	FluorideMode          bool   `json:"fm,omitempty"`
	DarkMode              bool   `json:"dm,omitempty"`
	AntiDopamineMode      bool   `json:"adm,omitempty"`
	HideUnsupportedNotifs bool   `json:"hun,omitempty"`
	CSS                   string `json:"css,omitempty"`
	Stamp                 string `json:"stamp,omitempty"`
}

func NewSettings

func NewSettings() *Settings

type SettingsData

type SettingsData struct {
	Settings    *Settings
	PostFormats []conf.PostFormat
}

type SigninData

type SigninData struct {
	*Context
}

type StatusData

type StatusData struct {
	*masta.Status
	No          *int
	InReplyToNo *int
	Replies     []ThreadReplyData
	ShowReplies bool
	History     bool
}

type TemplateData

type TemplateData struct {
	Data interface{}
	Ctx  *Context
}

type ThreadData

type ThreadData struct {
	Statuses    []*StatusData
	PostContext PostContext
}

type ThreadReplyData

type ThreadReplyData struct {
	No int
	masta.ID
}

type TimelineData

type TimelineData struct {
	Title    string
	Type     string
	Instance string
	Statuses []*masta.Status
	NextLink string
	PrevLink string
}

type UserData

type UserData struct {
	User         *masta.Account
	Relationship *masta.Relationship
	IsCurrent    bool
	Type         string
	Users        []*masta.Account
	Statuses     []*masta.Status
	NextLink     string
}

type UserSearchData

type UserSearchData struct {
	User     *masta.Account
	Q        string
	Statuses []*masta.Status
	NextLink string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL