Moritz Schmidt 9 gadi atpakaļ
vecāks
revīzija
b599842dee
1 mainītis faili ar 17 papildinājumiem un 0 dzēšanām
  1. 17 0
      templatehelpers.go

+ 17 - 0
templatehelpers.go

@@ -1,2 +1,19 @@
 package templatehelpers
 
+import (
+  "github.com/kataras/iris"
+)
+
+type PageUserParams struct{
+  HasError string
+  Error 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{}})
+   return
+ }