Improving pages title

This commit is contained in:
2024-05-17 20:15:32 +07:00
parent 7c24598cb1
commit fe6c3f7870
13 changed files with 28 additions and 28 deletions

View File

@ -61,7 +61,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/signup", http.StatusSeeOther)
return
}
component := authView.GoogleSetup("Setup page", types.Message{
component := authView.GoogleSetup("Filekeeper - Setup Page", types.Message{
Code: 3,
Message: "",
})
@ -91,7 +91,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
isValid := utils.ValidatePassword(password)
if !isValid {
component := authView.GoogleSetup("Setup page", types.Message{
component := authView.GoogleSetup("Filekeeper - Setup Page", types.Message{
Code: 0,
Message: "Password is invalid",
})
@ -115,7 +115,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
err = db.DB.CreateUser(&newUser)
if err != nil {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Email or Username has been registered",
})

View File

@ -34,7 +34,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
})
}
component := downloadView.Main("Download Page", filesData)
component := downloadView.Main("Filekeeper - Download Page", filesData)
err = component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)

View File

@ -65,7 +65,7 @@ func init() {
}
func GET(w http.ResponseWriter, r *http.Request) {
component := forgotPasswordView.Main("Forgot Password Page", types.Message{
component := forgotPasswordView.Main("Filekeeper - Forgot Password Page", types.Message{
Code: 3,
Message: "",
})
@ -89,9 +89,9 @@ func POST(w http.ResponseWriter, r *http.Request) {
user, err := cache.GetUser(emailForm)
if errors.Is(err, gorm.ErrRecordNotFound) {
component := forgotPasswordView.Main(fmt.Sprintf("Account with this email address %s is not found", emailForm), types.Message{
component := forgotPasswordView.Main("Filekeeper - Forgot Password Page", types.Message{
Code: 0,
Message: "",
Message: "Unexpected error has occurred",
})
err := component.Render(r.Context(), w)
if err != nil {
@ -116,7 +116,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
return
}
component := forgotPasswordView.EmailSend("Forgot Password Page")
component := forgotPasswordView.EmailSend("Filekeeper - Forgot Password Page")
err = component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)

View File

@ -33,7 +33,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
return
}
component := forgotPasswordView.NewPasswordForm("Forgot Password Page", types.Message{
component := forgotPasswordView.NewPasswordForm("Filekeeper - Forgot Password Page", types.Message{
Code: 3,
Message: "",
})
@ -66,7 +66,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
password := r.Form.Get("password")
isValid := utils.ValidatePassword(password)
if !isValid {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Password is invalid",
})
@ -100,7 +100,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
cache.DeleteUser(data.User.Email)
component := forgotPasswordView.ChangeSuccess("Forgot Password Page")
component := forgotPasswordView.ChangeSuccess("Filekeeper - Forgot Password Page")
err = component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)

View File

@ -16,7 +16,7 @@ func init() {
func GET(w http.ResponseWriter, r *http.Request) {
_, userSession, _ := session.GetSession(r)
component := indexView.Main("main page", userSession)
component := indexView.Main("Secure File Hosting - Filekeeper", userSession)
err := component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)

View File

@ -52,7 +52,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
Message: message,
})
} else {
component = signinView.Main("Sign in Page", types.Message{
component = signinView.Main("Filekeeper - Sign in Page", types.Message{
Code: 3,
Message: "",
})
@ -77,7 +77,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
password := r.Form.Get("password")
userData, err := cache.GetUser(email)
if err != nil {
component := signinView.Main("Sign in Page", types.Message{
component := signinView.Main("Filekeeper - Sign in Page", types.Message{
Code: 0,
Message: "Incorrect Username or Password",
})
@ -128,7 +128,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, cookie.Value, http.StatusSeeOther)
return
}
component := signinView.Main("Sign in Page", types.Message{
component := signinView.Main("Filekeeper - Sign in Page", types.Message{
Code: 0,
Message: "Incorrect Username or Password",
})

View File

@ -64,7 +64,7 @@ func init() {
}
func GET(w http.ResponseWriter, r *http.Request) {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 3,
Message: "",
})
@ -88,7 +88,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
password := r.Form.Get("password")
isValid := utils.ValidatePassword(password)
if !isValid {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Password is invalid",
})
@ -110,7 +110,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
}
if registered := db.DB.IsUserRegistered(userEmail, username); registered {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Email or Username has been registered",
})
@ -130,7 +130,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
return
}
component := signupView.EmailSend("Sign up Page")
component := signupView.EmailSend("Filekeeper - Sign up Page")
err = component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)

View File

@ -27,7 +27,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
err := db.DB.CreateUser(data.User)
if err != nil {
component := signupView.Main("Sign up Page", types.Message{
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Email or Username has been registered",
})
@ -43,7 +43,7 @@ func GET(w http.ResponseWriter, r *http.Request) {
delete(signupHandler.VerifyUser, code)
delete(signupHandler.VerifyEmail, data.User.Email)
component := signupView.VerifySuccess("Verify page")
component := signupView.VerifySuccess("Filekeeper - Verify Page")
err = component.Render(r.Context(), w)
if err != nil {

View File

@ -19,7 +19,7 @@ func init() {
}
func GET(w http.ResponseWriter, r *http.Request) {
component := filesView.Main("upload page")
component := filesView.Main("Filekeeper - Upload")
if err := component.Render(r.Context(), w); err != nil {
w.WriteHeader(http.StatusInternalServerError)
return

View File

@ -17,7 +17,7 @@ func init() {
func GET(w http.ResponseWriter, r *http.Request) {
userSession := r.Context().Value("user").(types.User)
component := userView.Main("User Page", userSession, session.GetSessions(userSession.Email))
component := userView.Main("Filekeeper - User Page", userSession, session.GetSessions(userSession.Email))
err := component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)