diff --git a/static/js/pandora/ui/folderBrowserBar.js b/static/js/pandora/ui/folderBrowserBar.js
index 46d7d9953..7ff171d9d 100644
--- a/static/js/pandora/ui/folderBrowserBar.js
+++ b/static/js/pandora/ui/folderBrowserBar.js
@@ -31,7 +31,6 @@ pandora.ui.folderBrowserBar = function(id) {
})
.bindEvent({
change: function(data) {
- Ox.print('ID::', id)
var key = pandora.$ui.findListSelect[id].value() == 'user' ? 'user' : 'name',
value = data.value;
updateItems(key, value);
@@ -51,10 +50,10 @@ pandora.ui.folderBrowserBar = function(id) {
var query = id == 'favorite' ? {conditions: [
{key: 'status', value: 'public', operator: '='},
{key: 'user', value: pandora.user.username, operator: '!=='},
- {key: key, value: value, operator: ''}
+ {key: key, value: value, operator: '='}
], operator: '&'} : {conditions: [
{key: 'status', value: 'private', operator: '!='},
- {key: key, value: value, operator: ''}
+ {key: key, value: value, operator: '='}
], operator: '&'};
return pandora.api.findLists(Ox.extend(data, {
query: query
diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js
index fe66b5402..5bce352e8 100644
--- a/static/js/pandora/ui/folderBrowserList.js
+++ b/static/js/pandora/ui/folderBrowserList.js
@@ -19,8 +19,8 @@ pandora.ui.folderBrowserList = function(id) {
id: 'id',
operator: '+',
title: $('').attr({
- src: Ox.UI.getImageURL('symbolIcon')
- }),
+ src: Ox.UI.getImageURL('symbolIcon')
+ }),
unique: true,
visible: true,
width: 16
diff --git a/static/js/pandora/ui/usersDialog.js b/static/js/pandora/ui/usersDialog.js
index 284286914..4131dbeff 100644
--- a/static/js/pandora/ui/usersDialog.js
+++ b/static/js/pandora/ui/usersDialog.js
@@ -1,7 +1,306 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.usersDialog = function() {
+
var height = Math.round((window.innerHeight - 48) * 0.9),
width = Math.round(window.innerWidth * 0.9),
+ levelColors = {
+ 'member': [128, 128, 0],
+ 'friend': [0, 128, 0],
+ 'staff': [0, 128, 128],
+ 'admin': [0, 0, 128]
+ },
+ numberOfUsers = 0,
+ userLevels = ['member', 'friend', 'staff', 'admin'],
+
+ $status = Ox.Label({
+ title: 'Loading...'
+ })
+ .css({float: 'left', margin: '4px'}),
+
+ $exportButton = Ox.Button({
+ title: 'Export E-Mail Addresses'
+ })
+ .css({margin: '4px 4px 4px 0'})
+ .bindEvent({
+ click: function() {
+ pandora.api.findUsers({
+ query: {conditions: [], operator: '&'},
+ keys: ['mail', 'username'],
+ range: [0, numberOfUsers],
+ sort: [{key: 'username', operator: '+'}]
+ }, function(result) {
+ var $dialog = Ox.Dialog({
+ buttons: [
+ Ox.Button({
+ title: 'Close'
+ })
+ .bindEvent({
+ click: function() {
+ $dialog.close();
+ }
+ })
+ ],
+ content: Ox.Element()
+ .addClass('OxSelectable')
+ .css({margin: '16px'})
+ .html(
+ result.data.items.map(function(item) {
+ return item.username + ' <' + 'mail@example.com' + '>'
+ }).join(', ')
+ ),
+ title: 'E-Mail Addresses'
+ })
+ .open()
+ })
+ }
+ }),
+
+ $findSelect = Ox.Select({
+ items: [
+ {id: 'all', title: 'Find: All', checked: true},
+ {id: 'username', title: 'Find: Username'},
+ {id: 'email', title: 'Find: E-Mail-Address'}
+ ],
+ overlap: 'right',
+ type: 'image'
+ })
+ .bindEvent({
+ change: function(data) {
+ var key = data.selected[0].id,
+ value = $findInput.value();
+ value && updateItems(key, value);
+ $findInput.options({
+ placeholder: data.selected[0].title
+ });
+ }
+ }),
+
+ $findInput = Ox.Input({
+ changeOnKeypress: true,
+ clear: true,
+ placeholder: 'Find: All',
+ width: 192
+ })
+ .bindEvent({
+ change: function(data) {
+ var key = $findSelect.value(),
+ value = data.value;
+ updateItems(key, value);
+ }
+ }),
+
+ $findElement = Ox.FormElementGroup({
+ elements: [
+ $findSelect,
+ $findInput
+ ]
+ })
+ .css({float: 'right', margin: '4px'}),
+
+ $list = Ox.TextList({
+ columns: [
+ {
+ clickable: true,
+ format: function(value) {
+ return $('
')
+ .attr({
+ src: Ox.UI.getImageURL('symbolCheck')
+ })
+ .css({
+ width: '10px',
+ height: '10px',
+ padding: '3px',
+ opacity: value ? 0.25 : 1
+ });
+ },
+ id: 'disabled',
+ operator: '-',
+ title: $('
').attr({
+ src: Ox.UI.getImageURL('symbolCheck')
+ }),
+ tooltip: function(data) {
+ return data.disabled ? 'Enable User' : 'Disable User';
+ },
+ visible: true,
+ width: 16
+ },
+ {
+ format: function(value, data) {
+ return '' + value + '';
+ },
+ id: 'username',
+ operator: '+',
+ removable: false,
+ title: 'Username',
+ visible: true,
+ unique: true,
+ width: 120
+ },
+ {
+ format: function(value, data) {
+ return '' + value + '';
+ },
+ id: 'email',
+ operator: '+',
+ title: 'E-Mail Address',
+ visible: true,
+ width: 180
+ },
+ {
+ align: 'center',
+ format: function(value) {
+ return $('