aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/devtest/devtest.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/devtest/devtest.go')
-rw-r--r--routers/web/devtest/devtest.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/routers/web/devtest/devtest.go b/routers/web/devtest/devtest.go
index eb77d0b927..784940909a 100644
--- a/routers/web/devtest/devtest.go
+++ b/routers/web/devtest/devtest.go
@@ -15,15 +15,16 @@ import (
// List all devtest templates, they will be used for e2e tests for the UI components
func List(ctx *context.Context) {
- templateNames := templates.GetTemplateAssetNames()
+ templateNames, err := templates.AssetFS().ListFiles("devtest", true)
+ if err != nil {
+ ctx.ServerError("AssetFS().ListFiles", err)
+ return
+ }
var subNames []string
- const prefix = "templates/devtest/"
for _, tmplName := range templateNames {
- if strings.HasPrefix(tmplName, prefix) {
- subName := strings.TrimSuffix(strings.TrimPrefix(tmplName, prefix), ".tmpl")
- if subName != "list" {
- subNames = append(subNames, subName)
- }
+ subName := strings.TrimSuffix(tmplName, ".tmpl")
+ if subName != "list" {
+ subNames = append(subNames, subName)
}
}
ctx.Data["SubNames"] = subNames