[damned-lies] Migrate to staticfiles



commit a8b4cf08537a31bedb78fb9a086e94dcdde55888
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Oct 1 11:07:46 2012 +0200

    Migrate to staticfiles
    
    See https://docs.djangoproject.com/en/dev/howto/static-files/

 .gitignore                                        |    1 +
 README                                            |   16 +-
 media/css/difflib.css                             |   18 -
 media/css/fonts.css                               |    9 -
 media/css/login.css                               |    8 -
 media/css/overlays.css                            |   57 -
 media/css/reset.css                               |    1 -
 media/css/rtl.css                                 |   85 --
 media/css/template.css                            |  957 ------------
 media/css/text.css                                |  108 --
 media/img/asc.gif                                 |  Bin 54 -> 0 bytes
 media/img/bg.gif                                  |  Bin 64 -> 0 bytes
 media/img/bug.png                                 |  Bin 844 -> 0 bytes
 media/img/close.png                               |  Bin 1996 -> 0 bytes
 media/img/closed.png                              |  Bin 276 -> 0 bytes
 media/img/desc.gif                                |  Bin 54 -> 0 bytes
 media/img/download-icon.png                       |  Bin 426 -> 0 bytes
 media/img/download.png                            |  Bin 426 -> 0 bytes
 media/img/edit.png                                |  Bin 1215 -> 0 bytes
 media/img/edit_small.png                          |  Bin 855 -> 0 bytes
 media/img/emptyimg.png                            |  Bin 6978 -> 0 bytes
 media/img/favicon.png                             |  Bin 895 -> 0 bytes
 media/img/feed-icon-10x10.png                     |  Bin 469 -> 0 bytes
 media/img/figure.png                              |  Bin 540 -> 0 bytes
 media/img/foot-16.png                             |  Bin 650 -> 0 bytes
 media/img/foot.png                                |  Bin 4414 -> 0 bytes
 media/img/footer_arts/l10n.png                    |  Bin 6668 -> 0 bytes
 media/img/grass.png                               |  Bin 10178 -> 0 bytes
 media/img/help.png                                |  Bin 435 -> 0 bytes
 media/img/hr-shadow.png                           |  Bin 1189 -> 0 bytes
 media/img/html-bg.png                             |  Bin 312 -> 0 bytes
 media/img/mallard.png                             |  Bin 652 -> 0 bytes
 media/img/nobody-16.png                           |  Bin 301 -> 0 bytes
 media/img/nobody.png                              |  Bin 1230 -> 0 bytes
 media/img/open.png                                |  Bin 270 -> 0 bytes
 media/img/repository-icon.png                     |  Bin 404 -> 0 bytes
 media/img/search.png                              |  Bin 482 -> 0 bytes
 media/img/top_bar-bg.png                          |  Bin 185 -> 0 bytes
 media/img/top_bar-item-bg.png                     |  Bin 190 -> 0 bytes
 media/img/warn.png                                |  Bin 383 -> 0 bytes
 media/img/workflow-translation.png                |  Bin 167230 -> 0 bytes
 media/js/README                                   |    5 -
 media/js/jquery.growfield2.js                     |    9 -
 media/js/jquery.min.js                            |   18 -
 media/js/jquery.tablesorter.min.js                |    4 -
 media/js/jquery.tools.js                          | 1672 ---------------------
 media/js/jquery.tools.min.js                      |   11 -
 media/js/main.js                                  |   30 -
 media/js/overlayhelpers.js                        |  595 --------
 media/robots.txt                                  |    2 -
 settings.py                                       |   13 +-
 templates/base.html                               |   20 +-
 templates/help/vertimus_workflow.html             |    2 +-
 templates/languages/language_all_modules.html     |    2 +-
 templates/languages/language_list.html            |    2 +-
 templates/languages/language_release.html         |    2 +-
 templates/languages/language_release_stats.html   |    2 +-
 templates/languages/language_release_summary.html |    2 +-
 templates/login.html                              |    2 +-
 templates/module_detail.html                      |   16 +-
 templates/module_images.html                      |    2 +-
 templates/people/person_detail.html               |    2 +-
 templates/people/person_list.html                 |    2 +-
 templates/people/person_overview.html             |    2 +-
 templates/registration/register.html              |    2 +-
 templates/release_compare.html                    |    2 +-
 templates/release_detail.html                     |    2 +-
 templates/stats_show.html                         |   10 +-
 templates/teams/team_base.html                    |    2 +-
 templates/teams/team_detail.html                  |    6 +-
 templates/teams/team_edit.html                    |    2 +-
 templates/vertimus/activity_summary.html          |    2 +-
 templates/vertimus/vertimus_detail.html           |   18 +-
 templates/vertimus/vertimus_diff.html             |    2 +-
 urls.py                                           |    4 -
 75 files changed, 71 insertions(+), 3658 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index eb3cf81..54384c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 *.pyc
 locale
 local_settings.py
+static
diff --git a/README b/README
index 58580bf..84cd341 100644
--- a/README
+++ b/README
@@ -8,7 +8,7 @@ You can find the Data model in the /docs directory.
 Requirements
 ============
 
-1 - Django 1.3.X
+1 - Django 1.4.X
 
 2 - Python 2.5 (minimal)
     PIL (python-imaging) for hackergotchi checks.
@@ -58,13 +58,21 @@ Installation
 3 - Run the following command to execute the migrations:
     ./manage.py migrate
 
-4 - (optional) If you want to populate the database with sample data, run:
+4 - In production, you will have to run the following command:
+    ./manage.py collectstatic
+
+    Then configure your Web server to statically serve this directory. For
+    example, with Apache, a simple alias directive is enough:
+
+    Alias /static /absolute/path/to/djamnedlies/static
+
+5 - (optional) If you want to populate the database with sample data, run:
     ./manage.py loaddata sample_data
 
-5 - You should now be able to launch the server to check if all is running well:
+6 - You should now be able to launch the server to check if all is running well:
     ./manage.py runserver
 
-6 - Configure Sites in admin interface ('View on site' link, site address in
+7 - Configure Sites in admin interface ('View on site' link, site address in
     sent mail).
 
 Maintenance tasks
diff --git a/settings.py b/settings.py
index 435c501..90d6dff 100644
--- a/settings.py
+++ b/settings.py
@@ -65,14 +65,16 @@ LOCALE_PATHS = (
 )
 
 # Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
 MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
 
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com";, "http://example.com/media/";
 MEDIA_URL = '/media/'
 
+STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
+
+STATIC_URL = '/static/'
+
 # Local directory path for VCS checkout
 SCRATCHDIR = ""
 POTDIR = os.path.join(SCRATCHDIR, "POT")
@@ -86,12 +88,6 @@ UPLOAD_DIR = 'upload'
 UPLOAD_ARCHIVED_DIR = 'upload-archived'
 FILE_UPLOAD_PERMISSIONS = 0600
 
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/";, "/media/".
-ADMIN_MEDIA_PREFIX = '/media/admin/'
-
 LOGIN_URL = '/login/'
 
 # Make this unique, and don't share it with anybody.
@@ -140,6 +136,7 @@ INSTALLED_APPS = (
     'django.contrib.humanize',
     'django.contrib.markup',
     'django.contrib.messages',
+    'django.contrib.staticfiles',
     'south',
     'common',
     'languages',
diff --git a/templates/base.html b/templates/base.html
index c90554d..2ad3bf8 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -6,16 +6,16 @@
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <title>{% block title %}page title{% endblock %}</title>
-  <link rel="icon" type="image/png" href="/media/img/foot-16.png">
-  <link rel="stylesheet" type="text/css" href="/media/css/template.css">
-  <link rel="stylesheet" href="/media/css/overlays.css">
+  <link rel="icon" type="image/png" href="{{ STATIC_URL }}img/foot-16.png">
+  <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/template.css">
+  <link rel="stylesheet" href="{{ STATIC_URL }}css/overlays.css">
 {% if LANGUAGE_BIDI %}
-  <link rel="stylesheet" href="/media/css/rtl.css">
+  <link rel="stylesheet" href="{{ STATIC_URL }}css/rtl.css">
 {% endif %}
-  <script type="text/javascript" src="/media/js/main.js"></script>
-  <script type="text/javascript" src="/media/js/jquery.min.js"></script>
-  <script type="text/javascript" src="/media/js/jquery.tools.min.js"></script>
-  <script type="text/javascript" src="/media/js/overlayhelpers.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}js/main.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tools.min.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}js/overlayhelpers.js"></script>
 
   <script type="text/javascript">
     $(document).ready(function () {
@@ -38,7 +38,7 @@
                 <a class="root" href="http://www.gnome.org/";>GNOME.org</a>
                 {% if user.is_authenticated %}
                     <form action="{% url 'login' %}" method="post">
-                        <a href="{{ user.get_absolute_url }}"><img src="/media/img/nobody-16.png" alt="Person">&nbsp;{{ user.person }}</a> &bull;
+                        <a href="{{ user.get_absolute_url }}"><img src="{{ STATIC_URL }}img/nobody-16.png" alt="Person">&nbsp;{{ user.person }}</a> &bull;
                         <input type="hidden" name="logout" value="1">
                         <input type="submit" value="{% trans 'Log out' %}">
                     </form>
@@ -53,7 +53,7 @@
 
         <div class="maxwidth">
 
-            <h1><a href="{% url 'home' %}" title="{% trans "Back to Damned Lies home page" %}"><img src="/media/img/foot.png" alt="GNOME" /> {% trans "Damned Lies" %}</a></h1>
+            <h1><a href="{% url 'home' %}" title="{% trans "Back to Damned Lies home page" %}"><img src="{{ STATIC_URL }}img/foot.png" alt="GNOME" /> {% trans "Damned Lies" %}</a></h1>
 
             <ul id="globalnav">
                 <li{% if pageSection == "home" %} class="active"{% endif %}><a href="{% url 'home' %}" title="{% trans "Back to Damned Lies home page" %}"><span>{% trans "Home" %}</span></a></li>
diff --git a/templates/help/vertimus_workflow.html b/templates/help/vertimus_workflow.html
index 69eb930..d918398 100644
--- a/templates/help/vertimus_workflow.html
+++ b/templates/help/vertimus_workflow.html
@@ -9,6 +9,6 @@
 {% trans "The figure below describes the various states and actions available during the translation process of a module." %}
 </p>
 
-<img src="/media/img/workflow-translation.png">
+<img src="{{ STATIC_URL }}img/workflow-translation.png">
 </div>
 {% endblock %}
diff --git a/templates/languages/language_all_modules.html b/templates/languages/language_all_modules.html
index 30f882f..136de6a 100644
--- a/templates/languages/language_all_modules.html
+++ b/templates/languages/language_all_modules.html
@@ -4,7 +4,7 @@
 {% block title %} {% trans "All modules" %} - {{ language.get_name }}{% endblock %}
 
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
     {
diff --git a/templates/languages/language_list.html b/templates/languages/language_list.html
index 3a92300..82e350d 100644
--- a/templates/languages/language_list.html
+++ b/templates/languages/language_list.html
@@ -18,7 +18,7 @@
   <li>
     <a href="{{ lang.get_team_url }}">{{ lang.get_name }}</a>
     <a href="/rss/languages/{{ lang.locale }}">
-      <img width="10" height="10" src="/media/img/feed-icon-10x10.png" alt="{% blocktrans %}RSS feed for {{ lang.get_name }}{% endblocktrans %}"/>
+      <img width="10" height="10" src="{{ STATIC_URL }}img/feed-icon-10x10.png" alt="{% blocktrans %}RSS feed for {{ lang.get_name }}{% endblocktrans %}"/>
     </a>
   </li>
   {% endfor %}
diff --git a/templates/languages/language_release.html b/templates/languages/language_release.html
index 4dbf478..2691ba9 100644
--- a/templates/languages/language_release.html
+++ b/templates/languages/language_release.html
@@ -4,7 +4,7 @@
 
 {% block title %} {% trans release.description %} - {{ language_name }}{% endblock %}
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
     {
diff --git a/templates/languages/language_release_stats.html b/templates/languages/language_release_stats.html
index f7dc876..e03e0d2 100644
--- a/templates/languages/language_release_stats.html
+++ b/templates/languages/language_release_stats.html
@@ -63,7 +63,7 @@
             <img src="{{ err.get_icon }}" title="{{ err.get_description|striptags }}" alt="{{ err.type }}" />
           {% endfor %}
           {% if stat|domain_type == "mallard" %}
-            <img style="margin-left: 1px;" src="/media/img/mallard.png" width="18" title="{% trans "This document is written in Mallard documentation format" %}" alt="mallard icon"/>
+            <img style="margin-left: 1px;" src="{{ STATIC_URL }}img/mallard.png" width="18" title="{% trans "This document is written in Mallard documentation format" %}" alt="mallard icon"/>
           {% endif %}
         </td>
           <td><span class="branch">{{ branch }}</span></td>
diff --git a/templates/languages/language_release_summary.html b/templates/languages/language_release_summary.html
index b32a117..451862a 100644
--- a/templates/languages/language_release_summary.html
+++ b/templates/languages/language_release_summary.html
@@ -12,7 +12,7 @@ Following variables should be set:
     <th>{% trans "User Interface" %}</th>
     <th>{% trans "Graph" %}</th>
     <th>{% trans "User Interface (red.)" %}
-        <a href="{% url 'help' 'reduced_po' %}" class="show-overlay"><img src="/media/img/help.png" alt="help icon"></a>
+        <a href="{% url 'help' 'reduced_po' %}" class="show-overlay"><img src="{{ STATIC_URL }}img/help.png" alt="help icon"></a>
     </th>
     <th>{% trans "Documentation" %}</th>
     <th>{% trans "Graph" %}</th>
diff --git a/templates/login.html b/templates/login.html
index b5de598..a69cb00 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -3,7 +3,7 @@
 {% load url from future %}
 
 {% block title %} {% trans "Damned Lies about GNOME" %} {% endblock %}
-{% block extrahead %} <link rel="stylesheet" href="/media/css/login.css"/> {% endblock %}
+{% block extrahead %} <link rel="stylesheet" href="{{ STATIC_URL }}css/login.css"/> {% endblock %}
 {% block content %}
 <div class="mainpage">
 
diff --git a/templates/module_detail.html b/templates/module_detail.html
index a69876f..87ba495 100644
--- a/templates/module_detail.html
+++ b/templates/module_detail.html
@@ -15,7 +15,7 @@ $(document).ready(function() {
             is_visible = branch_div.is(':visible');
             if (is_visible) {
                 branch_div.slideUp();
-                $(this).children('img').attr("src", "/media/img/closed.png");
+                $(this).children('img').attr("src", "{{ STATIC_URL }}img/closed.png");
             } else {
                 if (branch_div.attr("class") == "empty") {
                     // Load the branch stats dynamically
@@ -23,7 +23,7 @@ $(document).ready(function() {
                     branch_div.attr("class", "loaded");
                 }
                 branch_div.slideDown();
-                $(this).children('img').attr("src", "/media/img/open.png");
+                $(this).children('img').attr("src", "{{ STATIC_URL }}img/open.png");
             }
         });
     }
@@ -40,7 +40,7 @@ $(document).ready(function() {
   <p>{{ module.get_comment|safe }}</p>
 {% else %}
   {% if not module.has_standard_vcs %}
-  <p><em><img src="/media/img/warn.png" alt="Warning logo" /> {{ non_standard_repo_msg }}</em></p>
+  <p><em><img src="{{ STATIC_URL }}img/warn.png" alt="Warning logo" /> {{ non_standard_repo_msg }}</em></p>
   {% endif %}
 {% endif %}
 
@@ -78,11 +78,11 @@ $(document).ready(function() {
     {% if forloop.counter != 1 %} - {% endif %}
     <a href="#{{ branch.name }}">{{ branch.name }}</a>
     {% if branch.warnings %}
-    <img src="/media/img/warn.png" title="{{ branch.warnings }}" />
+    <img src="{{ STATIC_URL }}img/warn.png" title="{{ branch.warnings }}" />
     {% endif %}
   {% endfor %}
   {% if can_edit_branches %}
-    <a href="{% url 'stats.views.module_edit_branches' module.name %}"><img src="/media/img/edit.png" alt="Edit" /></a>
+    <a href="{% url 'stats.views.module_edit_branches' module.name %}"><img src="{{ STATIC_URL }}img/edit.png" alt="Edit" /></a>
   {% endif %}
   </p>
 
@@ -91,13 +91,13 @@ $(document).ready(function() {
     <hr />
     <h2><a href="." class="branch" id="{{ branch.name }}">
     {% if forloop.counter < 3 %}
-      <img src="/media/img/open.png" /></a>
+      <img src="{{ STATIC_URL }}img/open.png" /></a>
     {% else %}
-      <img src="/media/img/closed.png" /></a>
+      <img src="{{ STATIC_URL }}img/closed.png" /></a>
     {% endif %}
      <a name="{{ branch.name }}"></a>{{ branch.name }}
     {% if branch.get_vcs_web_url %}
-      <a href="{{ branch.get_vcs_web_url }}" title="{% trans 'Browse Repository' %}"><img src="/media/img/repository-icon.png" /></a>
+      <a href="{{ branch.get_vcs_web_url }}" title="{% trans 'Browse Repository' %}"><img src="{{ STATIC_URL }}img/repository-icon.png" /></a>
     {% endif %}
     </h2>
     {% if forloop.counter < 3 %}
diff --git a/templates/module_images.html b/templates/module_images.html
index 1c23926..f0b9df2 100644
--- a/templates/module_images.html
+++ b/templates/module_images.html
@@ -44,7 +44,7 @@
         {% endif %}
       {% else %}
         <em>{% trans "Not translated" %}</em><br/>
-        <img src="/media/img/emptyimg.png">
+        <img src="{{ STATIC_URL }}img/emptyimg.png">
       {% endif %}
     {% endif %}
     </td>
diff --git a/templates/people/person_detail.html b/templates/people/person_detail.html
index 10756ec..63c458e 100644
--- a/templates/people/person_detail.html
+++ b/templates/people/person_detail.html
@@ -4,7 +4,7 @@
 {% load stats_extras %}
 
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
     {
diff --git a/templates/people/person_list.html b/templates/people/person_list.html
index 90982c2..1361d53 100644
--- a/templates/people/person_list.html
+++ b/templates/people/person_list.html
@@ -19,7 +19,7 @@
         {% if person.image %}
         <img src="{{ person.image }}" alt="{{ person.name }}" />
         {% else %}
-        <img src="/media/img/nobody.png" alt="" />
+        <img src="{{ STATIC_URL }}img/nobody.png" alt="" />
         {% endif %}
         <a class="name" href="{{ person.get_absolute_url }}">{{ person.name }}</a><br />
 
diff --git a/templates/people/person_overview.html b/templates/people/person_overview.html
index 0c9a1ac..48ca31a 100644
--- a/templates/people/person_overview.html
+++ b/templates/people/person_overview.html
@@ -8,7 +8,7 @@
     {% if person.image %}
         <img src="{{ person.image }}" alt="{{ person.name }}" />
     {% else %}
-        <img src="/media/img/nobody.png" alt="" />
+        <img src="{{ STATIC_URL }}img/nobody.png" alt="" />
     {% endif %}
     </div>
 
diff --git a/templates/registration/register.html b/templates/registration/register.html
index ebff694..a4ca770 100644
--- a/templates/registration/register.html
+++ b/templates/registration/register.html
@@ -2,7 +2,7 @@
 {% load i18n %}
 
 {% block title %} {% trans "Damned Lies about GNOME" %} {% endblock %}
-{% block extrahead %} <link rel="stylesheet" href="/media/css/login.css"/> {% endblock %}
+{% block extrahead %} <link rel="stylesheet" href="{{ STATIC_URL }}css/login.css"/> {% endblock %}
 {% block content %}
 <div class="mainpage">
 
diff --git a/templates/release_compare.html b/templates/release_compare.html
index d045d76..eeb8e5d 100644
--- a/templates/release_compare.html
+++ b/templates/release_compare.html
@@ -4,7 +4,7 @@
 
 {% block title %} {% trans "Releases Comparison" %} {% endblock %}
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
     {
diff --git a/templates/release_detail.html b/templates/release_detail.html
index 18e6f7c..32bc981 100644
--- a/templates/release_detail.html
+++ b/templates/release_detail.html
@@ -22,7 +22,7 @@
       <th>{% trans "User Interface" %}</th>
       <th>{% trans "Graph" %}</th>
       <th>{% trans "User Interface (red.)" %}
-          <a href="{% url 'help' 'reduced_po' %}"><img src="/media/img/help.png" alt="help icon"></a>
+          <a href="{% url 'help' 'reduced_po' %}"><img src="{{ STATIC_URL }}img/help.png" alt="help icon"></a>
       </th>
       <th>{% trans "Documentation" %}</th>
       <th>{% trans "Graph" %}</th>
diff --git a/templates/stats_show.html b/templates/stats_show.html
index 7c3f030..aedab06 100644
--- a/templates/stats_show.html
+++ b/templates/stats_show.html
@@ -9,11 +9,11 @@
     <h3>{% trans pot_stat.domain.get_description %}
 
         {% if pot_stat|domain_type == "mallard" %}
-            <span style="padding-top: 8px;" class="icon_button"><img src="/media/img/mallard.png" title="{% trans "This document is written in Mallard documentation format" %}" alt="mallard icon"/></span>
+            <span style="padding-top: 8px;" class="icon_button"><img src="{{ STATIC_URL }}img/mallard.png" title="{% trans "This document is written in Mallard documentation format" %}" alt="mallard icon"/></span>
         {% endif %}
 
         {% if pot_stat.full_po %}
-            <a href="{{ pot_stat.po_url }}" class="icon_button" title="{% trans 'Download POT file' %}"><img src="/media/img/download-icon.png" alt="{% trans 'Download POT file' %}" /></a>
+            <a href="{{ pot_stat.po_url }}" class="icon_button" title="{% trans 'Download POT file' %}"><img src="{{ STATIC_URL }}img/download-icon.png" alt="{% trans 'Download POT file' %}" /></a>
         {% endif %}
 
     </h3>
@@ -36,10 +36,10 @@
                         {% if msg.type == 'error' or msg.type == 'error-ext' %}
                         <div class="actions">
                             <a href="{{ module|browse_bugs:'error+pot+file' }}" target="_blank">
-                                <img src="/media/img/search.png" alt="{% trans 'Search for similar bugs before reporting it' %}" title="{% trans 'Search for similar bugs before reporting it' %}"/>
+                                <img src="{{ STATIC_URL }}img/search.png" alt="{% trans 'Search for similar bugs before reporting it' %}" title="{% trans 'Search for similar bugs before reporting it' %}"/>
                             </a>
                             <a href="{{ msg.report_bug_url }}" target="_blank">
-                                <img src="/media/img/bug.png" alt="{% trans 'Report this bug' %}" title="{% trans 'Report this bug' %}" />
+                                <img src="{{ STATIC_URL }}img/bug.png" alt="{% trans 'Report this bug' %}" title="{% trans 'Report this bug' %}" />
                             </a>
                         </div>
                         {% endif %}
@@ -78,7 +78,7 @@
       <td>{{ line|num_stats }}</td>
       {% if pot_stat.full_po.fig_count %}
       <td><a href="{% url 'docimages' module.name pot_stat.domain.name branch.name line.language.locale %}">
-          <img src="/media/img/figure.png" alt="{% trans "Display document figures" %}"></a>
+          <img src="{{ STATIC_URL }}img/figure.png" alt="{% trans "Display document figures" %}"></a>
       </td>
       {% endif %}
       <td style="width: 108px; text-align: center;">
diff --git a/templates/teams/team_base.html b/templates/teams/team_base.html
index 248af8f..97f6703 100644
--- a/templates/teams/team_base.html
+++ b/templates/teams/team_base.html
@@ -9,7 +9,7 @@
         <h2>{% trans "Details" %}
             {% if can_edit_details %}
                 <a href="{% url 'team_edit' team.name %}">
-                    <img src="/media/img/edit_small.png" alt="Edit"/>
+                    <img src="{{ STATIC_URL }}img/edit_small.png" alt="Edit"/>
                 </a>
             {% endif %}
         </h2>
diff --git a/templates/teams/team_detail.html b/templates/teams/team_detail.html
index 6a24211..562e99d 100644
--- a/templates/teams/team_detail.html
+++ b/templates/teams/team_detail.html
@@ -15,7 +15,7 @@ $(document).ready(function() {
             is_visible = arch_div.is(':visible');
             if (is_visible) {
                 arch_div.hide();
-                $(this).children('img').attr("src", "/media/img/closed.png");
+                $(this).children('img').attr("src", "{{ STATIC_URL }}img/closed.png");
             } else {
                 if (arch_div.attr("class") == "empty") {
                     // Load the archive stats dynamically
@@ -23,7 +23,7 @@ $(document).ready(function() {
                     arch_div.attr("class", "loaded");
                 }
                 arch_div.show();
-                $(this).children('img').attr("src", "/media/img/open.png");
+                $(this).children('img').attr("src", "{{ STATIC_URL }}img/open.png");
             }
         });
     }
@@ -71,7 +71,7 @@ $(document).ready(function() {
 
     <p><strong>{% trans "Plural forms:" %}</strong> {{ lang.get_plurals }}</p>
 
-    <h3><a href="." class="archives" id="{{ lang.locale|escapeat }}"><img src="/media/img/closed.png" /></a>&nbsp;{% trans "Archives" %}</h3>
+    <h3><a href="." class="archives" id="{{ lang.locale|escapeat }}"><img src="{{ STATIC_URL }}img/closed.png" /></a>&nbsp;{% trans "Archives" %}</h3>
     <div id="div-rel-archives-{{ lang.locale|escapeat }}" class="empty" style="display:none;"></div>
 
 {% endfor %}
diff --git a/templates/teams/team_edit.html b/templates/teams/team_edit.html
index 3444e6b..b64f1b1 100644
--- a/templates/teams/team_edit.html
+++ b/templates/teams/team_edit.html
@@ -3,7 +3,7 @@
 {% block title %}{{ team.get_description }}{% endblock %}
 
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.growfield2.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.growfield2.js"></script>
 <script type="text/javascript">
 $(document).ready(function() {
     $("#id_presentation").growfield();
diff --git a/templates/vertimus/activity_summary.html b/templates/vertimus/activity_summary.html
index 4d62397..361696e 100644
--- a/templates/vertimus/activity_summary.html
+++ b/templates/vertimus/activity_summary.html
@@ -3,7 +3,7 @@
 {% load humanize %}
 
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
     {
diff --git a/templates/vertimus/vertimus_detail.html b/templates/vertimus/vertimus_detail.html
index e637e61..73bd315 100644
--- a/templates/vertimus/vertimus_detail.html
+++ b/templates/vertimus/vertimus_detail.html
@@ -7,7 +7,7 @@
 {% endblock %}
 
 {% block extrahead %}
-<script type="text/javascript" src="/media/js/jquery.growfield2.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.growfield2.js"></script>
 <script type="text/javascript">
 $(document).ready(function() {
     $("#id_comment").growfield();
@@ -56,17 +56,17 @@ $(document).ready(function() {
   <p>{{ module.get_comment|safe }}</p>
 {% else %}
   {% if not module.has_standard_vcs %}
-  <p><em><img src="/media/img/warn.png" alt="Warning logo" /> {{ non_standard_repo_msg }}</em></p>
+  <p><em><img src="{{ STATIC_URL }}img/warn.png" alt="Warning logo" /> {{ non_standard_repo_msg }}</em></p>
   {% endif %}
 {% endif %}
 
 <div id="vertimus_stats">
 <div><em><a href="{{ pot_stats.pot_url }}">
-      <img src="/media/img/download.png" alt="{% trans "Download POT file" %}" /></a>
+      <img src="{{ STATIC_URL }}img/download.png" alt="{% trans "Download POT file" %}" /></a>
     {{ pot_stats.pot_text }}
   </em></div>
   <div style="display: inline-block;">
-    <a href="{{ po_url }}"><img src="/media/img/download.png" alt="{% trans "Download PO file" %}" /></a>
+    <a href="{{ po_url }}"><img src="{{ STATIC_URL }}img/download.png" alt="{% trans "Download PO file" %}" /></a>
     {% trans "PO file statistics:" %} <br />
 	<div id="stats_po">
     <div title="{% trans "Translated/Fuzzy/Untranslated" %}">
@@ -92,11 +92,11 @@ $(document).ready(function() {
 
   {% if po_url_reduced %}
   <div style="display: inline-block; margin: 20px 0 5px 0;">
-    <a href="{{ po_url_reduced }}"><img src="/media/img/download.png" alt="{% trans "Download PO file" %}" /></a>
+    <a href="{{ po_url_reduced }}"><img src="{{ STATIC_URL }}img/download.png" alt="{% trans "Download PO file" %}" /></a>
     {% trans "PO file statistics (reduced):" %}
     <div style="display: inline-block;">
       <span class="help_link"><a href="{% url 'help' 'reduced_po' %}" class="show-overlay">
-        <img src="/media/img/help.png" alt="help icon" />
+        <img src="{{ STATIC_URL }}img/help.png" alt="help icon" />
       </a></span>
     </div>
     <br />
@@ -130,7 +130,7 @@ $(document).ready(function() {
 
 {% if other_states %}
 <div style="margin-top:1.2em; clear: both;">
-  <img src="/media/img/warn.png" alt="Warning logo" />
+  <img src="{{ STATIC_URL }}img/warn.png" alt="Warning logo" />
   {% trans "On-going activities in same module:" %}
   {% for st in other_states %}
     <a href="{% url 'vertimus_by_ids' st.branch.pk st.domain.pk st.language.pk %}">{{ st.branch.name }}</a>
@@ -172,7 +172,7 @@ $(document).ready(function() {
     <div class="vertimus_action_content">
 		<div class="face_image">
 			{% if action.person.image %}<img src="{{ action.person.image }}" alt="face" style="max-height: 50px;"/>
-			{% else %}<img src="/media/img/nobody.png" alt="Person"/>
+			{% else %}<img src="{{ STATIC_URL }}img/nobody.png" alt="Person"/>
 			{% endif %}
 		</div>
       {% if action.file %}
@@ -245,7 +245,7 @@ $(document).ready(function() {
   {% endif %}
 {% endif %}
 {% else %}
-  <p><img src="/media/img/warn.png"/>&nbsp;{% trans "This team is not using the Vertimus translation workflow." %}</p>
+  <p><img src="{{ STATIC_URL }}img/warn.png"/>&nbsp;{% trans "This team is not using the Vertimus translation workflow." %}</p>
 {% endif %}
 </div>
 {% endblock %}
diff --git a/templates/vertimus/vertimus_diff.html b/templates/vertimus/vertimus_diff.html
index 757c2d8..6a14702 100644
--- a/templates/vertimus/vertimus_diff.html
+++ b/templates/vertimus/vertimus_diff.html
@@ -7,7 +7,7 @@
 {% endblock %}
 
 {% block extrahead %}
-  <link rel="stylesheet" href="/media/css/difflib.css" />
+  <link rel="stylesheet" href="{{ STATIC_URL }}css/difflib.css" />
 {% endblock %}
 
 {% block content %}
diff --git a/urls.py b/urls.py
index 182cc67..b84dcfc 100644
--- a/urls.py
+++ b/urls.py
@@ -110,8 +110,4 @@ if settings.STATIC_SERVE:
             regex = r'^POT/(?P<path>.*)$',
             view = 'django.views.static.serve',
             kwargs = {'document_root': settings.POTDIR}),
-        url(
-            regex = r'^(robots.txt)$',
-            view = 'django.views.static.serve',
-            kwargs = {'document_root': settings.MEDIA_ROOT})
     )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]