-
Notifications
You must be signed in to change notification settings - Fork 0
/
stream.py
89 lines (71 loc) · 3.06 KB
/
stream.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from django.template.loader import render_to_string
from django.http import HttpResponse
from collections import OrderedDict
from django.shortcuts import redirect
import os
from django.conf import settings
from . import links_left
from . import views
def stream_page(request, model='pisces', header='none'):
header = views.header
eco_url = "https://qedinternal.epa.gov/pisces/rest/ecoregion"
x = render_to_string('pisces_stream_map.html', {
'ECO_URL': eco_url
})
""" Returns the html of the references page for pisces. """
html = render_to_string('01pisces_epa_drupal_header.html', {})
html += render_to_string('02epa_drupal_header_bluestripe_onesidebar.html', {})
html += render_to_string('03pisces_drupal_section_title.html', {"TITLE": "Piscine Stream Community Estimation System"})
html += stream_ordered_list(model, 'streammap')
html += render_to_string('04pisces_stream_text_start_index_drupal.html', {
'TITLE': 'Stream Fish Assemblage Predictor',
'TEXT_PARAGRAPH': x})
html += render_to_string('04ubertext_end_drupal.html', {})
# html += stream_ordered_list(model, 'streammap')
html += render_to_string('10epa_drupal_footer.html', {})
# html = x
response = HttpResponse()
response.write(html)
return response
def stream_page_v2(request, model='pisces', header='none'):
header = views.header
eco_url = "https://qedinternal.epa.gov/pisces/rest/ecoregion"
imports = render_to_string('pisces_stream_map_v2_imports.html')
x = render_to_string('pisces_stream_map_v2.html', {
'ECO_URL': eco_url,
'IMPORTS': imports
})
""" Returns the html of the references page for pisces. """
html = render_to_string('01pisces_epa_drupal_header.html', {})
html += render_to_string('02epa_drupal_header_bluestripe_onesidebar.html', {})
html += render_to_string('03pisces_drupal_section_title.html', {"TITLE": "Piscine Stream Community Estimation System"})
html += stream_ordered_list(model, 'streammap')
html += render_to_string('04pisces_stream_text_start_index_drupal.html', {
'TITLE': 'Stream Fish Assemblage Predictor',
'TEXT_PARAGRAPH': x})
html += render_to_string('04ubertext_end_drupal.html', {})
# html += stream_ordered_list(model, 'streammap')
html += render_to_string('10epa_drupal_footer.html', {})
# html = x
response = HttpResponse()
response.write(html)
return response
def stream_ordered_list(model=None, page=None):
link_dict = OrderedDict([
('Model', OrderedDict([
('PiSCES', 'pisces'),
])
),
('Documentation', OrderedDict([
# ('API Documentation', '/qedinternal.epa.gov/pisces/rest'),
('Source Code', '/github.com/quanted/qed_pisces'),
('Algorithms', 'pisces/algorithms'),
('References', 'pisces/references')
])
)
])
return render_to_string('03pisces_stream_links_left_drupal.html', {
'LINK_DICT': link_dict,
'MODEL': model,
'PAGE': page
})