Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Merret Buurman
pidlandingpage
Commits
4fd140dc
Commit
4fd140dc
authored
Jun 06, 2016
by
Merret Buurman
Browse files
CMIP6 dataset: Errata now shown.
parent
d8e9e549
Changes
3
Hide whitespace changes
Inline
Side-by-side
landingpage/landingpageapp/handle/cmip6parser.py
View file @
4fd140dc
...
...
@@ -75,6 +75,12 @@ def get_list_of_parts_handles_from_record(record):
def
get_list_of_parts_records_from_record
(
record
):
return
_get_list_of_parts_records_from_record
(
record
)
def
get_errata_list_from_record
(
record
):
return
_get_errata_list_from_record
(
record
)
def
get_errata_field_from_record
(
record
):
return
_get_errata_field_from_record
(
record
)
# Actual implementation and helpers
def
_get_aggregation_level
(
record
):
...
...
@@ -102,6 +108,9 @@ def _get_aggregation_field_from_record(record):
field_string
=
get_value_from_record
(
record
,
'PARENT'
)
# TODO Remove once migration is done!
return
field_string
def
_get_errata_field_from_record
(
record
):
return
get_value_from_record
(
record
,
'ERRATA'
)
def
_get_filename_from_record
(
record
):
return
get_value_from_record
(
record
,
'FILENAME'
)
...
...
@@ -152,6 +161,10 @@ def _parse_urls_original_from_record(field_string):
parsed
=
_remove_duplicate_urls
(
parsed
)
return
parsed
def
_get_errata_list_from_record
(
record
):
field_string
=
get_errata_field_from_record
(
record
)
return
field_string
.
split
(
';'
)
def
_parse_urls_replicas_from_record
(
field_string
):
parsed
=
_extract_url_info_from_field
(
field_string
,
'href'
,
'host'
)
if
parsed
is
not
None
:
...
...
landingpage/landingpageapp/pages/cmip6/datasetlevel.py
View file @
4fd140dc
...
...
@@ -61,4 +61,9 @@ def _get_context(json_record):
context
[
'list_of_parts_records'
]
=
val2
context
[
'any_part_replaced'
]
=
val3
# Errata
val
=
parser
.
get_errata_list_from_record
(
json_record
)
if
val
is
not
None
:
context
[
'errata'
]
=
val
return
context
landingpage/landingpageapp/templates/landingpage/cmip6_dataset.html
View file @
4fd140dc
...
...
@@ -111,6 +111,20 @@
</table>
</div>
{% if errata %}
<div
class=
"section"
>
<h2>
Errata
</h2>
<table>
{% for item in errata %}
<tr>
<td
>
{{item}}
</td>
<td></td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
<div
class=
"section"
>
...
...
Write
Preview
Supports
Markdown
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