updated utils.LoadTemplate() to call template.ParseFiles() directly and added a way to specify a base template (will be used in the next commit)

This commit is contained in:
Manuel Reithuber
2021-06-05 18:06:53 +02:00
committed by Nicola Murino
parent c07dc74d48
commit 88b10da596
3 changed files with 35 additions and 21 deletions

View File

@@ -123,10 +123,10 @@ func loadClientTemplates(templatesPath string) {
filepath.Join(templatesPath, templateClientDir, templateClientMessage),
}
filesTmpl := utils.LoadTemplate(template.ParseFiles(filesPaths...))
credentialsTmpl := utils.LoadTemplate(template.ParseFiles(credentialsPaths...))
loginTmpl := utils.LoadTemplate(template.ParseFiles(loginPath...))
messageTmpl := utils.LoadTemplate(template.ParseFiles(messagePath...))
filesTmpl := utils.LoadTemplate(nil, filesPaths...)
credentialsTmpl := utils.LoadTemplate(nil, credentialsPaths...)
loginTmpl := utils.LoadTemplate(nil, loginPath...)
messageTmpl := utils.LoadTemplate(nil, messagePath...)
clientTemplates[templateClientFiles] = filesTmpl
clientTemplates[templateClientCredentials] = credentialsTmpl