Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.0 KiB

  1. // kate: space-indent on; indent-width 4; replace-tabs on;
  2. function render_mumble( divname, urls ){
  3. Ext.QuickTips.init();
  4. var adminform = new Ext.ux.MumbleForm({
  5. title: gettext("Administration"),
  6. buttons: [{
  7. text: "doit",
  8. handler: function( btn ){
  9. this.ownerCt.ownerCt.getForm().load({ params: {pk: 1} });
  10. }
  11. }, {
  12. text: "submit",
  13. handler: function( btn ){
  14. this.ownerCt.ownerCt.getForm().submit({ params: {pk: 1} });
  15. }
  16. }]
  17. });
  18. var mainpanel = new Ext.Panel({
  19. renderTo: divname,
  20. height: 600,
  21. layout: "border",
  22. items: [{
  23. xtype: "mumblechannelviewer",
  24. region: "west",
  25. width: 350,
  26. split: true,
  27. source_url: urls.data,
  28. }, {
  29. xtype: "tabpanel",
  30. region: "center",
  31. activeTab: 0,
  32. items: [{
  33. title: gettext("Registration"),
  34. xtype: "form",
  35. items: [{
  36. name: "username",
  37. fieldLabel: gettext("User name"),
  38. xtype: "textfield",
  39. }, {
  40. name: "password",
  41. fieldLabel: gettext("Password"),
  42. xtype: "textfield",
  43. inputType: "password",
  44. }],
  45. }, adminform, {
  46. title: gettext("User texture"),
  47. layout: "border",
  48. items: [{
  49. region: "north",
  50. layout: "hbox",
  51. height: 220,
  52. items: [{
  53. flex: 1,
  54. height: 200,
  55. title: gettext("Texture"),
  56. html: String.format('<img src="{0}" alt="Avatar" />', urls.myavatar),
  57. }, {
  58. flex: 1,
  59. height: 200,
  60. title: gettext("Gravatar"),
  61. html: String.format('<img src="{0}" alt="grAvatar" />', urls.gravatar),
  62. }],
  63. }, {
  64. region: "center",
  65. xtype: "form",
  66. items: [{
  67. name: "usegravatar",
  68. fieldLabel: gettext("Use Gravatar"),
  69. xtype: "checkbox",
  70. }, {
  71. name: "uploadpic",
  72. fieldLabel: gettext("Upload Avatar"),
  73. xtype: "textfield",
  74. inputType: "file",
  75. }],
  76. }],
  77. }, {
  78. xtype: "userEditorPanel",
  79. django_users_url: urls.django_users,
  80. mumble_users_url: urls.mumble_users,
  81. } ],
  82. }],
  83. });
  84. adminform.getForm().load({ params: {pk: 1} });
  85. }