diff --git a/csviatimodeleditor/__init__.py b/csviatimodeleditor/__init__.py index 200d183..a1f0ff0 100755 --- a/csviatimodeleditor/__init__.py +++ b/csviatimodeleditor/__init__.py @@ -47,7 +47,7 @@ def generate_csrf_token(): return session['_csrf_token'] app.jinja_env.globals['csrf_token'] = generate_csrf_token -app.jinja_env.globals['version'] = '2.3-beta' +app.jinja_env.globals['version'] = '2.3' class IATIModel(db.Model): diff --git a/csviatimodeleditor/static/main.js b/csviatimodeleditor/static/main.js index 6f3963c..a7d79bd 100644 --- a/csviatimodeleditor/static/main.js +++ b/csviatimodeleditor/static/main.js @@ -2202,7 +2202,9 @@ DimensionsWidget = (function(_super) { } for (name in dims) { obj = dims[name]; - this.addDimension(name).deserialize(data); + if (obj['datatype'] !== 'column') { + this.addDimension(name).deserialize(data); + } } return this.element.trigger('fillIATIfieldsRequest', [$(document).find('select.iati_field_add')]); }; @@ -2332,7 +2334,6 @@ ModelEditor = (function(_super) { function ModelEditor(element, options) { var common_multiples, ctor, e, model_data, other_multiples, selector, x, _i, _len, _ref3, _ref4; ModelEditor.__super__.constructor.apply(this, arguments); - console.log(this.options.iatifields); common_multiples = ['transaction', 'sector', 'recipient-country', 'recipient-region']; other_multiples = (function() { var _i, _len, _ref3, _results; @@ -2346,7 +2347,6 @@ ModelEditor = (function(_super) { } return _results; }).call(this); - console.log(other_multiples); $('#multiple_rows_selector').html('Common choices:
' + ((function() { var _i, _len, _results; _results = []; @@ -2485,6 +2485,7 @@ ModelEditor = (function(_super) { ModelEditor.prototype.onModelChange = function() { var dimNames, k, n, v, w, _i, _len, _ref3, _ref4; + this.onFillColumnsRequest($('#hierarchy_select')); _ref3 = util.flattenObject(this.data); for (k in _ref3) { v = _ref3[k]; diff --git a/csviatimodeleditor/templates/model.html b/csviatimodeleditor/templates/model.html index 1e70fbb..24fabcd 100755 --- a/csviatimodeleditor/templates/model.html +++ b/csviatimodeleditor/templates/model.html @@ -289,6 +289,17 @@

Organisation information

The encoding of your data.

+ +
+ Hierarchies (optional) +
+
+ + + +
+

How is your data structured? You can have one row per activity, or multiple rows per activity. @@ -352,7 +363,6 @@

Mapping

-

diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 1053818..1841fca 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -9,6 +9,7 @@ Version 2.3 XML file - Add encoding override - Support for more than one element having multiple rows per activity +- Contact information is populated correctly in the XML UI Changes diff --git a/src/modeleditor.coffee b/src/modeleditor.coffee index 332eed0..a8bb16b 100755 --- a/src/modeleditor.coffee +++ b/src/modeleditor.coffee @@ -440,6 +440,7 @@ class DimensionsWidget extends Delegator @element.trigger('doFieldSelectors', 'iatifield') @element.trigger('doFieldSelectors', 'column') + addDimension: (name) -> w = new DimensionWidget(name, @dimsEl) @widgets.push(w) @@ -475,7 +476,8 @@ class DimensionsWidget extends Delegator # Any keys left in dims need to be added for name, obj of dims - this.addDimension(name).deserialize(data) + if obj['datatype'] != 'column' + this.addDimension(name).deserialize(data) @element.trigger('fillIATIfieldsRequest', [$(document).find('select.iati_field_add')]) @@ -560,10 +562,8 @@ class ModelEditor extends Delegator constructor: (element, options) -> super - console.log(@options.iatifields) common_multiples = [ 'transaction', 'sector', 'recipient-country', 'recipient-region' ] other_multiples = (x for x in @options.iatifields when not (x in common_multiples)) - console.log(other_multiples) $('#multiple_rows_selector').html( 'Common choices:
'+ @@ -668,6 +668,9 @@ class ModelEditor extends Delegator return false; onModelChange: () -> + #FIXME + @onFillColumnsRequest($('#hierarchy_select')) + # Populate straightforward bits for k, v of util.flattenObject(@data) # FIXME? this may not deal with complex form elements such as radio