Moritz Schmidt 9 jaren geleden
bovenliggende
commit
46086dbab9
1 gewijzigde bestanden met toevoegingen van 11 en 4 verwijderingen
  1. 11 4
      templatehelpers.go

+ 11 - 4
templatehelpers.go

@@ -5,15 +5,22 @@ import (
 )
 
 type PageUserParams struct{
-  HasError string
-  Error string
+  NotificationType string
+  Notification string
   ReqDir string
   Username string
   Admin string
   Custom []string
   } // TODO outsource
 
- func ShowError(error string, ctx *iris.Context, location string) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
-   ctx.Render(location + "_box.html", PageUserParams{"1", error, location, "", "0", []string{}})
+  // TODO error handler
+
+ func ShowError(notification string, ctx *iris.Context, location string) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
+   ctx.Render(location + "_box.html", PageUserParams{"1", notification, location, "", "0", []string{}})
+   return
+ }
+
+ func ShowNotification(notification string, ctx *iris.Context, location string) { // TODO: check if backend exploiteable, TODO: implement forwarding form values ?
+   ctx.Render(location + "_box.html", PageUserParams{"2", notification, location, "", "0", []string{}})
    return
  }