diff --git a/nmhs_cms/urls.py b/nmhs_cms/urls.py index c59dcb69..acad153b 100644 --- a/nmhs_cms/urls.py +++ b/nmhs_cms/urls.py @@ -2,7 +2,7 @@ from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.contrib import admin -from django.urls import include, path +from django.urls import include, path, re_path from wagtail import urls as wagtail_urls from wagtail.admin import urls as wagtailadmin_urls from wagtail.documents import urls as wagtaildocs_urls @@ -23,10 +23,10 @@ path("cap/", include(cap_urls)), path("search/", search_views.search, name="search"), - path("", include("geomanager.urls")), + path("", include("geomanager.urls"), name="geomanager"), # path("", include("django_nextjs.urls")), path("", include("wagtailsurveyjs.urls")), - path("", include(forecastmanager_urls)), + re_path("", include(forecastmanager_urls), name="forecast_api"), ] diff --git a/pages/home/static/js/forecast_map.js b/pages/home/static/js/forecast_map.js index ded36a31..e93e5a03 100644 --- a/pages/home/static/js/forecast_map.js +++ b/pages/home/static/js/forecast_map.js @@ -88,7 +88,7 @@ $(document).ready(function () { function setForecastData(forecast_date) { // Make an HTTP GET request to the API endpoint - fetch(`/api/forecasts?forecast_date=${forecast_date}`) + fetch(`/cms/api/forecasts?forecast_date=${forecast_date}`) .then(response => response.json()) // Parse the response as JSON .then(data => { // Process the retrieved data @@ -103,7 +103,7 @@ $(document).ready(function () { } } - img.src = `${icon.properties.condition_icon}` + img.src = `/cms${icon.properties.condition_icon}` return img.src }) diff --git a/pages/home/templates/home_page.html b/pages/home/templates/home_page.html index 696834b3..641441a6 100644 --- a/pages/home/templates/home_page.html +++ b/pages/home/templates/home_page.html @@ -31,6 +31,8 @@ {% endif %} const temp_units = "{{settings.forecastmanager.ForecastSetting.get_temp_units_display}}" + + diff --git a/requirements.txt b/requirements.txt index 8ee0ab97..be44f95c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -65,7 +65,7 @@ filelock==3.12.0 filetype==1.2.0 Fiona==1.9.4.post1 fonttools==4.39.4 -forecastmanager==0.0.4 +forecastmanager @ https://github.com/wmo-raf/forecastmanager/archive/d44d63f86f050e0a77549d63add81a41b47762c7.zip frozenlist==1.3.3 future==0.18.3 geomanager==0.0.1