-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f5f91c
commit cd63baa
Showing
34 changed files
with
1,935 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
cms/dashboard/management/commands/build_cms_site_helpers/landing_page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
from cms.composite.models import CompositePage | ||
from cms.topic.models import TopicPage | ||
|
||
|
||
def create_landing_page_body_wih_page_links() -> list[dict]: | ||
covid_page = TopicPage.objects.get(slug="covid-19") | ||
influenza_page = TopicPage.objects.get(slug="influenza") | ||
other_respiratory_viruses_page = TopicPage.objects.get( | ||
slug="other-respiratory-viruses" | ||
) | ||
weather_health_alerts_page = CompositePage.objects.get(slug="weather-health-alerts") | ||
|
||
return [ | ||
{ | ||
"type": "section", | ||
"value": { | ||
"heading": "Respiratory viruses", | ||
"page_link": None, | ||
"content": [ | ||
{ | ||
"type": "chart_row_card", | ||
"value": { | ||
"columns": [ | ||
{ | ||
"type": "simplified_chart_with_link", | ||
"value": { | ||
"title": "COVID-19", | ||
"sub_title": "Cases reported", | ||
"tag_manager_event_id": "", | ||
"topic_page": covid_page.id, | ||
"x_axis": "date", | ||
"y_axis": "metric", | ||
"chart": [ | ||
{ | ||
"type": "plot", | ||
"value": { | ||
"topic": "COVID-19", | ||
"metric": "COVID-19_cases_countRollingMean", | ||
"geography": "England", | ||
"geography_type": "Nation", | ||
"sex": "all", | ||
"age": "all", | ||
"stratum": "default", | ||
"chart_type": "line_single_simplified", | ||
}, | ||
"id": "0cb2a953-8737-4978-9886-d3943b76820a", | ||
} | ||
], | ||
}, | ||
"id": "8b2ca8aa-7bdb-4c47-835c-dc1c09f767cf", | ||
}, | ||
{ | ||
"type": "simplified_chart_with_link", | ||
"value": { | ||
"title": "Influenza", | ||
"sub_title": "Healthcare admission rates", | ||
"tag_manager_event_id": "", | ||
"topic_page": influenza_page.id, | ||
"x_axis": "date", | ||
"y_axis": "metric", | ||
"chart": [ | ||
{ | ||
"type": "plot", | ||
"value": { | ||
"topic": "Influenza", | ||
"metric": "influenza_healthcare_ICUHDUadmissionRateByWeek", | ||
"geography": "England", | ||
"geography_type": "Nation", | ||
"sex": "all", | ||
"age": "all", | ||
"stratum": "default", | ||
"chart_type": "line_single_simplified", | ||
}, | ||
"id": "7423460c-aa0c-482d-8fd5-ab9c62396657", | ||
} | ||
], | ||
}, | ||
"id": "b7b37be5-8bc0-4f88-8310-7a91430b7993", | ||
}, | ||
{ | ||
"type": "simplified_chart_with_link", | ||
"value": { | ||
"title": "RSV", | ||
"sub_title": "Healthcare admission rates", | ||
"tag_manager_event_id": "", | ||
"topic_page": other_respiratory_viruses_page.id, | ||
"x_axis": "date", | ||
"y_axis": "metric", | ||
"chart": [ | ||
{ | ||
"type": "plot", | ||
"value": { | ||
"topic": "RSV", | ||
"metric": "RSV_healthcare_admissionRateByWeek", | ||
"geography": "England", | ||
"geography_type": "Nation", | ||
"sex": "all", | ||
"age": "all", | ||
"stratum": "default", | ||
"chart_type": "line_single_simplified", | ||
}, | ||
"id": "f9eb94ff-0d92-4265-a88b-d52bf73532a5", | ||
} | ||
], | ||
}, | ||
"id": "0a830ab5-b232-47f1-a5af-f140e0f07c23", | ||
}, | ||
] | ||
}, | ||
"id": "40d17855-71e3-424e-a662-2f6930073e59", | ||
} | ||
], | ||
}, | ||
"id": "c3ec156e-e58b-4976-b0f2-c08c1e933467", | ||
}, | ||
{ | ||
"type": "section", | ||
"value": { | ||
"heading": "Weather health alerts", | ||
"page_link": weather_health_alerts_page.id, | ||
"content": [ | ||
{ | ||
"type": "weather_health_alert_card", | ||
"value": { | ||
"title": "weather health alerts", | ||
"sub_title": "Across England", | ||
"alert_type": "heat", | ||
}, | ||
"id": "d01c65cb-4cd2-4e07-bd6e-71ea0ec04594", | ||
} | ||
], | ||
}, | ||
"id": "be533e25-ba91-4e86-8a45-1314ed395fb9", | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
cms/dashboard/templates/cms_starting_pages/landing_page.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"id": 79, | ||
"meta": { | ||
"search_description": "", | ||
"type": "landing_page.LandingPage", | ||
"detail_url": "https://http:/api/pages/79/", | ||
"html_url": "https://http://localhost:3000/landing-page/", | ||
"slug": "landing-page", | ||
"show_in_menus": false, | ||
"seo_title": "Home | UKHSA data dashboard", | ||
"first_published_at": "2024-09-20T13:06:42.106160+01:00", | ||
"alias_of": null, | ||
"parent": { | ||
"id": 3, | ||
"meta": { | ||
"type": "home.UKHSARootPage", | ||
"detail_url": "https://http:/api/pages/3/", | ||
"html_url": null | ||
}, | ||
"title": "UKHSA Dashboard Root" | ||
} | ||
}, | ||
"title": "Landing page", | ||
"sub_title": "showing public health data across England", | ||
"body": "", | ||
"last_published_at": "2024-09-20T14:04:30.332316+01:00", | ||
"last_updated_at": "2024-09-24T16:40:55.228390+01:00", | ||
"seo_change_frequency": 5, | ||
"seo_priority": "0.5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class LandingPageConfig(AppConfig): | ||
default_auto_fields = "django.db.models.BigAutoField" | ||
name = "cms.landing_page" |
Oops, something went wrong.