Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Merret Buurman
pidlandingpage
Commits
d8e9e549
Commit
d8e9e549
authored
Jun 06, 2016
by
Merret Buurman
Browse files
Normal landing page (non-CMIP) now uses template.
parent
d6d0ea16
Changes
3
Hide whitespace changes
Inline
Side-by-side
landingpage/landingpageapp/pages/default.py
View file @
d8e9e549
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
landingpage/landingpageapp/templates/landingpage/normal_dkrz.html
0 → 100644
View file @
d8e9e549
{% 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>
<div
class=
"section"
>
<p>
This is a simple landing page for any handle: {{handle}}.
</p>
</div>
{% endblock %}
\ No newline at end of file
landingpage/landingpageapp/views.py
View file @
d8e9e549
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment