From 5d8996a12bcc4c61708f6fc7b740ed771dd16b0e Mon Sep 17 00:00:00 2001 From: Casper Rasmussen Date: Sun, 26 Mar 2017 09:14:09 +0200 Subject: [PATCH] added a textarea leaf tag --- .../Support/LeafTags/FormTextAreaGroup.swift | 110 ++++++++++++++++++ Sources/AdminPanel/Support/Provider.swift | 1 + 2 files changed, 111 insertions(+) create mode 100644 Sources/AdminPanel/Support/LeafTags/FormTextAreaGroup.swift diff --git a/Sources/AdminPanel/Support/LeafTags/FormTextAreaGroup.swift b/Sources/AdminPanel/Support/LeafTags/FormTextAreaGroup.swift new file mode 100644 index 0000000..02c6f5a --- /dev/null +++ b/Sources/AdminPanel/Support/LeafTags/FormTextAreaGroup.swift @@ -0,0 +1,110 @@ +import Foundation +import Leaf +import Node +import Vapor +import VaporForms + +public class FormTextAreaGroup: BasicTag { + public init(){} + public let name = "form:textareagroup" + + public func run(arguments: [Argument]) throws -> Node? { + + /* + #form:textgroup(key, value, fieldset, attr1, attr2 etc) + + Arguments: + [0] = The name of the input (the key that gets posted) * + [1] = The value of the input (the value that gets posted) (defaults to empty string) * + [2] = The VaporForms Fieldset of the entire model * ** + + * - All the arguments are actually required. We need to throw exceptions at people if they don't supply all of them + ** - It would be awesome if you could only post the exact Field of the Fieldset so we don't need to find it in this code (its gonna get repetetive) + + The