Commit 4d4c9bd1 authored by Merret Buurman's avatar Merret Buurman
Browse files

Added cmip6 fallback page.

parent 7a210732
......@@ -2,7 +2,7 @@ from django.template import loader
import requests
import json
import xml.etree.ElementTree as ET
import filelevel, datasetlevel
import filelevel, datasetlevel, fallback
from landingpage.landingpageapp.handle import retrieval, cmip6parser
......@@ -19,7 +19,7 @@ def _get_template_for_aggregation_level(json_record):
elif cmip6parser.is_dataset(json_record):
return datasetlevel.get_template()
return loader.get_template('landingpage/cmip6_fallback.html') # TODO
return fallback.get_template()
def _get_context_for_aggregation_level(json_record):
......@@ -28,12 +28,9 @@ def _get_context_for_aggregation_level(json_record):
elif cmip6parser.is_dataset(json_record):
return datasetlevel.get_context(json_record)
return _get_dict_generic(json_record) # TODO
return fallback.get_context(json_record)
def _get_handle_info_for_dataset(values):
return {}
def _get_dict_generic(values):
return {}
from django.template import loader
import xml.etree.ElementTree as ET
import landingpage.landingpageapp.handle.cmip6parser as parser
# API of this module:
def get_context(json_record):
return _get_context(json_record)
def get_template():
return _get_template()
def _get_template():
return loader.get_template('landingpage/cmip6_fallback.html')
# Logic of this module:
def _get_context(json_record):
context = {}
context['content'] = json_record
context['handle'] = json_record['handle']
context['agg_level'] = parser._get_aggregation_level(json_record)
context['values'] = parser.get_all_entries_as_dict(json_record)
{% extends "landingpage/cmip6_headerfooter.html" %}
{% block content %}
<div class="section">
<h1>Landing page for Handle {{ handle }}</h1>
<div class="section">
{% if agg_level %}
<p>Landing page for {{agg_level}} {{ handle }} not implemented yet.</p>
{% else %}
<p>The handle {{ handle }} does not have information on its aggregation level (file, dataset, ...). or this reason, we cannot show its regular landing page.</p>
{% endif %}
<p>We would be happy to <a href="">hear from you</a> where you found the link to this handle, so we can fix the problem. Thanks a lot!</p>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment