diff --git a/factgenie/static/js/browse.js b/factgenie/static/js/browse.js index ed66e5c..61473d2 100644 --- a/factgenie/static/js/browse.js +++ b/factgenie/static/js/browse.js @@ -162,7 +162,18 @@ function fetchExample(dataset, split, example_idx) { return; } $("#dataset-spinner").hide(); - $("#examplearea").html(data.html); + + if (data.html === null) { + $("#centerpanel").hide(); + // disable Split.js + splitInstance.setSizes([0, 100]); + // center the right panel + $("#rightpanel").css("width", "50%"); + $("#rightpanel").css("margin", "auto"); + + } else { + $("#examplearea").html(data.html); + } showRawData(data); diff --git a/factgenie/workflows.py b/factgenie/workflows.py index 4a91bc5..90783e9 100644 --- a/factgenie/workflows.py +++ b/factgenie/workflows.py @@ -88,13 +88,14 @@ def get_example_data(app, dataset_id, split, example_idx, setup_id=None): try: html = dataset.render(example=example) + + if html is not None: + # temporary solution for external files + # prefix all the "/files" calls with "app.config["host_prefix"]" + html = html.replace('src="/files', f'src="{app.config["host_prefix"]}/files') except: raise ValueError("Example cannot be rendered") - # temporary solution for external files - # prefix all the "/files" calls with "app.config["host_prefix"]" - html = html.replace('src="/files', f'src="{app.config["host_prefix"]}/files') - if setup_id: generated_outputs = [ get_output_for_setup(dataset_id, split, example_idx, setup_id, app=app, force_reload=False)