Mercurial > lada > lada-client
comparison app/controller/Proben.js @ 382:91193c49c2bb
Make the error dialog look better.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Thu, 29 Aug 2013 10:28:58 +0200 |
parents | 9bc080ecdbc9 |
children | c5188d71ef87 |
comparison
equal
deleted
inserted
replaced
381:9bc080ecdbc9 | 382:91193c49c2bb |
---|---|
11 out.push("<strong>Fehler:</strong>"); | 11 out.push("<strong>Fehler:</strong>"); |
12 out.push("<br/>"); | 12 out.push("<br/>"); |
13 if (errors) { | 13 if (errors) { |
14 out.push("<ol>"); | 14 out.push("<ol>"); |
15 for (var key in errors) { | 15 for (var key in errors) { |
16 out.push("<li>"+key+"</li>"); | 16 out.push("<li>"+key) |
17 var msgs = errors[key]; | |
18 out.push("<ol>"); | |
19 for (var i = msgs.length - 1; i >= 0; i--){ | |
20 out.push("<li>"+msgs[i].key+" ("+msgs[i].code+"): "+msgs[i].value+"</li>") | |
21 }; | |
22 out.push("</ol>"); | |
23 out.push("</li>"); | |
17 } | 24 } |
18 out.push("</ol>"); | 25 out.push("</ol>"); |
19 } else { | 26 } else { |
20 out.push("Keine Fehler"); | 27 out.push("Keine Fehler"); |
21 out.push("<br/>"); | 28 out.push("<br/>"); |
23 out.push("<strong>Warnungen:</strong>"); | 30 out.push("<strong>Warnungen:</strong>"); |
24 out.push("<br/>"); | 31 out.push("<br/>"); |
25 if (warnings) { | 32 if (warnings) { |
26 out.push("<ol>"); | 33 out.push("<ol>"); |
27 for (var key in warnings) { | 34 for (var key in warnings) { |
28 out.push("<li>"+key+"</li>"); | 35 out.push("<li>"+key) |
36 var msgs = warnings[key]; | |
37 out.push("<ol>"); | |
38 for (var i = msgs.length - 1; i >= 0; i--){ | |
39 out.push("<li>"+msgs[i].key+" ("+msgs[i].code+"): "+msgs[i].value+"</li>") | |
40 }; | |
41 out.push("</ol>"); | |
42 out.push("</li>"); | |
29 } | 43 } |
30 out.push("</ol>"); | 44 out.push("</ol>"); |
31 } else { | 45 } else { |
32 out.push("Keine Warnungen"); | 46 out.push("Keine Warnungen"); |
33 out.push("<br/>"); | 47 out.push("<br/>"); |
118 var filename = resp.result.data[2].filename; | 132 var filename = resp.result.data[2].filename; |
119 Ext.Msg.alert('Erfolg! ', 'Die Datei "' + filename + '" wurde erfolgreich importiert.'); | 133 Ext.Msg.alert('Erfolg! ', 'Die Datei "' + filename + '" wurde erfolgreich importiert.'); |
120 win.close(); | 134 win.close(); |
121 }, | 135 }, |
122 failure: function(fp, resp) { | 136 failure: function(fp, resp) { |
123 var errors = resp.result.data[0]; | 137 var errors = resp.result.data.errors; |
124 var warnings = resp.result.data[1]; | 138 var warnings = resp.result.data.warnings; |
125 var filename = resp.result.data[2].filename; | 139 var filename = resp.result.data.filename; |
126 var message = resp.message; | 140 var message = resp.result.message; |
127 var dialogbody = buildImportReport(filename, message, errors.parser, warnings) | 141 var dialogbody = buildImportReport(filename, message, errors, warnings) |
128 Ext.Msg.alert('Fehler', dialogbody); | 142 Ext.Msg.alert('Fehler', dialogbody); |
129 win.close(); | 143 win.close(); |
130 } | 144 } |
131 }); | 145 }); |
132 } | 146 } |