pages.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 pages
  7. import (
  8. "gitote/gitote/pkg/context"
  9. )
  10. const (
  11. // AboutTPL page template
  12. AboutTPL = "pages/about"
  13. // FaqTPL page template
  14. FaqTPL = "pages/faq"
  15. // PrivacyTPL page template
  16. PrivacyTPL = "pages/privacy"
  17. // TosTPL page template
  18. TosTPL = "pages/tos"
  19. // ContributeTPL page template
  20. ContributeTPL = "pages/contribute"
  21. // SecurityTPL page template
  22. SecurityTPL = "pages/security"
  23. // VerifiedTPL page template
  24. VerifiedTPL = "pages/verified"
  25. // HelpTPL page template
  26. HelpTPL = "pages/help"
  27. )
  28. // About shows about page
  29. func About(c *context.Context) {
  30. c.Data["Title"] = "About"
  31. c.HTML(200, AboutTPL)
  32. }
  33. // Faq shows faq page
  34. func Faq(c *context.Context) {
  35. c.Data["Title"] = "FAQ"
  36. c.HTML(200, FaqTPL)
  37. }
  38. // Privacy shows privacy page
  39. func Privacy(c *context.Context) {
  40. c.Data["Title"] = "Privacy Policy"
  41. c.HTML(200, PrivacyTPL)
  42. }
  43. // Tos shows tos page
  44. func Tos(c *context.Context) {
  45. c.Data["Title"] = "Terms of Service"
  46. c.HTML(200, TosTPL)
  47. }
  48. // Contribute shows contribute page
  49. func Contribute(c *context.Context) {
  50. c.Data["PageIsContribute"] = true
  51. c.Data["Title"] = "Contribute"
  52. c.HTML(200, ContributeTPL)
  53. }
  54. // Security shows security page
  55. func Security(c *context.Context) {
  56. c.Data["Title"] = "Security"
  57. c.HTML(200, SecurityTPL)
  58. }
  59. // Verified shows verified page
  60. func Verified(c *context.Context) {
  61. c.Data["Title"] = "Verified"
  62. c.HTML(200, VerifiedTPL)
  63. }
  64. // Help shows help page
  65. func Help(c *context.Context) {
  66. c.Data["Title"] = "Help"
  67. c.Data["PageIsHelp"] = true
  68. c.HTML(200, HelpTPL)
  69. }