mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-15 02:45:22 +00:00
Deprecate usage of FileSize in templates
This commit is contained in:
parent
e5212c8c96
commit
d2cd1342bf
|
@ -63,7 +63,7 @@ func NewFuncMap() template.FuncMap {
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// time / number / format
|
// time / number / format
|
||||||
"FileSize": base.FileSize,
|
"FileSize": FileSizePanic,
|
||||||
"CountFmt": base.FormatNumberSI,
|
"CountFmt": base.FormatNumberSI,
|
||||||
"TimeSince": timeutil.TimeSince,
|
"TimeSince": timeutil.TimeSince,
|
||||||
"TimeSinceUnix": timeutil.TimeSinceUnix,
|
"TimeSinceUnix": timeutil.TimeSinceUnix,
|
||||||
|
@ -249,3 +249,7 @@ func Eval(tokens ...any) (any, error) {
|
||||||
n, err := eval.Expr(tokens...)
|
n, err := eval.Expr(tokens...)
|
||||||
return n.Value, err
|
return n.Value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FileSizePanic(s int64) string {
|
||||||
|
panic("Usage of FileSize in templates is deprecated in Forgejo. Locale.TrSize should be used instead.")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue