| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- package templatehelpers
- import (
- "github.com/kataras/iris"
- "strings"
- )
- type PageUserParams struct{
- NotificationType string
- Notification string
- ReqDir string
- Username string
- Admin string
- Custom []string
- } // TODO outsource
- // TODO error handler
- func ShowError(options []string, ctx *iris.Context) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
- location := strings.TrimLeft(ctx.RequestPath(false), "/")
- if len(options) > 1 {
- if options[1] != "" {
- location = options[1]
- }
- }
- ctx.Render(location + "_box.html", PageUserParams{"1", options[0], location, "", "0", []string{}}) // TODO: Dynamic params
- return
- }
- func ShowNotification(options []string, ctx *iris.Context) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
- location := strings.TrimLeft(ctx.RequestPath(false), "/")
- if len(options) > 1 {
- if options[1] != "" {
- location = options[1]
- }
- }
- ctx.Render(location + "_box.html", PageUserParams{"2", options[0], location, "", "0", []string{}}) // TODO: Dynamic params
- return
- }
|