From 541006714716b42d595fc71c2dd80d5d9aeee997 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sun, 8 Dec 2019 15:23:46 +0100 Subject: [PATCH] UX --- client/project.ls | 14 +++++++------- client/task-creation-modal.ls | 28 +++++++++++----------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/client/project.ls b/client/project.ls index a2db8c1..8d87b00 100644 --- a/client/project.ls +++ b/client/project.ls @@ -52,13 +52,6 @@ Project = (self, todod-ws) -> self.right-nav-render = -> [ - h \div.navbar-item [ - h \div.button.is-outlined { - onclick: -> - modal := ProjectCreationModal self, self.todod-ws - } [ "Edit this project" ] - ] - h \div.navbar-item [ h \div.button.is-success.is-outlined { onclick: -> @@ -66,6 +59,13 @@ Project = (self, todod-ws) -> } [ "New task" ] ] + h \div.navbar-item [ + h \div.button.is-outlined { + onclick: -> + modal := ProjectCreationModal self, self.todod-ws + } [ "Edit this project" ] + ] + h \div.navbar-item [ h \div.button.is-danger.is-outlined { onclick: -> diff --git a/client/task-creation-modal.ls b/client/task-creation-modal.ls index f3ffca7..30f93cf 100644 --- a/client/task-creation-modal.ls +++ b/client/task-creation-modal.ls @@ -4,22 +4,10 @@ Modal = require './modal.ls' column-form-selection = (self, column) -> - checked = false - - if self.extra_properties && self.extra_properties.column == column.id - checked = true - - h \label.radio [ - column.title - h \input { - type: "radio" - name: "column" - checked: checked - value: column.title - onclick: -> - self.extra_properties.column := column.id - } [ ] - ] + h \option { + value: column.id + selected: self.extra_properties && self.extra_properties.column == column.id + } [ column.title ] TaskCreationModal = (project, todod-ws, task) -> @@ -55,7 +43,13 @@ TaskCreationModal = (project, todod-ws, task) -> h \p [ "Choose the column" ] - h \div.control project.extra_properties.columns.map (column) -> column-form-selection self, column + + h \div.select [ + h \select { + onchange: (e) -> + self.extra_properties.column := e.target.value + } project.extra_properties.columns.map (column) -> column-form-selection self, column + ] ]