forms

package
v0.0.0-...-2f03d60 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptInviteFormNew

func AcceptInviteFormNew(sender sender.Sender, invite *core.UserInvitation) forms.Form

func ChangePasswordFormNew

func ChangePasswordFormNew(u *core.User) forms.Form

func LoginFormNew

func LoginFormNew() forms.Form

func NewCommentFormNew

func NewCommentFormNew(sender sender.Sender, u *core.User, postID string, mediaReplacer types.Replacer[string]) forms.Form

func PostPromptFormNew

func PostPromptFormNew(sender sender.Sender, u *core.User, directConnections []*core.User) forms.Form

func SendInviteFormNew

func SendInviteFormNew(sender sender.Sender, u *core.User) forms.Form

func SettingsGeneralFormNew

func SettingsGeneralFormNew(u *core.User) forms.Form

func SignupFormNew

func SignupFormNew(sender sender.Sender) forms.Form

func SignupWaitingListFormNew

func SignupWaitingListFormNew(sender sender.Sender) forms.Form

func WhitelistConnectionNew

func WhitelistConnectionNew(u *core.User) forms.Form

Types

type AcceptInviteForm

type AcceptInviteForm struct {
	*forms.FormBase[AcceptInviteFormInput]
	Sender sender.Sender
	Invite *core.UserInvitation
}

func (*AcceptInviteForm) Save

func (*AcceptInviteForm) Validate

func (f *AcceptInviteForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type AcceptInviteFormInput

type AcceptInviteFormInput struct {
	Username string `form:"username"`
	Password string `form:"password"`
}

type ChangePasswordForm

type ChangePasswordForm struct {
	*forms.FormBase[ChangePasswordFormInput]
	User *core.User
}

func (*ChangePasswordForm) Save

func (*ChangePasswordForm) Validate

type ChangePasswordFormInput

type ChangePasswordFormInput struct {
	OldPassword string `form:"old_password"`
	Password    string `form:"password"`
}

type LoginForm

type LoginForm struct {
	*forms.FormBase[LoginFormInput]
}

func (*LoginForm) Save

func (*LoginForm) Validate

func (f *LoginForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type LoginFormInput

type LoginFormInput struct {
	Email    string `form:"email"`
	Password string `form:"password"`
}

type NewCommentForm

type NewCommentForm struct {
	*forms.FormBase[NewCommentFormInput]
	User          *core.User
	Sender        sender.Sender
	MediaReplacer types.Replacer[string]
}

func (*NewCommentForm) Save

func (*NewCommentForm) Validate

func (f *NewCommentForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type NewCommentFormInput

type NewCommentFormInput struct {
	Body    string `form:"body"`
	PostID  string `form:"post_id"`
	ReplyTo string `form:"reply_to"`
}

type PostForm

type PostForm struct {
	*forms.FormBase[PostFormInput]
	User          *core.User
	Sender        sender.Sender
	MediaReplacer types.Replacer[string]
	Post          *core.Post
	Prompt        *postops.PostPrompt
}

func EditPostFormNew

func EditPostFormNew(ctx context.Context, db boil.ContextExecutor, sender sender.Sender, u *core.User, mediaReplacer types.Replacer[string], postID string) (*PostForm, error)

func NewPostFormNew

func NewPostFormNew(ctx context.Context, db boil.ContextExecutor, sender sender.Sender, u *core.User, mediaReplacer types.Replacer[string], promptID string) (*PostForm, error)

func (*PostForm) Save

func (*PostForm) Validate

func (f *PostForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type PostFormAction

type PostFormAction string
const (
	PostFormActionSavePost  PostFormAction = "save_post"
	PostFormActionMakeDraft PostFormAction = "make_draft"
	PostFormActionPublish   PostFormAction = "publish"
	PostFormActionDelete    PostFormAction = "delete"
	PostFormActionAutosave  PostFormAction = "autosave"
)

func (PostFormAction) String

func (p PostFormAction) String() string

type PostFormInput

type PostFormInput struct {
	Subject    string              `form:"subject"`
	Body       string              `form:"body"`
	Visibility core.PostVisibility `form:"visibility"`
	SaveAction PostFormAction      `form:"save_action"`
}

type PostPromptForm

type PostPromptForm struct {
	*forms.FormBase[PostPromptFormInput]
	Sender            sender.Sender
	User              *core.User
	DirectConnections []*core.User
}

func (*PostPromptForm) Save

func (*PostPromptForm) Validate

func (f *PostPromptForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type PostPromptFormInput

type PostPromptFormInput struct {
	Message         string `form:"message"`
	RecipientHandle string `form:"recipient_handle"`
}

type SendInviteForm

type SendInviteForm struct {
	*forms.FormBase[SendInviteFormInput]
	Sender sender.Sender
	User   *core.User
}

func (*SendInviteForm) Save

func (*SendInviteForm) Validate

func (f *SendInviteForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type SendInviteFormInput

type SendInviteFormInput struct {
	Email string `form:"email"`
}

type SettingsGeneralForm

type SettingsGeneralForm struct {
	*forms.FormBase[SettingsGeneralFormInput]
	User *core.User
}

func (*SettingsGeneralForm) Save

func (*SettingsGeneralForm) Validate

type SettingsGeneralFormInput

type SettingsGeneralFormInput struct {
	Timezone string `form:"timezone"`
}

type SignupForm

type SignupForm struct {
	*forms.FormBase[SignupFormInput]
	Sender sender.Sender
}

func (*SignupForm) Save

func (*SignupForm) Validate

func (f *SignupForm) Validate(c *gin.Context, db boil.ContextExecutor) error

type SignupFormInput

type SignupFormInput struct {
	Email       string `form:"email"`
	Username    string `form:"username"`
	Password    string `form:"password"`
	Attribution string `form:"attribution"`
}

type SignupWaitingListForm

type SignupWaitingListForm struct {
	*forms.FormBase[SignupWaitingListFormInput]
	Sender sender.Sender
}

func (*SignupWaitingListForm) Save

func (*SignupWaitingListForm) Validate

type SignupWaitingListFormInput

type SignupWaitingListFormInput struct {
	Email       string `form:"email"`
	Reason      string `form:"reason"`
	Attribution string `form:"attribution"`
}

type WhitelistConnection

type WhitelistConnection struct {
	*forms.FormBase[WhitelistConnectionInput]
	User *core.User
}

func (*WhitelistConnection) Save

func (*WhitelistConnection) Validate

type WhitelistConnectionInput

type WhitelistConnectionInput struct {
	Username string `form:"uname"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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