Browse Source

Web: move baselogin template to common

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
Nicola Murino 1 year ago
parent
commit
7318d1f32a
3 changed files with 7 additions and 7 deletions
  1. 1 0
      internal/httpd/web.go
  2. 6 7
      internal/httpd/webclient.go
  3. 0 0
      templates/common/baselogin.html

+ 1 - 0
internal/httpd/web.go

@@ -48,6 +48,7 @@ const (
 	templateResetPassword      = "reset-password.html"
 	templateResetPassword      = "reset-password.html"
 	templateCommonCSS          = "sftpgo.css"
 	templateCommonCSS          = "sftpgo.css"
 	templateCommonBase         = "base.html"
 	templateCommonBase         = "base.html"
+	templateCommonBaseLogin    = "baselogin.html"
 )
 )
 
 
 var (
 var (

+ 6 - 7
internal/httpd/webclient.go

@@ -47,7 +47,6 @@ import (
 const (
 const (
 	templateClientDir               = "webclient"
 	templateClientDir               = "webclient"
 	templateClientBase              = "base.html"
 	templateClientBase              = "base.html"
-	templateClientBaseLogin         = "baselogin.html"
 	templateClientLogin             = "login.html"
 	templateClientLogin             = "login.html"
 	templateClientFiles             = "files.html"
 	templateClientFiles             = "files.html"
 	templateClientMessage           = "message.html"
 	templateClientMessage           = "message.html"
@@ -481,7 +480,7 @@ func loadClientTemplates(templatesPath string) {
 	}
 	}
 	loginPath := []string{
 	loginPath := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateClientLogin),
 		filepath.Join(templatesPath, templateClientDir, templateClientLogin),
 	}
 	}
 	messagePath := []string{
 	messagePath := []string{
@@ -496,22 +495,22 @@ func loadClientTemplates(templatesPath string) {
 	}
 	}
 	twoFactorPath := []string{
 	twoFactorPath := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateClientTwoFactor),
 		filepath.Join(templatesPath, templateClientDir, templateClientTwoFactor),
 	}
 	}
 	twoFactorRecoveryPath := []string{
 	twoFactorRecoveryPath := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateClientTwoFactorRecovery),
 		filepath.Join(templatesPath, templateClientDir, templateClientTwoFactorRecovery),
 	}
 	}
 	forgotPwdPaths := []string{
 	forgotPwdPaths := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateForgotPassword),
 		filepath.Join(templatesPath, templateClientDir, templateForgotPassword),
 	}
 	}
 	resetPwdPaths := []string{
 	resetPwdPaths := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateResetPassword),
 		filepath.Join(templatesPath, templateClientDir, templateResetPassword),
 	}
 	}
 	viewPDFPaths := []string{
 	viewPDFPaths := []string{
@@ -520,7 +519,7 @@ func loadClientTemplates(templatesPath string) {
 	}
 	}
 	shareLoginPath := []string{
 	shareLoginPath := []string{
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
 		filepath.Join(templatesPath, templateCommonDir, templateCommonBase),
-		filepath.Join(templatesPath, templateClientDir, templateClientBaseLogin),
+		filepath.Join(templatesPath, templateCommonDir, templateBaseLogin),
 		filepath.Join(templatesPath, templateClientDir, templateShareLogin),
 		filepath.Join(templatesPath, templateClientDir, templateShareLogin),
 	}
 	}
 	shareUploadPath := []string{
 	shareUploadPath := []string{

+ 0 - 0
templates/webclient/baselogin.html → templates/common/baselogin.html