diff --git a/utils/editform/editform.go b/utils/editform/editform.go index cd84bf75..789f78cb 100644 --- a/utils/editform/editform.go +++ b/utils/editform/editform.go @@ -37,6 +37,7 @@ func Render(obj interface{}, title string, user *arn.User) string { if user != nil { b.WriteString(`
`) + // Publish button _, ok := t.FieldByName("IsDraft") if ok { @@ -47,8 +48,18 @@ func Render(obj interface{}, title string, user *arn.User) string { } } + // Delete button if user.Role == "editor" || user.Role == "admin" { - b.WriteString(``) + returnPath := "" + + switch lowerCaseTypeName { + case "company": + returnPath = "/companies" + default: + returnPath = "/" + lowerCaseTypeName + "s" + } + + b.WriteString(``) } b.WriteString(`
`)