Namespace podjango static files, use includes to reduce duplication, enable staticfiles app

This commit is contained in:
Ben Sturmfels 2023-10-06 16:34:56 +11:00
parent 382714e54f
commit 0b54f5cc1a
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
24 changed files with 32 additions and 58 deletions

View file

@ -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',

View file

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

View file

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 574 B

View file

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

View file

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View file

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 689 B

View file

@ -0,0 +1,3 @@
{% load static %}
<img alt="[Get cast in MP3 format]" src="{% static 'podjango/img/cast/audio_mp3_button.png' %}"/>

View file

@ -0,0 +1,3 @@
{% load static %}
<img alt="[Get cast in Ogg/Vorbis format]" src="{% static 'podjango/img/cast/audio_ogg_button.png' %}"/>

View file

@ -9,13 +9,7 @@
{% block content %}
<h1><a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio RSS]"/></a>
Free as in Freedom</h1>
<h1>{% include 'podjango/feed_links.inc.html' %} Free as in Freedom</h1>
<h2>Free as in Freedom Archive: {{ day|date:"F j, Y" }}</h2>

View file

@ -9,13 +9,7 @@
{% block content %}
<h1><a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio RSS]"/></a>
Free as in Freedom</h1>
<h1>{% include 'podjango/feed_links.inc.html' %}Free as in Freedom</h1>
<h2>Free as in Freedom Archive: {{ month|date:"F, Y" }}</h2>

View file

@ -8,13 +8,7 @@
{% block content %}
<h1><a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio RSS]"/></a>
Free as in Freedom</h1>
<h1>{% include 'podjango/feed_links.inc.html' %} Free as in Freedom</h1>
<h2>Free as in Freedom Archive: {{ year }}</h2>

View file

@ -8,20 +8,10 @@
{% block content %}
<h1><a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio RSS]"/></a>
Free as in Freedom</h1>
<h2><a class="feedlink" href="{{ object.ogg_path }}"><img alt="[Get cast in Ogg/Vorbis
format]" src="/img/cast/audio_ogg_button.png"/></a>
<a class="feedlink" href="{{ object.mp3_path }}"><img alt="[Get cast in MP3 format]"
src="/img/cast/audio_mp3_button.png"/></a>
<h1>{% include 'podjango/feed_links.inc.html' %} Free as in Freedom</h1>
<h2><a class="feedlink" href="{{ object.ogg_path }}">{% include 'podjango/audio_ogg_button.inc.html' %}</a>
<a class="feedlink" href="{{ object.mp3_path }}">{% include 'podjango/audio_mp3_button.inc.html' %}</a>
{{ object.title|safe }}</h2>
<p class="date">{{ object.pub_date|date:"j F Y" }}</p>

View file

@ -8,13 +8,7 @@
{% block content %}
<h1><a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio RSS]"/></a>
Free as in Freedom</h1>
<h1>{% include 'podjango/feed_links.inc.html' %} Free as in Freedom</h1>
{% if tags %}
<p>Displaying casts
@ -26,10 +20,8 @@ tagged {% for tag in tags %}{% if not forloop.last %}{% if not forloop.first %},
<div class="shaded">
<p class="date">{{ object.pub_date|date:"F j, Y" }}</p>
<h3>
<a class="feedlink" href="{{ object.ogg_path }}"><img alt="[Get cast in Ogg/Vorbis
format]" src="/img/cast/audio_ogg_button.png"/></a>
<a class="feedlink" href="{{ object.mp3_path }}"><img alt="[Get cast in MP3 format]"
src="/img/cast/audio_mp3_button.png"/></a>
<a class="feedlink" href="{{ object.ogg_path }}">{% include 'podjango/audio_ogg_button.inc.html' %}</a>
<a class="feedlink" href="{{ object.mp3_path }}">{% include 'podjango/audio_mp3_button.inc.html' %}</a>
<a href="{{ object.get_absolute_url }}">{{ object.title|safe }}</a></h3>
<h4>Summary</h4>

View file

@ -0,0 +1,8 @@
{% load static %}
<a href="{% url 'podjango:feed-ogg' %}" class="feedlink">
<img src="{% static 'podjango/img/cast/rss-audioogg.png' %}" alt="[Ogg/Vorbis Audio RSS]"/>
</a>
<a href="{% url 'podjango:feed-mp3' %}" class="feedlink">
<img src="{% static 'podjango/img/cast/rss-audiomp3.png' %}" alt="[MP3 Audio RSS]"/>
</a>

View file

@ -34,21 +34,12 @@ Bradley and Karen to discuss various topics regarding FLOSS.</p>
and <a href="http://gnomg.org">Karen</a> both have blogs you can
read.</p>
<h2>
<a href="{% url 'podjango:feed-ogg' %}"
class="feedlink"><img src="/img/cast/rss-audioogg.png"
alt="[Ogg/Vorbis Audio RSS]"/></a>
<a href="{% url 'podjango:feed-mp3' %}"
class="feedlink"><img src="/img/cast/rss-audiomp3.png"
alt="[MP3 Audio
RSS]"/></a><a href="{% url 'podjango:cast' %}">Recent Free as in Freedom Shows</a></h2>
<h2>{% include 'podjango/feed_links.inc.html' %}<a href="{% url 'podjango:cast' %}">Recent Free as in Freedom Shows</a></h2>
{% for cc in cast %}
<div class="shaded">
<a class="feedlink" href="{{ cc.ogg_path }}"><img alt="[Get cast in Ogg/Vorbis
format]" src="/img/cast/audio_ogg_button.png"/></a>
<a class="feedlink" href="{{ cc.mp3_path }}"><img alt="[Get cast in MP3 format]"
src="/img/cast/audio_mp3_button.png"/></a>
<a class="feedlink" href="{{ cc.ogg_path }}">{% include 'podjango/audio_ogg_button.inc.html' %}</a>
<a class="feedlink" href="{{ cc.mp3_path }}">{% include 'podjango/audio_mp3_button.inc.html' %}</a>
<p class="date">{{ cc.pub_date|date:"F j, Y" }}</p>
<h3><a href="{{ cc.get_absolute_url }}">{{ cc.title|safe }}</a></h3>
{{ cc.summary|safe }}