Browse Source

make submit button text translateable (and translate it :P )

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
5046963d04
  1. 26
      pyweb/djextdirect/formprovider.py
  2. 2
      pyweb/mumble/templates/mumble/mumble.html

26
pyweb/djextdirect/formprovider.py

@ -35,6 +35,22 @@ Ext.namespace('Ext.ux');
Ext.ux.%(clsname)s = function( config ){ Ext.ux.%(clsname)s = function( config ){
Ext.apply( this, config ); Ext.apply( this, config );
Ext.applyIf( this, {
defaults: { "anchor": "-20px" },
paramsAsHash: true,
baseParams: {},
autoScroll: true,
submitButtonText: "Submit"
} );
Ext.applyIf( this, {
buttons: [{
text: this.submitButtonText,
handler: this.submit,
id: '%(clsname)s_submit',
scope: this
}]
});
var defaultconf = %(defaultconf)s; var defaultconf = %(defaultconf)s;
Ext.applyIf( this, defaultconf ); Ext.applyIf( this, defaultconf );
@ -276,16 +292,6 @@ class FormProvider(Provider):
'defaultconf': '{' 'defaultconf': '{'
'items:' + simplejson.dumps(items, indent=4) + ',' 'items:' + simplejson.dumps(items, indent=4) + ','
'fileUpload: ' + simplejson.dumps(hasfiles) + ',' 'fileUpload: ' + simplejson.dumps(hasfiles) + ','
'defaults: { "anchor": "-20px" },'
'paramsAsHash: true,'
'baseParams: {},'
'autoScroll: true,'
"""buttons: [{
text: "Submit",
handler: this.submit,
id: '"""+clsname+"""_submit',
scope: this
}]"""
'}', '}',
'apiconf': ('{' 'apiconf': ('{'
'load: ' + ("XD_%s.get" % clsname) + "," 'load: ' + ("XD_%s.get" % clsname) + ","

2
pyweb/mumble/templates/mumble/mumble.html

@ -117,6 +117,7 @@
{ {
title: "{% trans "Registration" %}", title: "{% trans "Registration" %}",
xtype: "{{ RegForm|lower }}", xtype: "{{ RegForm|lower }}",
submitButtonText: "{% trans 'Submit' %}",
pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %}, pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %},
labelWidth: 150, labelWidth: 150,
baseParams: {serverid: {{MumbleServer.id}} }, baseParams: {serverid: {{MumbleServer.id}} },
@ -154,6 +155,7 @@
pk: {{ MumbleServer.id }}, pk: {{ MumbleServer.id }},
labelWidth: 150, labelWidth: 150,
xtype: 'mumbleform', xtype: 'mumbleform',
submitButtonText: "{% trans 'Submit' %}",
listeners: { listeners: {
submitSuccess: function( form, action ){ submitSuccess: function( form, action ){
form.savetip = new Ext.ToolTip({ form.savetip = new Ext.ToolTip({

Loading…
Cancel
Save