h = require 'maquette' .h bulma = require "./bulma.ls" Task = require "./task.ls" Modal = require './modal.ls' Project = (self, todod-ws) -> self.todod-ws = todod-ws self.tasks = self.tasks.map (e) -> Task e, self, model modal = void self.render-column = (column) -> self.render = -> # 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" ] h \div.columns [ if self.extra_properties.columns for dom in self.extra_properties.columns.map((column) -> self.render-column(column)) dom ] if modal modal.render! ] self module.exports = Project