42 lines
673 B
Plaintext
42 lines
673 B
Plaintext
|
|
||
|
h = require 'maquette' .h
|
||
|
|
||
|
TaskCard = (key, head-left, head-content, content, on-click) ->
|
||
|
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!
|
||
|
modal := TaskCreationModal project.id, todod-ws, self
|
||
|
} [ "Edit" ]
|
||
|
|
||
|
if self.modal
|
||
|
self.modal.render!
|
||
|
]
|
||
|
]
|
||
|
]
|
||
|
|
||
|
self
|
||
|
|
||
|
|
||
|
module.exports = Card
|