todo-webclient/client/card.ls

41 lines
608 B
Plaintext
Raw Normal View History

2019-12-06 04:10:00 +01:00
h = require 'maquette' .h
2019-12-23 23:56:06 +01:00
Card = (key, head-left, head-content, content, on-click) ->
2019-12-06 04:10:00 +01:00
self = {
key: key
head-left: head-left
head-content: head-content
content: content
modal: void
}
self.render = ->
h \div.card { key: self.key } [
h \div.card-content [
h \div.media [
h \div.media-left [
self.head-left
]
h \div.media-content [
self.head-content
]
]
h \div.content [
self.title
h \div.button {
onclick: -> on-click!
} [ "Edit" ]
if self.modal
self.modal.render!
]
]
]
self
module.exports = Card