Files
vapor-po/Sources/App/Views/Buttons.swift

21 lines
501 B
Swift

import Elementary
struct ToggleFormButton: HTML {
var content: some HTML<HTMLTag.a> {
a(.href("javascript:void(0)"), .on(.click, "toggleContent('form')"), .class("btn-add")) {
"+"
}
}
}
enum Button {
static func danger<C: HTML>(@HTMLBuilder body: () -> C) -> some HTML<HTMLTag.button> {
button(.class("danger")) { body() }
}
static func close(id: String) -> some HTML<HTMLTag.button> {
button(.class("btn-add"), .on(.click, "toggleContent('\(id)')")) { "x" }
}
}