Commit d8e9e549 authored by Merret Buurman's avatar Merret Buurman
Browse files

Normal landing page (non-CMIP) now uses template.

parent d6d0ea16
from django.template import loader
import requests
def get_html_string(prefix, suffix):
string = '<h1>Landing Page</h1><p>This is a simple landing page for any handle:'+str(prefix)+'/'+str(suffix)+'</p>'
return string
def get_html_string(request, prefix, suffix):
template = loader.get_template('landingpage/normal_dkrz.html')
context = {
"handle": prefix+'/'+suffix
return template.render(context, request)
\ No newline at end of file
{% extends "landingpage/dkrz_headerfooter.html" %}
{% block content %}
The context object needs the following objects:
Simple values:
* drs
* handle [*]
* version
* newerversion
* any_part_replaced
[*] I do not check the existence of these, so if they don't exist, the page may break.
<div class="section">
<h1>PID Landing Page</h1>
<div class="section">
<p>This is a simple landing page for any handle: {{handle}}.</p>
{% endblock %}
\ No newline at end of file
......@@ -9,7 +9,7 @@ def prefix_only(request, prefix):
return HttpResponse(string)
def entire_handle(request, prefix, suffix):
string = default.get_html_string(prefix, suffix)
string = default.get_html_string(request, prefix, suffix)
return HttpResponse(string)
def prefix_only_cmip6(request, prefix):
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