diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-10-24 16:06:58 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-10-24 16:06:58 +0200 |
| commit | b45b7ad22cce753a00fff13981502e2c807cee79 (patch) | |
| tree | c186e399efd5715b073f17068ffa3fb3d4b004fa /addons/web/static/src | |
| parent | a8b81ed5754ef0f2495b28b517f2a5b7ed9ba749 (diff) | |
[IMP] import: only show second step once file has been uploaded
bzr revid: xmo@openerp.com-20111024140658-8t9csv9i6gd30luj
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/data_import.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 39 |
2 files changed, 21 insertions, 20 deletions
diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 025ff8df1c5..42f0cf8d680 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -80,7 +80,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.toggle_import_button(false); this.$element.find('#csvfile').change(this.on_autodetect_data); this.$element.find('fieldset').change(this.on_autodetect_data); - this.$element.find('fieldset legend').click(function() { + this.$element.delegate('fieldset legend', 'click', function() { $(this).next().toggle(); }); this.ready.push(new openerp.web.DataSet(this, this.model).call( diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7d010d5867b..201ac964ac9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1419,8 +1419,27 @@ <label for="csvfile">CSV File:</label> <input type="file" id="csvfile" size="50" name="csvfile"/> </p> - <h2 class="separator horizontal">2. Check your file format</h2> <div id="result"></div> +</form> +</t> +<t t-name="ImportView.result"> + <h2 class="separator horizontal">2. Check your file format</h2> + <table class="oe_import_grid" width="100%" style="margin: 5px 0;"> + <tr t-if="headers" class="oe_import_grid-header"> + <td t-foreach="headers" t-as="header" class="oe_import_grid-cell"> + <t t-esc="header"/></td> + </tr> + <tr> + <td t-foreach="records[0]" t-as="column"> + <input class="sel_fields" placeholder="--- Don't Import ---"/><span class="oe-m2o-drop-down-button"> + <img src="/web/static/src/img/down-arrow.png" /></span> + </td> + </tr> + <tr t-foreach="records" t-as="record" class="oe_import_grid-row"> + <td t-foreach="record" t-as="cell" class="oe_import_grid-cell"> + <t t-esc="cell"/></td> + </tr> + </table> <fieldset> <legend style="cursor:pointer;">Import Options</legend> <table style="display:none"> @@ -1451,25 +1470,7 @@ </tr> </table> </fieldset> -</form> </t> -<table t-name="ImportView.result" - class="oe_import_grid" width="100%" style="margin: 5px 0;"> - <tr t-if="headers" class="oe_import_grid-header"> - <td t-foreach="headers" t-as="header" class="oe_import_grid-cell"> - <t t-esc="header"/></td> - </tr> - <tr> - <td t-foreach="records[0]" t-as="column"> - <input class="sel_fields" placeholder="--- Don't Import ---"/><span class="oe-m2o-drop-down-button"> - <img src="/web/static/src/img/down-arrow.png" /></span> - </td> - </tr> - <tr t-foreach="records" t-as="record" class="oe_import_grid-row"> - <td t-foreach="record" t-as="cell" class="oe_import_grid-cell"> - <t t-esc="cell"/></td> - </tr> -</table> <t t-name="ImportView.error"> <p style="white-space:pre-line;">The import failed due to:<t t-esc="error.message"/></p> <t t-if="error.preview"> |
