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

Landing page for prefix only now uses template.

parent c5d300fe
......@@ -7,9 +7,12 @@ def no_handle_specified(request):
return template.render(context, request)
def only_prefix(prefix): # TODO Template!
string = '<h1>Missing suffix!</h1><p>You entered an incomplete handle, with only a prefix: '+str(prefix)+'</p>'
return string
def only_prefix(request, prefix):
template = loader.get_template('landingpage/prefix_only.html')
context = {
"prefix": prefix
return template.render(context, request)
def only_prefix_cmip6(request, prefix):
template = loader.get_template('landingpage/cmip6_prefix_only.html')
{% 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>Missing suffix</h1>
<div class="section">
<p>You entered an incomplete handle, with only a prefix
{% if prefix %}
{% endif %}
<p>If you were redirected to this page from somewhere, we would be happy to <a href="">hear from you</a> where you found the incomplete link. Thanks a lot!</p>
{% endblock %}
\ No newline at end of file
......@@ -5,7 +5,7 @@ from pages import errorpages, default
from pages.cmip6 import entrypoint
def prefix_only(request, prefix):
string = errorpages.only_prefix(prefix)
string = errorpages.only_prefix(request, prefix)
return HttpResponse(string)
def entire_handle(request, prefix, suffix):
Supports Markdown
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