forked from forgejo/forgejo
move templateFuncs to one file, add middleware context.
This commit is contained in:
parent
06deed820d
commit
fa5ad1e465
10 changed files with 173 additions and 95 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -30,10 +29,6 @@ const (
|
|||
Year = 12 * Month
|
||||
)
|
||||
|
||||
func Str2html(raw string) template.HTML {
|
||||
return template.HTML(raw)
|
||||
}
|
||||
|
||||
// TimeSince calculates the time interval and generate user-friendly string.
|
||||
func TimeSince(then time.Time) string {
|
||||
now := time.Now()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue