templatehelpers.go 809 B

1234567891011121314151617181920212223242526
  1. package templatehelpers
  2. import (
  3. "github.com/kataras/iris"
  4. )
  5. type PageUserParams struct{
  6. NotificationType string
  7. Notification string
  8. ReqDir string
  9. Username string
  10. Admin string
  11. Custom []string
  12. } // TODO outsource
  13. // TODO error handler
  14. func ShowError(notification string, ctx *iris.Context, location string) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
  15. ctx.Render(location + "_box.html", PageUserParams{"1", notification, location, "", "0", []string{}})
  16. return
  17. }
  18. func ShowNotification(notification string, ctx *iris.Context, location string) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
  19. ctx.Render(location + "_box.html", PageUserParams{"2", notification, location, "", "0", []string{}})
  20. return
  21. }