Skip to content

Commit

Permalink
improve look of page
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyBarrette committed Feb 13, 2024
1 parent e81120a commit 6dbf230
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hakai_ckan_records_checks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def main(ckan_url, api_key, output, max_workers, log_level, cache):
standardized_issues['message'] = standardized_issues['message'].str.replace('resources\[[0-9]+\]','resources[...]',regex=True)

# Generate figures
pie_chart = px.pie(standardized_issues, names='message',title='Hakai Records Issues Distribution')
pie_chart = px.pie(standardized_issues, names='message',title=f'Hakai Records Issues Distribution: {len(standardized_issues)} issues detected')
pie_chart.update_traces(textposition='inside')
pie_chart.update_layout(uniformtext_minsize=12, uniformtext_mode='hide')
pie_chart_html = pie_chart.to_html(full_html=False)
Expand Down
2 changes: 1 addition & 1 deletion hakai_ckan_records_checks/hakai.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _test(condition, level, message):
f"Invalid resource format: resources[{index}].format={resource['format']}",
)
_test(
requests.get(resource["url"]).status_code == 200,
int(requests.get(resource["url"]).status_code) in (200, 201),
"ERROR",
f"Invalid resources[{index}].url.status_code={requests.get(resource['url']).status_code}",
)
Expand Down
9 changes: 5 additions & 4 deletions hakai_ckan_records_checks/templates/index.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ h3 {
</style>
<body>
<h1>Report Summary<br><a href="{{ckan_url}}">{{ckan_url}}</a></h1>
<p>This page present a summary of:
<br><a href="#records_summary">Records hosted on the catalogue</a>
<br><a href="#issues_summary">Issues detected in some records</a>
</p>
<p>This page present a summary of:</p>
<ul>
<li><a href="#records_summary">records hosted on the catalogue</a></li>
<li><a href="#issues_summary">issues detected in some records</a></li>
</ul>

<div id='map'></div>
<div id='pie-chart'>{{ issues_pie_chart }}</div>
Expand Down

0 comments on commit 6dbf230

Please sign in to comment.