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