From 0b54f5cc1a5cfbd829dcbafb845a64f711db4c96 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 6 Oct 2023 16:34:56 +1100 Subject: [PATCH] Namespace podjango static files, use includes to reduce duplication, enable staticfiles app --- www/conservancy/settings.py | 7 ++++++- .../img/cast/audio_mp3_button.png | Bin .../img/cast/audio_ogg_button.png | Bin .../{ => podjango}/img/cast/faif_144x144.jpg | Bin .../{ => podjango}/img/cast/faif_200x200.jpg | Bin .../{ => podjango}/img/cast/faif_300x300.jpg | Bin .../{ => podjango}/img/cast/faif_300x300.xcf | Bin .../img/cast/halfbakedmedia-logo.png | Bin .../img/cast/halfbakedmedia-logo_100px.png | Bin .../{ => podjango}/img/cast/rss-audiomp3.png | Bin .../{ => podjango}/img/cast/rss-audioogg.png | Bin .../static/{ => podjango}/img/cast/rss-miro.png | Bin .../{ => podjango}/img/feed-icon-14x14.png | Bin .../static/{ => podjango}/license/index.html | 0 www/podjango/static/{ => podjango}/podjango.css | 0 .../podjango/audio_mp3_button.inc.html | 3 +++ .../podjango/audio_ogg_button.inc.html | 3 +++ .../podjango/cast/cast_archive_day.html | 8 +------- .../podjango/cast/cast_archive_month.html | 8 +------- .../podjango/cast/cast_archive_year.html | 8 +------- .../templates/podjango/cast/cast_detail.html | 16 +++------------- .../templates/podjango/cast/cast_list.html | 14 +++----------- .../templates/podjango/feed_links.inc.html | 8 ++++++++ www/podjango/templates/podjango/frontpage.html | 15 +++------------ 24 files changed, 32 insertions(+), 58 deletions(-) rename www/podjango/static/{ => podjango}/img/cast/audio_mp3_button.png (100%) rename www/podjango/static/{ => podjango}/img/cast/audio_ogg_button.png (100%) rename www/podjango/static/{ => podjango}/img/cast/faif_144x144.jpg (100%) rename www/podjango/static/{ => podjango}/img/cast/faif_200x200.jpg (100%) rename www/podjango/static/{ => podjango}/img/cast/faif_300x300.jpg (100%) rename www/podjango/static/{ => podjango}/img/cast/faif_300x300.xcf (100%) rename www/podjango/static/{ => podjango}/img/cast/halfbakedmedia-logo.png (100%) rename www/podjango/static/{ => podjango}/img/cast/halfbakedmedia-logo_100px.png (100%) rename www/podjango/static/{ => podjango}/img/cast/rss-audiomp3.png (100%) rename www/podjango/static/{ => podjango}/img/cast/rss-audioogg.png (100%) rename www/podjango/static/{ => podjango}/img/cast/rss-miro.png (100%) rename www/podjango/static/{ => podjango}/img/feed-icon-14x14.png (100%) rename www/podjango/static/{ => podjango}/license/index.html (100%) rename www/podjango/static/{ => podjango}/podjango.css (100%) create mode 100644 www/podjango/templates/podjango/audio_mp3_button.inc.html create mode 100644 www/podjango/templates/podjango/audio_ogg_button.inc.html create mode 100644 www/podjango/templates/podjango/feed_links.inc.html diff --git a/www/conservancy/settings.py b/www/conservancy/settings.py index 40a70b21..af8db969 100644 --- a/www/conservancy/settings.py +++ b/www/conservancy/settings.py @@ -84,7 +84,7 @@ INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.messages', 'django.contrib.humanize', - # 'django.contrib.staticfiles', + 'django.contrib.staticfiles', 'conservancy.apps.blog', 'conservancy.apps.contacts', 'conservancy.apps.contractpatch', @@ -125,6 +125,11 @@ TEMPLATES = [ } ] +STATIC_ROOT = BASE_DIR.parent / 'collected_static' +STATICFILES_DIRS = [ + BASE_DIR / 'conservancy' / 'static', +] + AUTHENTICATION_BACKENDS = ( # 'conservancy.auth.LDAPBackend', 'django.contrib.auth.backends.ModelBackend', diff --git a/www/podjango/static/img/cast/audio_mp3_button.png b/www/podjango/static/podjango/img/cast/audio_mp3_button.png similarity index 100% rename from www/podjango/static/img/cast/audio_mp3_button.png rename to www/podjango/static/podjango/img/cast/audio_mp3_button.png diff --git a/www/podjango/static/img/cast/audio_ogg_button.png b/www/podjango/static/podjango/img/cast/audio_ogg_button.png similarity index 100% rename from www/podjango/static/img/cast/audio_ogg_button.png rename to www/podjango/static/podjango/img/cast/audio_ogg_button.png diff --git a/www/podjango/static/img/cast/faif_144x144.jpg b/www/podjango/static/podjango/img/cast/faif_144x144.jpg similarity index 100% rename from www/podjango/static/img/cast/faif_144x144.jpg rename to www/podjango/static/podjango/img/cast/faif_144x144.jpg diff --git a/www/podjango/static/img/cast/faif_200x200.jpg b/www/podjango/static/podjango/img/cast/faif_200x200.jpg similarity index 100% rename from www/podjango/static/img/cast/faif_200x200.jpg rename to www/podjango/static/podjango/img/cast/faif_200x200.jpg diff --git a/www/podjango/static/img/cast/faif_300x300.jpg b/www/podjango/static/podjango/img/cast/faif_300x300.jpg similarity index 100% rename from www/podjango/static/img/cast/faif_300x300.jpg rename to www/podjango/static/podjango/img/cast/faif_300x300.jpg diff --git a/www/podjango/static/img/cast/faif_300x300.xcf b/www/podjango/static/podjango/img/cast/faif_300x300.xcf similarity index 100% rename from www/podjango/static/img/cast/faif_300x300.xcf rename to www/podjango/static/podjango/img/cast/faif_300x300.xcf diff --git a/www/podjango/static/img/cast/halfbakedmedia-logo.png b/www/podjango/static/podjango/img/cast/halfbakedmedia-logo.png similarity index 100% rename from www/podjango/static/img/cast/halfbakedmedia-logo.png rename to www/podjango/static/podjango/img/cast/halfbakedmedia-logo.png diff --git a/www/podjango/static/img/cast/halfbakedmedia-logo_100px.png b/www/podjango/static/podjango/img/cast/halfbakedmedia-logo_100px.png similarity index 100% rename from www/podjango/static/img/cast/halfbakedmedia-logo_100px.png rename to www/podjango/static/podjango/img/cast/halfbakedmedia-logo_100px.png diff --git a/www/podjango/static/img/cast/rss-audiomp3.png b/www/podjango/static/podjango/img/cast/rss-audiomp3.png similarity index 100% rename from www/podjango/static/img/cast/rss-audiomp3.png rename to www/podjango/static/podjango/img/cast/rss-audiomp3.png diff --git a/www/podjango/static/img/cast/rss-audioogg.png b/www/podjango/static/podjango/img/cast/rss-audioogg.png similarity index 100% rename from www/podjango/static/img/cast/rss-audioogg.png rename to www/podjango/static/podjango/img/cast/rss-audioogg.png diff --git a/www/podjango/static/img/cast/rss-miro.png b/www/podjango/static/podjango/img/cast/rss-miro.png similarity index 100% rename from www/podjango/static/img/cast/rss-miro.png rename to www/podjango/static/podjango/img/cast/rss-miro.png diff --git a/www/podjango/static/img/feed-icon-14x14.png b/www/podjango/static/podjango/img/feed-icon-14x14.png similarity index 100% rename from www/podjango/static/img/feed-icon-14x14.png rename to www/podjango/static/podjango/img/feed-icon-14x14.png diff --git a/www/podjango/static/license/index.html b/www/podjango/static/podjango/license/index.html similarity index 100% rename from www/podjango/static/license/index.html rename to www/podjango/static/podjango/license/index.html diff --git a/www/podjango/static/podjango.css b/www/podjango/static/podjango/podjango.css similarity index 100% rename from www/podjango/static/podjango.css rename to www/podjango/static/podjango/podjango.css diff --git a/www/podjango/templates/podjango/audio_mp3_button.inc.html b/www/podjango/templates/podjango/audio_mp3_button.inc.html new file mode 100644 index 00000000..77b07834 --- /dev/null +++ b/www/podjango/templates/podjango/audio_mp3_button.inc.html @@ -0,0 +1,3 @@ +{% load static %} + +[Get cast in MP3 format] diff --git a/www/podjango/templates/podjango/audio_ogg_button.inc.html b/www/podjango/templates/podjango/audio_ogg_button.inc.html new file mode 100644 index 00000000..f7b0f669 --- /dev/null +++ b/www/podjango/templates/podjango/audio_ogg_button.inc.html @@ -0,0 +1,3 @@ +{% load static %} + +[Get cast in Ogg/Vorbis format] diff --git a/www/podjango/templates/podjango/cast/cast_archive_day.html b/www/podjango/templates/podjango/cast/cast_archive_day.html index 39676e0d..f57ae6d6 100644 --- a/www/podjango/templates/podjango/cast/cast_archive_day.html +++ b/www/podjango/templates/podjango/cast/cast_archive_day.html @@ -9,13 +9,7 @@ {% block content %} -

[Ogg/Vorbis Audio RSS] -[MP3 Audio RSS] -Free as in Freedom

+

{% include 'podjango/feed_links.inc.html' %} Free as in Freedom

Free as in Freedom Archive: {{ day|date:"F j, Y" }}

diff --git a/www/podjango/templates/podjango/cast/cast_archive_month.html b/www/podjango/templates/podjango/cast/cast_archive_month.html index dd49e03f..fba8b9f0 100644 --- a/www/podjango/templates/podjango/cast/cast_archive_month.html +++ b/www/podjango/templates/podjango/cast/cast_archive_month.html @@ -9,13 +9,7 @@ {% block content %} -

[Ogg/Vorbis Audio RSS] -[MP3 Audio RSS] -Free as in Freedom

+

{% include 'podjango/feed_links.inc.html' %}Free as in Freedom

Free as in Freedom Archive: {{ month|date:"F, Y" }}

diff --git a/www/podjango/templates/podjango/cast/cast_archive_year.html b/www/podjango/templates/podjango/cast/cast_archive_year.html index 3e59fb3b..416f61dc 100644 --- a/www/podjango/templates/podjango/cast/cast_archive_year.html +++ b/www/podjango/templates/podjango/cast/cast_archive_year.html @@ -8,13 +8,7 @@ {% block content %} -

[Ogg/Vorbis Audio RSS] -[MP3 Audio RSS] -Free as in Freedom

+

{% include 'podjango/feed_links.inc.html' %} Free as in Freedom

Free as in Freedom Archive: {{ year }}

diff --git a/www/podjango/templates/podjango/cast/cast_detail.html b/www/podjango/templates/podjango/cast/cast_detail.html index 7a556739..b23de573 100644 --- a/www/podjango/templates/podjango/cast/cast_detail.html +++ b/www/podjango/templates/podjango/cast/cast_detail.html @@ -8,20 +8,10 @@ {% block content %} -

[Ogg/Vorbis Audio RSS] -[MP3 Audio RSS] -Free as in Freedom

- -

[Get cast in Ogg/Vorbis
-                                          format] -[Get cast in MP3 format] - +

{% include 'podjango/feed_links.inc.html' %} Free as in Freedom

+

{% include 'podjango/audio_ogg_button.inc.html' %} +{% include 'podjango/audio_mp3_button.inc.html' %} {{ object.title|safe }}

{{ object.pub_date|date:"j F Y" }}

diff --git a/www/podjango/templates/podjango/cast/cast_list.html b/www/podjango/templates/podjango/cast/cast_list.html index 2b6c4683..2071c50d 100644 --- a/www/podjango/templates/podjango/cast/cast_list.html +++ b/www/podjango/templates/podjango/cast/cast_list.html @@ -8,13 +8,7 @@ {% block content %} -

[Ogg/Vorbis Audio RSS] -[MP3 Audio RSS] -Free as in Freedom

+

{% include 'podjango/feed_links.inc.html' %} Free as in Freedom

{% if tags %}

Displaying casts @@ -26,10 +20,8 @@ tagged {% for tag in tags %}{% if not forloop.last %}{% if not forloop.first %},

{{ object.pub_date|date:"F j, Y" }}

-[Get cast in Ogg/Vorbis
-                                          format] -[Get cast in MP3 format] +{% include 'podjango/audio_ogg_button.inc.html' %} +{% include 'podjango/audio_mp3_button.inc.html' %} {{ object.title|safe }}

Summary

diff --git a/www/podjango/templates/podjango/feed_links.inc.html b/www/podjango/templates/podjango/feed_links.inc.html new file mode 100644 index 00000000..8219f387 --- /dev/null +++ b/www/podjango/templates/podjango/feed_links.inc.html @@ -0,0 +1,8 @@ +{% load static %} + + + [Ogg/Vorbis Audio RSS] + + + [MP3 Audio RSS] + diff --git a/www/podjango/templates/podjango/frontpage.html b/www/podjango/templates/podjango/frontpage.html index 9f45820a..cef6aca9 100644 --- a/www/podjango/templates/podjango/frontpage.html +++ b/www/podjango/templates/podjango/frontpage.html @@ -34,21 +34,12 @@ Bradley and Karen to discuss various topics regarding FLOSS.

and Karen both have blogs you can read.

-

-[Ogg/Vorbis Audio RSS] -[MP3 Audio
-       RSS]Recent Free as in Freedom Shows

+

{% include 'podjango/feed_links.inc.html' %}Recent Free as in Freedom Shows

{% for cc in cast %}