From 4026867cd3d141c2a83ddcb7058ada56a1cf3487 Mon Sep 17 00:00:00 2001 From: Bee Webb Date: Tue, 12 Nov 2024 14:17:18 +0000 Subject: [PATCH] wip generated url, and update static url --- dashboard/templates/_partials/boxes.html | 4 ++-- dashboard/ui/urls.py | 4 +++- dashboard/ui/views.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dashboard/templates/_partials/boxes.html b/dashboard/templates/_partials/boxes.html index 0bb96929c..7132de6ed 100644 --- a/dashboard/templates/_partials/boxes.html +++ b/dashboard/templates/_partials/boxes.html @@ -20,9 +20,9 @@

{% if description %}

{{ description|safe }}

{% endif %} - + {% if legend %} - + {% endif %} diff --git a/dashboard/ui/urls.py b/dashboard/ui/urls.py index 49ee97954..c407748ad 100644 --- a/dashboard/ui/urls.py +++ b/dashboard/ui/urls.py @@ -15,6 +15,7 @@ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ +from django.conf.urls.static import static from django.contrib import admin from django.urls import path, re_path from django.views.generic.base import RedirectView @@ -178,4 +179,5 @@ ), re_path(r"element\/\S*.html", RedirectView.as_view(pattern_name="dash-exploringdata-elements", permanent=True)), re_path(r"org_type\/\S*.html", RedirectView.as_view(pattern_name="dash-exploringdata-orgids", permanent=True)), -] +] + static("generated", document_root="../out") +# ^ Serve generated files when using runserver for development diff --git a/dashboard/ui/views.py b/dashboard/ui/views.py index 37f69d8c2..aa09f0544 100644 --- a/dashboard/ui/views.py +++ b/dashboard/ui/views.py @@ -173,7 +173,8 @@ def _make_context(page_name: str): slugs=slugs, datetime_data=date_time_data_obj.strftime("%-d %B %Y (at %H:%M %Z)"), current_year=datetime.datetime.now(datetime.UTC).year, - stats_url="https://stats.codeforiati.org", + stats_url="/stats", + generated_url="/generated", stats_gh_url=STATS_GH_URL, commit_hash=COMMIT_HASH, stats_commit_hash=STATS_COMMIT_HASH,