You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/templates
wxiaoguang 8820191476
Improve template helper functions: string/slice (#24266)
Follow #23328

The improvements:

1. The `contains` functions are covered by tests
2. The inconsistent behavior of `containGeneric` is replaced by
`StringUtils.Contains` and `SliceUtils.Contains`
3. In the future we can move more help functions into XxxUtils to
simplify the `helper.go` and reduce unnecessary global functions.

FAQ:

1. Why it's called `StringUtils.Contains` but not `strings.Contains`
like Golang?

Because our `StringUtils` is not Golang's `strings` package. There will
be our own string functions.

---------

Co-authored-by: silverwind <me@silverwind.io>
2 years ago
..
eval Use a general Eval function for expressions in templates. (#23927) 2 years ago
scopedtmpl Make HTML template functions support context (#24056) 2 years ago
vars Implement FSFE REUSE for golang files (#21840) 2 years ago
base.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
dynamic.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
helper.go Improve template helper functions: string/slice (#24266) 2 years ago
helper_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
htmlrenderer.go Make HTML template functions support context (#24056) 2 years ago
htmlrenderer_test.go Show friendly 500 error page to users and developers (#24110) 2 years ago
mailer.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
static.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
templates_bindata.go Implement FSFE REUSE for golang files (#21840) 2 years ago
util_dict.go Improve template helper functions: string/slice (#24266) 2 years ago
util_slice.go Improve template helper functions: string/slice (#24266) 2 years ago
util_string.go Improve template helper functions: string/slice (#24266) 2 years ago
util_test.go Improve template helper functions: string/slice (#24266) 2 years ago