cleanup user dialog form

This commit is contained in:
rolux 2011-10-03 15:01:47 +00:00
parent f75d2512c3
commit 978c86d37e

View file

@ -273,9 +273,7 @@ pandora.ui.usersDialog = function() {
$userLabel.options({ $userLabel.options({
title: values.username + ' <' + values.email + '>' title: values.username + ' <' + values.email + '>'
}); });
$user $user.append(renderUserForm(values))
.append(renderUserForm(values))
.append($deleteButton);
} else { } else {
$userLabel.options({title: 'No user selected'}); $userLabel.options({title: 'No user selected'});
} }
@ -291,57 +289,6 @@ pandora.ui.usersDialog = function() {
$user = Ox.Element({}), $user = Ox.Element({}),
$deleteButton = Ox.Button({
title: 'Delete User',
width: 96
})
.css({position: 'absolute', left: 8, bottom: 8})
.bindEvent({
click: function() {
var $dialog = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Cancel'
})
.bindEvent({
click: function() {
$dialog.close();
}
}),
Ox.Button({
title: 'Delete User'
})
.bindEvent({
click: function() {
// ...
$dialog.close();
}
})
],
// fixme: we need a template for this!
content: Ox.Element()
.append(
$('<img>')
.attr({src: '/static/png/icon64.png'})
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
)
.append(
Ox.Element()
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
.html(
'Are you sure that you want do delete the user "'
+ $list.value($list.options('selected')[0], 'username')
+ '"? This action cannot be undone.'
)
),
height: 128,
title: 'Delete User',
width: 304
})
.open()
}
}),
that = Ox.Dialog({ that = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
@ -409,6 +356,8 @@ pandora.ui.usersDialog = function() {
items: [ items: [
$checkbox = Ox.Checkbox({ $checkbox = Ox.Checkbox({
checked: !data.disabled, checked: !data.disabled,
label: 'Status',
labelWidth: 80,
title: 'Enabled', title: 'Enabled',
width: 240 width: 240
}) })
@ -418,6 +367,28 @@ pandora.ui.usersDialog = function() {
$checkbox.options({title: data.checked ? 'Enabled' : 'Disabled'}) $checkbox.options({title: data.checked ? 'Enabled' : 'Disabled'})
} }
}), }),
Ox.Input({
label: 'Username',
labelWidth: 80,
value: data.username,
width: 240
})
.bindEvent({
submit: function(data) {
}
}),
Ox.Input({
label: 'E-Mail',
labelWidth: 80,
value: data.email,
width: 240
})
.bindEvent({
submit: function(data) {
}
}),
Ox.Select({ Ox.Select({
items: userLevels.map(function(level) { items: userLevels.map(function(level) {
return { return {
@ -427,7 +398,7 @@ pandora.ui.usersDialog = function() {
}; };
}), }),
label: 'Level', label: 'Level',
labelWidth: 64, labelWidth: 80,
width: 240 width: 240
}), }),
/* /*
@ -436,7 +407,7 @@ pandora.ui.usersDialog = function() {
}), }),
*/ */
Ox.Input({ Ox.Input({
height: 240, height: 120,
placeholder: 'Notes', placeholder: 'Notes',
type: 'textarea', type: 'textarea',
width: 240 width: 240