hardcoded users and permissions, but still
This commit is contained in:
parent
b470ff2a37
commit
a9e28065bf
@ -24,16 +24,28 @@ col-to-lines = (column, self) ->
|
|||||||
} [ "DELETE" ]
|
} [ "DELETE" ]
|
||||||
]
|
]
|
||||||
|
|
||||||
# <div class="field has-addons">
|
# TODO FIXME XXX HARDCODE
|
||||||
# <p class="control">
|
users = [
|
||||||
# <input class="input" type="text" placeholder="Your email">
|
{ login: "jean", id: "1003" }
|
||||||
# </p>
|
{ login: "martin", id: "1004" }
|
||||||
# <p class="control">
|
{ login: "damien", id: "1005" }
|
||||||
# <a class="button is-static">
|
]
|
||||||
# @gmail.com
|
|
||||||
# </a>
|
user-form-selection = (self, user) ->
|
||||||
# </p>
|
h \option {
|
||||||
# </div>
|
value: user.id
|
||||||
|
} [ user.login ]
|
||||||
|
|
||||||
|
permission-groups = [
|
||||||
|
"Admin"
|
||||||
|
"Write"
|
||||||
|
"Read"
|
||||||
|
]
|
||||||
|
|
||||||
|
permission-to-form-selection = (self, permission) ->
|
||||||
|
h \option {
|
||||||
|
value: permission
|
||||||
|
} [ permission ]
|
||||||
|
|
||||||
ProjectCreationModal = (project, todod-ws) ->
|
ProjectCreationModal = (project, todod-ws) ->
|
||||||
|
|
||||||
@ -49,7 +61,11 @@ ProjectCreationModal = (project, todod-ws) ->
|
|||||||
self = {
|
self = {
|
||||||
title: project.title || ""
|
title: project.title || ""
|
||||||
permissions: project.permissions || [[]]
|
permissions: project.permissions || [[]]
|
||||||
new-user: "New user"
|
# new-user: "New user"
|
||||||
|
new-user-permission: {
|
||||||
|
id: void
|
||||||
|
permission: void
|
||||||
|
}
|
||||||
new-column-input: {
|
new-column-input: {
|
||||||
title: "New column !"
|
title: "New column !"
|
||||||
}
|
}
|
||||||
@ -73,19 +89,18 @@ ProjectCreationModal = (project, todod-ws) ->
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
h \hr []
|
# h \hr []
|
||||||
|
|
||||||
bulma.field [
|
# bulma.field [
|
||||||
bulma.label "Adding a user"
|
# bulma.label "Adding a user"
|
||||||
bulma.input {
|
# bulma.input {
|
||||||
value: self.new-user
|
# value: self.new-user
|
||||||
oninput: (e) ->
|
# oninput: (e) ->
|
||||||
self.new-user := e.target.value
|
# self.new-user := e.target.value
|
||||||
|
# name: \new-user
|
||||||
name: \new-user
|
# id: \user-add
|
||||||
id: \user-add
|
# }
|
||||||
}
|
# ]
|
||||||
]
|
|
||||||
|
|
||||||
h \hr []
|
h \hr []
|
||||||
|
|
||||||
@ -103,6 +118,38 @@ ProjectCreationModal = (project, todod-ws) ->
|
|||||||
|
|
||||||
h \hr []
|
h \hr []
|
||||||
|
|
||||||
|
h \p [ "Adding new user" ]
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# 1. select a permission groups
|
||||||
|
# 2. select an user
|
||||||
|
|
||||||
|
h \div.field.has-addons {
|
||||||
|
key: "adding-user"
|
||||||
|
} [
|
||||||
|
h \div.select.control [
|
||||||
|
h \select {
|
||||||
|
onchange: (e) ->
|
||||||
|
self.new-user-permission.permission := e.target.value
|
||||||
|
} permission-groups.map (permission) -> permission-to-form-selection self, permission
|
||||||
|
]
|
||||||
|
|
||||||
|
h \div.select.control.is-expanded [
|
||||||
|
h \select {
|
||||||
|
onchange: (e) ->
|
||||||
|
self.new-user-permission.id := e.target.value
|
||||||
|
} users.map (user) -> user-form-selection self, user
|
||||||
|
]
|
||||||
|
|
||||||
|
h \div.control.button.is-success.is-outlined {
|
||||||
|
onclick: ->
|
||||||
|
# TODO
|
||||||
|
console.log "right: #{self.new-user-permission.permission}, user #{self.new-user-permission.id}"
|
||||||
|
} [ "+" ]
|
||||||
|
]
|
||||||
|
|
||||||
|
h \hr []
|
||||||
|
|
||||||
h \p [ "Choose the columns" ]
|
h \p [ "Choose the columns" ]
|
||||||
|
|
||||||
for dom in (self.extra_properties.columns.map (column) -> col-to-lines column, self)
|
for dom in (self.extra_properties.columns.map (column) -> col-to-lines column, self)
|
||||||
@ -131,7 +178,6 @@ ProjectCreationModal = (project, todod-ws) ->
|
|||||||
self.new-column-input.title := "New column !"
|
self.new-column-input.title := "New column !"
|
||||||
} [ "+" ]
|
} [ "+" ]
|
||||||
]
|
]
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
on-validation: ->
|
on-validation: ->
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
# TODO: on modification, the description isn't updated on the client
|
||||||
|
|
||||||
h = require 'maquette' .h
|
h = require 'maquette' .h
|
||||||
Modal = require './modal.ls'
|
Modal = require './modal.ls'
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ Task = (self, project, todod-ws) ->
|
|||||||
modal := TaskCreationModal project, todod-ws, self
|
modal := TaskCreationModal project, todod-ws, self
|
||||||
} [ "Edit" ]
|
} [ "Edit" ]
|
||||||
|
|
||||||
h \div.button {
|
h \div.button.is-danger {
|
||||||
onclick: ->
|
onclick: ->
|
||||||
modal := TaskRemovalModal project.id, todod-ws, self
|
modal := TaskRemovalModal project.id, todod-ws, self
|
||||||
} [ "X" ]
|
} [ "X" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user