Mercurial > lada > lada-client
changeset 1423:ee21d0e1b998
Pipe out more information in import report.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 06 Apr 2017 10:14:28 +0200 |
parents | dc5851d433e8 |
children | 44d28e46cc4b |
files | app/view/form/Messung.js app/view/form/Probe.js app/view/window/ImportResponse.js |
diffstat | 3 files changed, 28 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/app/view/form/Messung.js Wed Apr 05 16:04:36 2017 +0200 +++ b/app/view/form/Messung.js Thu Apr 06 10:14:28 2017 +0200 @@ -316,7 +316,11 @@ var i18n = Lada.getApplication().bundle; if (warnings) { for (key in warnings) { - element = this.down('component[name=' + key + ']'); + var tmp = key; + if (tmp.indexOf('#') > 0) { + tmp = tmp.split('#')[0]; + } + element = this.down('component[name=' + tmp + ']'); if (!element) { continue; } @@ -330,7 +334,11 @@ } if (errors) { for (key in errors) { - element = this.down('component[name=' + key + ']'); + var tmp = key; + if (tmp.indexOf('#') > 0) { + tmp = tmp.split('#')[0]; + } + element = this.down('component[name=' + tmp + ']'); if (!element) { continue; }
--- a/app/view/form/Probe.js Wed Apr 05 16:04:36 2017 +0200 +++ b/app/view/form/Probe.js Thu Apr 06 10:14:28 2017 +0200 @@ -480,7 +480,11 @@ var i18n = Lada.getApplication().bundle; if (warnings) { for (key in warnings) { - element = this.down('component[name=' + key + ']'); + var tmp = key; + if (tmp.indexOf('#') > 0) { + tmp = tmp.split('#')[0]; + } + element = this.down('component[name=' + tmp + ']'); if (!element) { continue; } @@ -494,7 +498,11 @@ } if (errors) { for (key in errors) { - element = this.down('component[name=' + key + ']'); + var tmp = key; + if (tmp.indexOf('#') > 0) { + tmp = tmp.split('#')[0]; + } + element = this.down('component[name=' + tmp + ']'); if (!element) { continue; }
--- a/app/view/window/ImportResponse.js Wed Apr 05 16:04:36 2017 +0200 +++ b/app/view/window/ImportResponse.js Thu Apr 06 10:14:28 2017 +0200 @@ -164,7 +164,10 @@ for (var i = msgs.length - 1; i >= 0; i--) { if (msgs[i].key === 'validation') { validation.push('<ol>'); - validation.push(Lada.getApplication().bundle.getMsg(msgs[i].value) + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); + var parts = msgs[i].value.split('#'); + var str = Lada.getApplication().bundle.getMsg(parts[0]) + + parts[1] === undefined ? '' : parts[1]; + validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); validation.push('</ol>'); } else { @@ -198,7 +201,10 @@ for (var i = msgs.length - 1; i >= 0; i--) { if (msgs[i].key === 'validation') { validation.push('<ol>'); - validation.push(Lada.getApplication().bundle.getMsg(msgs[i].value) + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); + var parts = msgs[i].value.split('#'); + var str = Lada.getApplication().bundle.getMsg(parts[0]) + + parts[1] === undefined ? '' : parts[1]; + validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); validation.push('</ol>'); } else {