comparison app/view/window/AuditTrail.js @ 1406:d1f6aa80758f

Audit-trail: Handle response with error message.
author Tom Gottfried <tom@intevation.de>
date Wed, 22 Mar 2017 15:01:35 +0100
parents 7cf7a8dc7818
children 2195fd3946e4
comparison
equal deleted inserted replaced
1405:24af0514618e 1406:d1f6aa80758f
73 failure: this.loadFailure 73 failure: this.loadFailure
74 }); 74 });
75 }, 75 },
76 76
77 loadSuccess: function(response) { 77 loadSuccess: function(response) {
78 var i18n = Lada.getApplication().bundle;
78 var json = Ext.decode(response.responseText); 79 var json = Ext.decode(response.responseText);
79 var container = this.down('panel[name=auditcontainer]'); 80 var container = this.down('panel[name=auditcontainer]');
80 if (this.type === 'probe') { 81 if (!json.success) {
81 var html = this.createHtmlProbe(json); 82 var html = '<p><strong>' + i18n.getMsg(json.message.toString())
83 + '</strong></p>';
82 container.update(html); 84 container.update(html);
83 } 85 }
84 else if (this.type === 'messung') { 86 else {
85 container.update(this.createHtmlMessung(json)); 87 if (this.type === 'probe') {
88 var html = this.createHtmlProbe(json);
89 container.update(html);
90 }
91 else if (this.type === 'messung') {
92 container.update(this.createHtmlMessung(json));
93 }
86 } 94 }
87 }, 95 },
88 96
89 createHtmlProbe: function(json) { 97 createHtmlProbe: function(json) {
90 var i18n = Lada.getApplication().bundle; 98 var i18n = Lada.getApplication().bundle;

http://lada.wald.intevation.org