todo-webclient/client/project.ls

44 lines
863 B
Plaintext
Raw Normal View History

2019-11-22 16:52:50 +01:00
h = require 'maquette' .h
bulma = require "./bulma.ls"
Task = require "./task.ls"
2019-12-05 02:28:17 +01:00
Modal = require './modal.ls'
2019-11-22 16:52:50 +01:00
2019-12-05 02:28:17 +01:00
Project = (self, todod-ws) ->
self.todod-ws = todod-ws
self.tasks = self.tasks.map (e) -> Task e, self, model
2019-11-22 16:52:50 +01:00
2019-12-05 02:28:17 +01:00
modal = void
2019-11-22 16:52:50 +01:00
2019-12-05 02:28:17 +01:00
self.render-column = (column) ->
2019-11-22 16:52:50 +01:00
2019-12-05 02:28:17 +01:00
self.render = ->
2019-11-22 16:52:50 +01:00
2019-12-05 02:28:17 +01:00
# console.log "Project to render: ", self
h \div.project {} [
h \div.button.is-danger.is-outlined {
onclick: ->
modal := Modal {
+visible
content:
h \p [ "Are you sure you want to remove board #{self.title}?" ]
on-validation: ->
self.todod-ws.remove-list self.id
}
} [ "X" ]
2019-12-05 02:28:17 +01:00
h \div.columns [
if self.extra_properties.columns
for dom in self.extra_properties.columns.map((column) -> self.render-column(column))
dom
2019-11-22 16:52:50 +01:00
]
2019-12-05 02:28:17 +01:00
if modal
modal.render!
]
2019-12-05 02:28:17 +01:00
self
2019-12-05 02:28:17 +01:00
module.exports = Project