From 20198e67ff37565932bc9b036bb678e8243d46c5 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 24 Mar 2012 12:24:47 -0500
Subject: Begin removal of cdnprefix tag
This starts the removal of this code I wrote a while ago in favor of the
now core Django static files application and the helpful static template
tag.
Signed-off-by: Dan McGee
---
templates/base.html | 16 ++++++++--------
templates/public/donate.html | 14 +++++++-------
templates/public/download.html | 5 +++--
templates/public/index.html | 21 +++++++++++----------
4 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/templates/base.html b/templates/base.html
index 79c7cc92..b8a5be46 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,15 +1,15 @@
-{% load url from future %}
+{% load url from future %}{% load static from staticfiles %}
{% block title %}Arch Linux{% endblock %}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{% block head %}{% endblock %}
diff --git a/templates/public/donate.html b/templates/public/donate.html
index 76fd0aa1..3b3ee108 100644
--- a/templates/public/donate.html
+++ b/templates/public/donate.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% load cache %}
-{% load cdn %}
+{% load static from staticfiles %}
{% block title %}Arch Linux - Donate{% endblock %}
@@ -31,7 +31,7 @@ Monetary donations
as how donations work.
-
+
Commercial sponsors and contributions
@@ -41,7 +41,7 @@ Commercial sponsors and contributions
in a server rack, bandwidth, and electricity for our main server.
We also wish to extend a special Thank You to Commercial sponsors and contributions
head over to their website for more details.
@@ -60,15 +60,15 @@ Commercial sponsors and contributions
title="AirVM.com">AirVM.com for contributing a VMWare-based Virtual Machine.
Past donors
- {% for donor in donors %}
- - {{ donor.name }}
{% endfor %}
+{% for donor in donors %}
+- {{ donor.name }}
{% endfor %}
diff --git a/templates/public/download.html b/templates/public/download.html
index d244ec75..a3ff2a37 100644
--- a/templates/public/download.html
+++ b/templates/public/download.html
@@ -1,6 +1,7 @@
{% extends "base.html" %}
-{% load cache cdn %}
+{% load cache %}
{% load url from future %}
+{% load static from staticfiles %}
{% block title %}Arch Linux - Downloads{% endblock %}
{% block navbarclass %}anb-download{% endblock %}
@@ -125,7 +126,7 @@ Test ISO Info
title="Release Engineering ISO download">Download snapshots
Boot latest snapshots over the network
-
+
Feedback
diff --git a/templates/public/index.html b/templates/public/index.html
index 53ccd2d2..04c4795d 100644
--- a/templates/public/index.html
+++ b/templates/public/index.html
@@ -1,6 +1,7 @@
{% extends "base.html" %}
-{% load markup cache cdn %}
+{% load markup cache %}
{% load url from future %}
+{% load static from staticfiles %}
{% block head %}
@@ -42,7 +43,7 @@
+ class="rss-icon">
{% for news in news_updates %}
{% if forloop.counter0 < 5 %}
@@ -95,7 +96,7 @@ Recent Updates (more)
+ class="rss-icon">
{% for update in pkg_updates %}
@@ -156,7 +157,7 @@ Tools
title="Check the status of all known mirrors">Mirror Status
Differences Reports
-
+
Development
@@ -176,7 +177,7 @@ Development
title="Releng Testbuild Feedback">Releng Testbuild Feedback
Visualizations
-
+
More Resources
@@ -184,7 +185,7 @@ More Resources
- Signing Master Keys
-
+
- Press Coverage
- Logos & Artwork
@@ -199,20 +200,20 @@ More Resources
--
cgit v1.2.3-54-g00ecf
From 9d011312e850aa3dcab539cbf633191b2f3b7f54 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 24 Mar 2012 12:30:43 -0500
Subject: Convert art template to use Django static files
Done with:
sed -i \
-e 's@{% cdnprefix %}/media/\([^"]*\)"@{% static "\1" %}"@g' \
templates/public/art.html
Signed-off-by: Dan McGee
---
templates/public/art.html | 78 +++++++++++++++++++++++------------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/templates/public/art.html b/templates/public/art.html
index 1556b774..96312971 100644
--- a/templates/public/art.html
+++ b/templates/public/art.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load cdn %}
+{% load static from staticfiles %}
{% block title %}Arch Linux - Artwork{% endblock %}
@@ -16,42 +16,42 @@ Logos for Press Usage
Two-color standard version
Also available in print-quality
- PNG and scalable
- SVG formats.
-
Two-color inverted version (for dark backgrounds)
Also available in print-quality
- PNG and scalable
- SVG formats.
-
One-color standard version
Also available in print-quality
- PNG and scalable
- SVG formats.
-
One-colour inverted version (for dark backgrounds)
Also available in print-quality
- PNG and scalable
- SVG formats.
-
Logos and Artwork for the Community
@@ -81,50 +81,50 @@ Former Logos
Original Ribbon Series
"Arch Blue" Series
"Arch Aqua" Series
Release-specific Series
--
cgit v1.2.3-54-g00ecf
From 024fd1b2843d2abd0094faedfbc49e1d1a21edd0 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 24 Mar 2012 12:32:38 -0500
Subject: Remove cdnprefix template tag
Signed-off-by: Dan McGee
---
local_settings.py.example | 2 --
main/templatetags/cdn.py | 12 ------------
2 files changed, 14 deletions(-)
diff --git a/local_settings.py.example b/local_settings.py.example
index 30a67d51..37ac29a6 100644
--- a/local_settings.py.example
+++ b/local_settings.py.example
@@ -53,7 +53,5 @@ SECRET_KEY = '00000000000000000000000000000000000000000000000'
## CDN settings
CDN_ENABLED = False
-# Scheme-relative URL, should work for both http/https
-CDN_PATH = '//example.com/path/'
# vim: set ts=4 sw=4 et:
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index b91553ed..f290a524 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -15,16 +15,4 @@ def jquery():
link = '%sjquery-%s.min.js' % (static_url, version)
return '' % link
-@register.tag
-def cdnprefix(parser, token):
- return CDNPrefixNode()
-
-class CDNPrefixNode(template.Node):
- def render(self, context):
- oncdn = getattr(settings, 'CDN_ENABLED', True)
- if not oncdn:
- return ''
- # if left undefined, same behavior as if CDN is turned off
- return getattr(settings, 'CDN_PATH', '')
-
# vim: set ts=4 sw=4 et:
--
cgit v1.2.3-54-g00ecf