mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
finish view comments on issue page
This commit is contained in:
@@ -110,6 +110,16 @@ func (f *CreateIssueForm) Validate(ctx *macaron.Context, errs binding.Errors) bi
|
||||
return validate(errs, ctx.Data, f, ctx.Locale)
|
||||
}
|
||||
|
||||
type CreateCommentForm struct {
|
||||
Content string
|
||||
NewStatus string `binding:"OmitEmpty;In(reopen,close)"`
|
||||
Attachments []string
|
||||
}
|
||||
|
||||
func (f *CreateCommentForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
return validate(errs, ctx.Data, f, ctx.Locale)
|
||||
}
|
||||
|
||||
// _____ .__.__ __
|
||||
// / \ |__| | ____ _______/ |_ ____ ____ ____
|
||||
// / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
|
||||
|
@@ -131,12 +131,13 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
|
||||
"LoadTimes": func(startTime time.Time) string {
|
||||
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
|
||||
},
|
||||
"AvatarLink": AvatarLink,
|
||||
"Safe": Safe,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": TimeSince,
|
||||
"FileSize": FileSize,
|
||||
"Subtract": Subtract,
|
||||
"AvatarLink": AvatarLink,
|
||||
"Safe": Safe,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": TimeSince,
|
||||
"RawTimeSince": RawTimeSince,
|
||||
"FileSize": FileSize,
|
||||
"Subtract": Subtract,
|
||||
"Add": func(a, b int) int {
|
||||
return a + b
|
||||
},
|
||||
|
@@ -321,6 +321,10 @@ func timeSince(then time.Time, lang string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func RawTimeSince(t time.Time, lang string) string {
|
||||
return timeSince(t, lang)
|
||||
}
|
||||
|
||||
// TimeSince calculates the time interval and generate user-friendly string.
|
||||
func TimeSince(t time.Time, lang string) template.HTML {
|
||||
return template.HTML(fmt.Sprintf(`<span class="time-since" title="%s">%s</span>`, t.Format(setting.TimeFormat), timeSince(t, lang)))
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user