From a74cd4410d4a61cd97e691042fd20b7ed9c83502 Mon Sep 17 00:00:00 2001 From: lombardofr Date: Thu, 23 Aug 2018 09:24:32 +0200 Subject: [PATCH] changed yaml indentation Change-Id: Ia76338949a2213982687d39cc974ff4ac91686ec Signed-off-by: lombardofr --- lib/util.py | 2 +- .../template/project/osm/descriptor/descriptor_view.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util.py b/lib/util.py index 9d33aa6..ac92c4d 100644 --- a/lib/util.py +++ b/lib/util.py @@ -78,7 +78,7 @@ class Util(object): def json2yaml(cls, object_json): """Converts a json object into a yaml representation""" log.debug('json2yaml') - return yaml.safe_dump(object_json, default_flow_style=False, indent=2) if not object_json is None else None + return yaml.safe_dump(object_json, default_flow_style=False, indent=4) if not object_json is None else None @classmethod def openfile(cls, filepath, mode='r', buffering=1): diff --git a/projecthandler/template/project/osm/descriptor/descriptor_view.html b/projecthandler/template/project/osm/descriptor/descriptor_view.html index 0b9512c..3fd70a2 100644 --- a/projecthandler/template/project/osm/descriptor/descriptor_view.html +++ b/projecthandler/template/project/osm/descriptor/descriptor_view.html @@ -64,17 +64,17 @@ Edit {{ descriptor_type|upper }} Descriptor editorJSON = CodeMirror(function (elt) { myJsonTextArea.parentNode.replaceChild(elt, myJsonTextArea); }, json_editor_settings); - - editorJSON.setValue(JSON.stringify({{descriptor_strings.descriptor_string_json | safe}}, null, "\t")); editorJSON.setOption("autoRefresh", true); + editorJSON.setSize("auto", "auto"); + var myYamlTextArea = document.getElementById("code_editor_yaml"); editorYaml = CodeMirror(function (elt) { myYamlTextArea.parentNode.replaceChild(elt, myYamlTextArea); }, yaml_editor_settings); var des_strings = {{descriptor_strings | safe}}; editorYaml.setValue(des_strings.descriptor_string_yaml); - + editorYaml.setSize("auto", "auto"); }); -- 2.17.1