Skip to content

Commit

Permalink
Restore template for flattening, and restore test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 6, 2020
1 parent 686643f commit 1d3491a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
20 changes: 19 additions & 1 deletion cove_oc4ids/templates/cove_oc4ids/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,25 @@ <h4 class="panel-title">
<div id="downloadData" class="collapse in panel-body">
<p>{% trans "Alternative formats for reviewing your data" %}</p>

{% if conversion == 'unflatten' %}
{% if conversion == 'flatten' %}
<p>{% trans "Conversion of your (JSON) data into a spreadsheet format. The results can be seen below" %}.</p>
<ul class="list-unstyled left-space">
<li>
<span class="glyphicon glyphicon-download" aria-hidden="true"></span> <a href="{{original_file.url}}">{{JSON}} <small>({{original}})</small></a> <small>{{original_file.size|filesizeformat }}</small>
</li>
{% if not conversion_error %}
<li>
<span class="glyphicon glyphicon-download" aria-hidden="true"></span> <a href="{{converted_url}}.xlsx">{{xlsx}} <small>({{converted}})</small></a> <small>{{converted_file_size|filesizeformat }}</small>
</li>
{% endif %}
</ul>
{% if conversion_error %}
<p>{% blocktrans %}The JSON could not be converted to Spreadsheet due to the error:{% endblocktrans %} {{ conversion_error }}</p>

{% include 'error_extra.html' %}
{% endif %}

{% elif conversion == 'unflatten' %}
<p>{% trans "Conversion of your data into JSON format. The results can be seen below" %}.</p>
<ul class="list-unstyled">
<li>
Expand Down
5 changes: 0 additions & 5 deletions cove_oc4ids/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
'null',
'1',
'{}',
None,
])
def test_explore_page(client, json_data):
if json_data is None:
with open('data.json') as f:
json_data = f.read()

data = SuppliedData.objects.create()
data.original_file.save('test.json', ContentFile(json_data))
data.current_app = 'cove_oc4ids'
Expand Down

0 comments on commit 1d3491a

Please sign in to comment.