forked from forgejo/forgejo
finish view comments on issue page
This commit is contained in:
parent
d7d72b9e3c
commit
133b19d0c5
14 changed files with 388 additions and 284 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue