Replace deprecated django.contrib adminmedia with staticfiles.
authorDiane Trout <diane@ghic.org>
Tue, 18 Jun 2013 00:06:13 +0000 (17:06 -0700)
committerDiane Trout <diane@ghic.org>
Tue, 18 Jun 2013 00:06:13 +0000 (17:06 -0700)
Also update url template tag for django 1.5 syntax.

htsworkflow/frontend/templates/admin/index.html
htsworkflow/frontend/templates/base.html
htsworkflow/frontend/templates/inventory/inventory_summary.html
htsworkflow/frontend/templates/registration/login.html
htsworkflow/frontend/templates/search_form.html
htsworkflow/settings.py

index 4a5677d2da199df85f36ca47f552bc3b9889d2fa..66b6942d42cc7c17b533f28de154fab0b380fcb5 100644 (file)
@@ -1,7 +1,7 @@
 {% extends "admin/base_site.html" %}
 {% load i18n %}
 
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load staticfiles %}{% static "css/dashboard.css" %}"/>{% endblock %}
 
 {% block coltype %}colMS{% endblock %}
 
index f8899df9e453177629b945e9ff598ecd8edfa5ab..336568945ac8cc60e43807b6f3b0ad663ba82ad4 100644 (file)
@@ -17,8 +17,8 @@
     <title>{% block title %}{{ app_name }} - {{ page_name }}{% endblock %}</title>
 
 {% block additional_css %}
-    {% load adminmedia %}
-    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
+    {% load staticfiles %}
+    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "css/rtl.css" %}{% endblock %}" />{% endif %}
     {% block extrastyle %}{% endblock %}
     {% block extrahead %}{% endblock %}
     {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
@@ -39,7 +39,7 @@
         {% trans 'Welcome,' %}
         <strong>{% firstof user.first_name user.username %}</strong>.
         {% block userlinks %}
-            {% url django-admindocs-docroot as docsroot %}
+            {% url "django.admindocs.docroot" as docsroot %}
             {% if docsroot %}
                 <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
             {% endif %}
index 4c56f0916e4fc9494d983f1f30d872e4fe9003ad..1a4797c7484a382b33865a907608f8dd583f11c2 100644 (file)
@@ -3,7 +3,7 @@
 {% block content %}
 {% if item %}
         <h2>Item Summary:</h2>
-        <a href="{% url htsworkflow.frontend.inventory.views.index %}{{item.uuid}}/print/">Print</a><br />
+        <a href="{% url "htsworkflow.frontend.inventory.views.index" %}{{item.uuid}}/print/">Print</a><br />
         <br />
         <b>UUID:</b> <span property="invns:uuid">{{item.uuid}}</span><br />
         <b>Barcode ID:</b> <span property="invns:barcode">{{ item.barcode_id }}</span><br />
index 2bf2456699edde4f050cae8a4793015be900e55d..d3d108b97ac9200f0535312a8864f90c4acb871d 100644 (file)
@@ -1,9 +1,9 @@
 {% extends "base_site.html" %}
 {% load i18n %}
 
-{% block additional_css %}{% load adminmedia %}{{ block.super }}
-<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/base.css" />
-<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/login.css" />
+{% block additional_css %}{% load staticfiles %}{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% static "css/base.css" %}"/>
+<link rel="stylesheet" type="text/css" href="{% static "css/login.css" %}"/>
 {% endblock %}
 
 {% block title %}Login{% endblock %}
index 97ef8f18b7a67d388971bc854bc5e9915c88ee9c..3c66304ac332df3f3717a9f07ab7619381794590 100644 (file)
@@ -1,9 +1,9 @@
-{% load adminmedia %}
+{% load staticfiles %}
 {% load i18n %}
 {% if cl.search_fields %}
 <div id="toolbar"><form id="changelist-search" action="" method="get">
 <div><!-- DIV needed for valid HTML -->
-<label for="searchbar"><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search" /></label>
+<label for="searchbar"><img src="{% static "img/admin/icon_searchbox.png" %}" alt="Search" /></label>
 <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
 <input type="submit" value="{% trans 'Go' %}" />
 {% if show_result_count %}
index 36f2f5168920c6db7aefd0cc6e77a6ec07f8fff1..a0652c2dbdf9611131385e0c389778782efff41d 100644 (file)
@@ -179,10 +179,9 @@ MEDIA_ROOT = os.path.join(HTSWORKFLOW_ROOT, 'frontend', 'static', '')
 # Example: "http://media.lawrence.com"
 MEDIA_URL = '/static/'
 
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# URL prefix for static media -- CSS, JavaScript and images. Make sure to use a
 # trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
+STATIC_URL = '/media/'
 
 # Make this unique, and don't share it with anybody.
 if not options.has_option('frontend', 'secret'):
@@ -227,6 +226,7 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
+    'django.contrib.staticfiles',
     'django.contrib.humanize',
     'django.contrib.sessions',
     'django.contrib.sites',