template.go 840 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2015 - Present, The Gogs Authors. All rights reserved.
  2. // Copyright 2018 - Present, Gitote. All rights reserved.
  3. //
  4. // This source code is licensed under the MIT license found in the
  5. // LICENSE file in the root directory of this source tree.
  6. package dev
  7. import (
  8. "gitote/gitote/models"
  9. "gitote/gitote/pkg/context"
  10. "gitote/gitote/pkg/setting"
  11. )
  12. //TemplatePreview pre render the template to preview it
  13. func TemplatePreview(c *context.Context) {
  14. c.Data["User"] = models.User{Name: "Yoginth"}
  15. c.Data["AppVer"] = setting.AppVer
  16. c.Data["APIVer"] = setting.APIVer
  17. c.Data["AppURL"] = setting.AppURL
  18. c.Data["Code"] = "123456789"
  19. c.Data["ActiveCodeLives"] = setting.Service.ActiveCodeLives / 60
  20. c.Data["ResetPwdCodeLives"] = setting.Service.ResetPwdCodeLives / 60
  21. c.Data["CurDbValue"] = ""
  22. c.HTML(200, (c.Params("*")))
  23. }