Browse Source
add usereditor, use Django's jsi18n, language update
Natenom/support-murmur-13-1446181288462
add usereditor, use Django's jsi18n, language update
Natenom/support-murmur-13-1446181288462
Michael Ziegler
15 years ago
11 changed files with 389 additions and 61 deletions
-
171htdocs/js/mumble.js
-
152htdocs/js/usereditor.js
-
BINpyweb/mumble/locale/de/LC_MESSAGES/django.mo
-
BINpyweb/mumble/locale/de/LC_MESSAGES/djangojs.mo
-
108pyweb/mumble/locale/de/LC_MESSAGES/djangojs.po
-
BINpyweb/mumble/locale/fr/LC_MESSAGES/django.mo
-
BINpyweb/mumble/locale/it/LC_MESSAGES/django.mo
-
BINpyweb/mumble/locale/ja/LC_MESSAGES/django.mo
-
8pyweb/mumble/templates/mumble/mumble.html
-
4pyweb/templates/index.html
-
7pyweb/urls.py
@ -0,0 +1,152 @@ |
|||
// {% load mumble_extras %}
|
|||
// {% load i18n %}
|
|||
// {% comment %}
|
|||
// kate: space-indent on; indent-width 2; replace-tabs on;
|
|||
// {% endcomment %}
|
|||
|
|||
Ext.namespace('Ext.ux'); |
|||
|
|||
Ext.ux.UserEditorPanel = function( config ){ |
|||
Ext.apply( this, config ); |
|||
|
|||
userRecord = Ext.data.Record.create([ |
|||
{ name: 'id', type: 'int' }, |
|||
{ name: 'name', type: 'string' }, |
|||
{ name: 'password', type: 'string' }, |
|||
{ name: 'owner', type: 'int' }, |
|||
{ name: 'admin', type: 'bool' }, |
|||
{ name: 'delete', type: 'bool' } |
|||
]); |
|||
|
|||
userAdminStore = new Ext.data.Store({ |
|||
url: config.mumble_users_url, |
|||
reader: new Ext.data.JsonReader({ |
|||
root: 'objects', |
|||
fields: userRecord |
|||
}), |
|||
autoLoad: true, |
|||
remoteSort: false |
|||
}); |
|||
|
|||
adminColumn = new Ext.grid.CheckColumn({ |
|||
header: gettext("Admin on root channel"), |
|||
dataIndex: 'admin', |
|||
width: 50 |
|||
}); |
|||
|
|||
deleteColumn = new Ext.grid.CheckColumn({ |
|||
header: gettext("Delete"), |
|||
dataIndex: 'delete', |
|||
width: 50 |
|||
}); |
|||
|
|||
ownerCombo = new Ext.form.ComboBox({ |
|||
name: 'owner', |
|||
hiddenName: 'owner_id', |
|||
forceSelection: true, |
|||
triggerAction: 'all', |
|||
valueField: 'uid', |
|||
displayField: 'uname', |
|||
store: new Ext.data.Store({ |
|||
url: config.django_users_url, |
|||
reader: new Ext.data.JsonReader({ |
|||
fields: [ 'uid', 'uname' ], |
|||
root: 'objects' |
|||
}), |
|||
autoLoad: true |
|||
}) |
|||
}); |
|||
|
|||
Ext.applyIf( this, { |
|||
title: gettext("User List"), |
|||
store: userAdminStore, |
|||
viewConfig: { forceFit: true }, |
|||
|
|||
cm: new Ext.grid.ColumnModel( [ { |
|||
header: gettext("name"), |
|||
dataIndex: 'name', |
|||
sortable: true, |
|||
editor: new Ext.form.TextField({ |
|||
allowBlank: false |
|||
}) |
|||
}, { |
|||
header: gettext("Account owner"), |
|||
dataIndex: 'owner', |
|||
editor: ownerCombo, |
|||
sortable: true, |
|||
renderer: function( value ){ |
|||
if( value == '' ) return ''; |
|||
items = ownerCombo.store.data.items; |
|||
for( i = 0; i < items.length; i++ ) |
|||
if( items[i].data.uid == value ) |
|||
return items[i].data.uname; |
|||
} |
|||
}, adminColumn, { |
|||
header: gettext("Change password"), |
|||
dataIndex: 'password', |
|||
editor: new Ext.form.TextField({ |
|||
inputType: 'password' |
|||
}), |
|||
renderer: function( value ){ |
|||
ret = ''; |
|||
for( i = 0; i < value.length; i++ ) |
|||
ret += '*'; |
|||
return ret; |
|||
} |
|||
}, deleteColumn ] ), |
|||
|
|||
tbar: [{ |
|||
text: gettext("Add"), |
|||
handler : function(){ |
|||
userAdminStore.add( new userRecord( { |
|||
id: -1, |
|||
name: gettext('New User'), |
|||
admin: false, |
|||
owner: '', |
|||
password: '', |
|||
'delete': false |
|||
} ) ); |
|||
} |
|||
}, { |
|||
text: gettext("Save"), |
|||
handler : function(){ |
|||
data = []; |
|||
for( i = 0; i < userAdminStore.data.items.length; i++ ){ |
|||
rec = userAdminStore.data.items[i]; |
|||
if( rec.dirty ){ |
|||
data.push(rec.data); |
|||
} |
|||
} |
|||
var conn = new Ext.data.Connection(); |
|||
conn.request( { |
|||
url: userAdminStore.url, |
|||
params: { data: Ext.encode( data ) }, |
|||
success: function(){ |
|||
for( i = 0; i < userAdminStore.data.items.length; i++ ){ |
|||
rec = userAdminStore.data.items[i]; |
|||
if( rec.data['delete'] == true ) |
|||
userAdminStore.remove( rec ); |
|||
else if( rec.dirty ){ |
|||
rec.commit(); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, { |
|||
text: gettext("Resync with Murmur"), |
|||
handler: function(){ |
|||
userAdminStore.reload({ |
|||
params: { 'resync': 'true' } |
|||
}); |
|||
} |
|||
}], |
|||
plugins: [ adminColumn, deleteColumn ] |
|||
}); |
|||
Ext.ux.UserEditorPanel.superclass.constructor.call( this ); |
|||
}; |
|||
|
|||
Ext.extend( Ext.ux.UserEditorPanel, Ext.grid.EditorGridPanel, { |
|||
} ); |
|||
|
|||
Ext.reg( 'userEditorPanel', Ext.ux.UserEditorPanel ); |
@ -0,0 +1,108 @@ |
|||
# SOME DESCRIPTIVE TITLE. |
|||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
|||
# This file is distributed under the same license as the PACKAGE package. |
|||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
|||
# |
|||
#, fuzzy |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: PACKAGE VERSION\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2010-07-02 11:38+0200\n" |
|||
"PO-Revision-Date: 2010-07-02 11:41\n" |
|||
"Last-Translator: <diese-addy@funzt-halt.net>\n" |
|||
"Language-Team: LANGUAGE <LL@li.org>\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: 8bit\n" |
|||
"Language: \n" |
|||
"X-Translated-Using: django-rosetta 0.5.5\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1)\n" |
|||
|
|||
#: js/mumble.js:10 |
|||
msgid "Channel Viewer" |
|||
msgstr "Serveransicht" |
|||
|
|||
#: js/mumble.js:12 |
|||
msgid "Loading..." |
|||
msgstr "Lade..." |
|||
|
|||
#: js/mumble.js:16 |
|||
msgid "Refresh" |
|||
msgstr "Aktualisieren" |
|||
|
|||
#: js/mumble.js:95 |
|||
msgid "Registration" |
|||
msgstr "Registrierung" |
|||
|
|||
#: js/mumble.js:99 |
|||
msgid "User name" |
|||
msgstr "Benutzername" |
|||
|
|||
#: js/mumble.js:103 |
|||
msgid "Password" |
|||
msgstr "Passwort" |
|||
|
|||
#: js/mumble.js:108 |
|||
msgid "Administration" |
|||
msgstr "Administration" |
|||
|
|||
#: js/mumble.js:116 |
|||
msgid "User texture" |
|||
msgstr "Benutzertextur" |
|||
|
|||
#: js/mumble.js:124 |
|||
msgid "Texture" |
|||
msgstr "Textur" |
|||
|
|||
#: js/mumble.js:128 |
|||
msgid "Gravatar" |
|||
msgstr "Gravatar" |
|||
|
|||
#: js/mumble.js:136 |
|||
msgid "Use Gravatar" |
|||
msgstr "Benutze Gravatar" |
|||
|
|||
#: js/mumble.js:140 |
|||
msgid "Upload Avatar" |
|||
msgstr "Avatar hochladen" |
|||
|
|||
#: js/usereditor.js:33 |
|||
msgid "Admin on root channel" |
|||
msgstr "Admin im Wurzelkanal" |
|||
|
|||
#: js/usereditor.js:39 |
|||
msgid "Delete" |
|||
msgstr "Löschen" |
|||
|
|||
#: js/usereditor.js:62 |
|||
msgid "User List" |
|||
msgstr "Benutzerliste" |
|||
|
|||
#: js/usereditor.js:67 |
|||
msgid "name" |
|||
msgstr "Name" |
|||
|
|||
#: js/usereditor.js:74 |
|||
msgid "Account owner" |
|||
msgstr "Accountbesitzer" |
|||
|
|||
#: js/usereditor.js:86 |
|||
msgid "Change password" |
|||
msgstr "Passwort ändern" |
|||
|
|||
#: js/usereditor.js:100 |
|||
msgid "Add" |
|||
msgstr "Hinzufügen" |
|||
|
|||
#: js/usereditor.js:104 |
|||
msgid "New User" |
|||
msgstr "Neuer Benutzer" |
|||
|
|||
#: js/usereditor.js:112 |
|||
msgid "Save" |
|||
msgstr "Speichern" |
|||
|
|||
#: js/usereditor.js:138 |
|||
msgid "Resync with Murmur" |
|||
msgstr "Aktualisieren" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue