Documentation ¶
Index ¶
- func FilterMentions(user *models.User, content string)
- func ListCategories(cats *[]models.Category) (int64, error)
- func ListPostsOfCategory(cat *models.Category, posts *[]models.Post) (int64, error)
- func ListPostsOfTopic(topic *models.Topic, posts *[]models.Post) (int64, error)
- func ListTopics(topics *[]models.Topic) (int64, error)
- func ListTopicsOfCat(topics *[]models.Topic, cat *models.Category) (int64, error)
- func PostBrowsersAdd(uid int, ip string, post *models.Post)
- func PostReplysCount(post *models.Post)
- func SearchPost(q string, page int) ([]*models.Post, *utils.SphinxMeta, error)
- type CategoryAdminForm
- type CommentAdminForm
- type CommentForm
- type PostAdminForm
- type PostForm
- func (form *PostForm) AppendPost(appendPost *models.AppendPost, user *models.User) error
- func (form *PostForm) CategorySelectData() [][]string
- func (form *PostForm) LangSelectData() [][]string
- func (form *PostForm) Placeholders() map[string]string
- func (form *PostForm) SavePost(post *models.Post, user *models.User) error
- func (form *PostForm) SetFromPost(post *models.Post)
- func (form *PostForm) TopicSelectData() [][]string
- func (form *PostForm) UpdatePost(post *models.Post, user *models.User) error
- func (form *PostForm) Valid(v *validation.Validation)
- type TopicAdminForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterMentions ¶
func ListPostsOfCategory ¶
func ListPostsOfTopic ¶
func ListTopicsOfCat ¶
func PostReplysCount ¶
func SearchPost ¶
Types ¶
type CategoryAdminForm ¶
type CategoryAdminForm struct { Create bool `form:"-"` Id int `form:"-"` Name string `valid:"Required;MaxSize(30)"` Slug string `valid:"Required;MaxSize(100)"` Order int `` }
func (*CategoryAdminForm) SetFromCategory ¶
func (form *CategoryAdminForm) SetFromCategory(cat *models.Category)
func (*CategoryAdminForm) SetToCategory ¶
func (form *CategoryAdminForm) SetToCategory(cat *models.Category)
func (*CategoryAdminForm) Valid ¶
func (form *CategoryAdminForm) Valid(v *validation.Validation)
type CommentAdminForm ¶
type CommentAdminForm struct { Create bool `form:"-"` User int `form:"attr(rel,select2-admin-model);attr(data-model,User)" valid:"Required"` Post int `valid:"Required"` Message string `form:"type(textarea)" valid:"Required"` Floor int `valid:"Required"` Status int `valid:""` }
func (*CommentAdminForm) SetFromComment ¶
func (form *CommentAdminForm) SetFromComment(comment *models.Comment)
func (*CommentAdminForm) SetToComment ¶
func (form *CommentAdminForm) SetToComment(comment *models.Comment)
func (*CommentAdminForm) Valid ¶
func (form *CommentAdminForm) Valid(v *validation.Validation)
type CommentForm ¶
type CommentForm struct {
Message string `form:"type(textarea,markdown)" valid:"Required;MinSize(5)"`
}
func (*CommentForm) SaveComment ¶
type PostAdminForm ¶
type PostAdminForm struct { PostForm `form:"-"` Create bool `form:"-"` User int `form:"attr(rel,select2-admin-model);attr(data-model,User)" valid:"Required"` Title string `valid:"Required;MaxSize(60)"` Content string `form:"type(textarea,markdown)" valid:"Required"` Browsers int `` Replys int `` Favorites int `` LastReply int `form:"attr(rel,select2-admin-model);attr(data-model,User)" valid:""` LastAuthor int `form:"attr(rel,select2-admin-model);attr(data-model,User)" valid:""` Topic int `form:"type(select);attr(rel,select2)" valid:"Required"` Category int `form:"type(select);attr(rel,select2)" valid:"Required"` Lang int `form:"type(select);attr(rel,select2)"` IsBest bool `` }
func (*PostAdminForm) SetFromPost ¶
func (form *PostAdminForm) SetFromPost(post *models.Post)
func (*PostAdminForm) SetToPost ¶
func (form *PostAdminForm) SetToPost(post *models.Post)
func (*PostAdminForm) Valid ¶
func (form *PostAdminForm) Valid(v *validation.Validation)
type PostForm ¶
type PostForm struct { Lang int `form:"type(select);attr(rel,select2)"` Category int `form:"type(select);attr(rel,select2)" valid:"Required"` Topic int `form:"type(select);attr(rel,select2)" valid:"Required"` Title string `form:"attr(autocomplete,off)" valid:"Required;MinSize(5);MaxSize(60)"` Content string `form:"type(textarea)" valid:"Required;MinSize(10)"` Categories []models.Category `form:"-"` Topics []models.Topic `form:"-"` Locale i18n.Locale `form:"-"` }
func (*PostForm) AppendPost ¶
func (*PostForm) CategorySelectData ¶
func (*PostForm) LangSelectData ¶
func (*PostForm) Placeholders ¶
func (*PostForm) SetFromPost ¶
func (*PostForm) TopicSelectData ¶
func (*PostForm) UpdatePost ¶
func (*PostForm) Valid ¶
func (form *PostForm) Valid(v *validation.Validation)
type TopicAdminForm ¶
type TopicAdminForm struct { Create bool `form:"-"` Id int `form:"-"` Name string `valid:"Required;MaxSize(30)"` Intro string `form:"type(textarea)" valid:"Required"` NameZhCn string `valid:"Required;MaxSize(30)"` IntroZhCn string `form:"type(textarea)" valid:"Required"` Slug string `valid:"Required;MaxSize(100)"` Followers int `` Order int `` Image string `valid:""` }
func (*TopicAdminForm) SetFromTopic ¶
func (form *TopicAdminForm) SetFromTopic(topic *models.Topic)
func (*TopicAdminForm) SetToTopic ¶
func (form *TopicAdminForm) SetToTopic(topic *models.Topic)
func (*TopicAdminForm) Valid ¶
func (form *TopicAdminForm) Valid(v *validation.Validation)
Click to show internal directories.
Click to hide internal directories.