Skip to content

Commit

Permalink
wip generated url, and update static url
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Nov 11, 2024
1 parent 312e5b2 commit f7cb43d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dashboard/templates/_partials/boxes.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ <h3 class="panel-title">
{% if description %}
<p>{{ description|safe }}</p>
{% endif %}
<img src="{{ static(image) }}" width="100%" />
<img src="{{ generated_url }}/{{ image }}" width="100%" />
{% if legend %}
<img src="{{ static(legend) }}" width="100%" />
<img src="{{ generated_url }}/{{ legend }}" width="100%" />
{% endif %}
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion dashboard/ui/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)),
]
# Serve generated files when using runserver for development
] + static("generated", document_root="../out")
3 changes: 2 additions & 1 deletion dashboard/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f7cb43d

Please sign in to comment.