damned-lies r1082 - in branches/djamnedlies: . media media/css media/img media/js stats/data stats/templates



Author: stephaner
Date: Wed Oct 22 23:24:44 2008
New Revision: 1082
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1082&view=rev

Log:
2008-10-23  StÃphane Raimbault  <stephane raimbault gmail com>

	Migrate all the static data from /stats/data to /media.
	Update all templates and CSS files.
	Use specific paths for img, css and js.
	
	* settings_sample.py: Added new STATIC_SERVE setting.
	* stats/urls.py: Added URL pattern to static Django view (only for
	development purpose).


Added:
   branches/djamnedlies/media/   (props changed)
      - copied from r1075, /branches/djamnedlies/stats/data/
   branches/djamnedlies/media/css/
   branches/djamnedlies/media/css/layout.css   (contents, props changed)
      - copied, changed from r1075, /branches/djamnedlies/stats/data/layout.css
   branches/djamnedlies/media/css/main.css   (contents, props changed)
      - copied, changed from r1075, /branches/djamnedlies/stats/data/main.css
   branches/djamnedlies/media/css/rtl.css   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/rtl.css
   branches/djamnedlies/media/css/style.css   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/style.css
   branches/djamnedlies/media/img/
   branches/djamnedlies/media/img/bar.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/bar.png
   branches/djamnedlies/media/img/cyan-bar.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/cyan-bar.png
   branches/djamnedlies/media/img/download.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/download.png
   branches/djamnedlies/media/img/emptyimg.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/emptyimg.png
   branches/djamnedlies/media/img/error.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/error.png
   branches/djamnedlies/media/img/figure.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/figure.png
   branches/djamnedlies/media/img/foot-16.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/foot-16.png
   branches/djamnedlies/media/img/foot.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/foot.png
   branches/djamnedlies/media/img/general_bg.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/general_bg.png
   branches/djamnedlies/media/img/general_separator.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/general_separator.png
   branches/djamnedlies/media/img/gnome-64.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/gnome-64.png
   branches/djamnedlies/media/img/gnome-gtp.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/gnome-gtp.png
   branches/djamnedlies/media/img/green-bar.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/green-bar.png
   branches/djamnedlies/media/img/info.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/info.png
   branches/djamnedlies/media/img/nobody.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/nobody.png
   branches/djamnedlies/media/img/purple-bar.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/purple-bar.png
   branches/djamnedlies/media/img/red-bar.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/red-bar.png
   branches/djamnedlies/media/img/star.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/star.png
   branches/djamnedlies/media/img/t.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/t.png
   branches/djamnedlies/media/img/tab_left.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/tab_left.png
   branches/djamnedlies/media/img/tab_right.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/tab_right.png
   branches/djamnedlies/media/img/warn.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/warn.png
   branches/djamnedlies/media/img/webpage.png   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/webpage.png
   branches/djamnedlies/media/js/
   branches/djamnedlies/media/js/main.js   (props changed)
      - copied unchanged from r1075, /branches/djamnedlies/stats/data/main.js
Removed:
   branches/djamnedlies/media/bar.png
   branches/djamnedlies/media/cyan-bar.png
   branches/djamnedlies/media/download.png
   branches/djamnedlies/media/emptyimg.png
   branches/djamnedlies/media/error.png
   branches/djamnedlies/media/figure.png
   branches/djamnedlies/media/foot-16.png
   branches/djamnedlies/media/foot.png
   branches/djamnedlies/media/general_bg.png
   branches/djamnedlies/media/general_separator.png
   branches/djamnedlies/media/gnome-64.png
   branches/djamnedlies/media/gnome-gtp.png
   branches/djamnedlies/media/green-bar.png
   branches/djamnedlies/media/info.png
   branches/djamnedlies/media/layout.css
   branches/djamnedlies/media/main.css
   branches/djamnedlies/media/main.js
   branches/djamnedlies/media/nobody.png
   branches/djamnedlies/media/purple-bar.png
   branches/djamnedlies/media/red-bar.png
   branches/djamnedlies/media/rtl.css
   branches/djamnedlies/media/star.png
   branches/djamnedlies/media/style.css
   branches/djamnedlies/media/t.png
   branches/djamnedlies/media/tab_left.png
   branches/djamnedlies/media/tab_right.png
   branches/djamnedlies/media/warn.png
   branches/djamnedlies/media/webpage.png
   branches/djamnedlies/stats/data/
Modified:
   branches/djamnedlies/ChangeLog
   branches/djamnedlies/settings_sample.py
   branches/djamnedlies/stats/templates/base.tmpl
   branches/djamnedlies/stats/templates/language-release-stats.tmpl
   branches/djamnedlies/stats/templates/module.tmpl
   branches/djamnedlies/stats/templates/people.tmpl
   branches/djamnedlies/stats/templates/person-base.tmpl
   branches/djamnedlies/urls.py

Copied: branches/djamnedlies/media/css/layout.css (from r1075, /branches/djamnedlies/stats/data/layout.css)
==============================================================================
--- /branches/djamnedlies/stats/data/layout.css	(original)
+++ branches/djamnedlies/media/css/layout.css	Wed Oct 22 23:24:44 2008
@@ -244,7 +244,7 @@
 	margin: 0px;
 	padding: 0px;
 	font-family: sans-serif;
-	background: white url(star.png) -100px -200px no-repeat;
+	background: white url(/media/img/star.png) -100px -200px no-repeat;
 	height: 101%;
 }
 
@@ -289,7 +289,7 @@
 div.sidebar h2 {
 	margin-top: 0;
 	padding: 5px 2ex 5px 2ex;
-	background: url(t.png) top left repeat-y;
+	background: url(/media/img/t.png) top left repeat-y;
 	font-size: 100%;
 }
 
@@ -316,7 +316,7 @@
 
 #general {
 	list-style: none;
-	background: #2E3436 url(general_bg.png) 0 100% repeat-x;
+	background: #2E3436 url(/media/img/general_bg.png) 0 100% repeat-x;
 	text-align: right;
 	padding: 0 1ex;
 	margin: 0;
@@ -325,7 +325,7 @@
 
 #general li {
 	display: inline;
-	background: url(general_separator.png) 0 0 no-repeat;
+	background: url(/media/img/general_separator.png) 0 0 no-repeat;
 	padding-top: 10px;
 	padding-bottom: 8px;
 	margin-left: 0px;
@@ -346,21 +346,21 @@
 
 #general .home {
 	float: left;
-	background: url(general_separator.png) 100% 0 no-repeat;
+	background: url(/media/img/general_separator.png) 100% 0 no-repeat;
 	padding-top: 0;
 	padding-bottom: 0;
 }
 
 #general .home a {
 	float: left;
-	background: url(foot.png) 7px 50% no-repeat;
+	background: url(/media/img/foot.png) 7px 50% no-repeat;
 	margin-left: 0;
 	padding-left: 27px;
 }
 
 
 #header {
-	background: #729FCF url(gnome-gtp.png) 15px 10px no-repeat;
+	background: #729FCF url(/media/img/gnome-gtp.png) 15px 10px no-repeat;
 	float: left;
 	width: 100%;
 	font-size: 75%;
@@ -375,7 +375,7 @@
 }
 
 #tabs {
-	background: url(bar.png) 0 100% repeat-x;
+	background: url(/media/img/bar.png) 0 100% repeat-x;
 	width: 100%;
 	float: left;
 	margin: 0;
@@ -404,26 +404,26 @@
 	float: left;
 	text-decoration: none;
 	color: #555555;
-	background: url(tab_left.png) 0 0 no-repeat;
+	background: url(/media/img/tab_left.png) 0 0 no-repeat;
 	padding: 7px 0 7px 7px;
 	border-bottom: 2px solid #CCCCCC;
 }
 
 #portal-globalnav li span {
-	background: url(tab_right.png) 100% 0 no-repeat;
+	background: url(/media/img/tab_right.png) 100% 0 no-repeat;
 	padding: 7px 28px 7px 19px;
 }
 
 #portal-globalnav li.selected a {
 	color: #3566A5;
-	background: url(tab_left.png) 0 -57px no-repeat;
+	background: url(/media/img/tab_left.png) 0 -57px no-repeat;
 	border-bottom: none;
 	padding-top: 8px;
 	padding-bottom: 8px;
 }
 
 #portal-globalnav li.selected a span {
-	background: url(tab_right.png) 100% -57px no-repeat;
+	background: url(/media/img/tab_right.png) 100% -57px no-repeat;
 	padding-top: 8px;
 	padding-bottom: 8px;
 }
@@ -438,5 +438,5 @@
 
 /*show a foot logo instead of dots in some lists*/
 ul.foot li {
-   list-style-image: url('foot-16.png');
+   list-style-image: url(/media/img/foot-16.png);
 }

Copied: branches/djamnedlies/media/css/main.css (from r1075, /branches/djamnedlies/stats/data/main.css)
==============================================================================
--- /branches/djamnedlies/stats/data/main.css	(original)
+++ branches/djamnedlies/media/css/main.css	Wed Oct 22 23:24:44 2008
@@ -37,7 +37,7 @@
   height:100%; 
   left: 0%; 
   background: #448844;
-  background: url('green-bar.png');
+  background: url(/media/img/green-bar.png);
   background-repeat: repeat-x;
   color: black;
 }
@@ -47,7 +47,7 @@
   top: 0px;
   height:100%; 
   background: #55DD55;
-  background: url('cyan-bar.png');
+  background: url(/media/img/cyan-bar.png);
   background-repeat: repeat-x;
   color: black;
 }
@@ -57,7 +57,7 @@
   top: 0px;
   height:100%; 
   background: #4444AA;
-  background: url('purple-bar.png');
+  background: url(/media/img/purple-bar.png);
   background-repeat: repeat-x;
   color: black;
 }
@@ -67,7 +67,7 @@
   height:100%; 
   top: 0px;
   background: #FF4444;
-  background: url('red-bar.png');
+  background: url(/media/img/red-bar.png);
   background-repeat: repeat-x;
   color: black;
 }

Modified: branches/djamnedlies/settings_sample.py
==============================================================================
--- branches/djamnedlies/settings_sample.py	(original)
+++ branches/djamnedlies/settings_sample.py	Wed Oct 22 23:24:44 2008
@@ -4,6 +4,7 @@
 
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
+STATIC_SERVE = True
 
 PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
 
@@ -39,17 +40,17 @@
 
 # Absolute path to the directory that holds media.
 # Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
+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_URL = 'media'
 
 # 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_MEDIA_PREFIX = '/admin_media/'
 
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = 'zk!^92901p458c8lo0(fox-&k7jj(aple76_k%eva7b1)xjo8-'

Modified: branches/djamnedlies/stats/templates/base.tmpl
==============================================================================
--- branches/djamnedlies/stats/templates/base.tmpl	(original)
+++ branches/djamnedlies/stats/templates/base.tmpl	Wed Oct 22 23:24:44 2008
@@ -6,14 +6,14 @@
 <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="{{ webroot }}/data/foot-16.png"/>
-  <link rel="stylesheet" href="{{ webroot }}/data/main.css"/>
-  <link rel="stylesheet" href="{{ webroot }}/data/layout.css"/>
-  <link rel="stylesheet" href="{{ webroot }}/data/style.css"/>
+  <link rel="icon" type="image/png" href="/media/img/foot-16.png"/>
+  <link rel="stylesheet" href="/media/css/main.css"/>
+  <link rel="stylesheet" href="/media/css/layout.css"/>
+  <link rel="stylesheet" href="/media/css/style.css"/>
 {% if rtl %}
-  <link rel="stylesheet" href="{{ webroot }}/data/rtl.css"/>
+  <link rel="stylesheet" href="/media/css/rtl.css"/>
 {% endif %}
-  <script src="{{ webroot }}/data/main.js" type="text/javascript"></script>
+  <script src="/media/js/main.js" type="text/javascript"></script>
 </head>
 
 {% if rtl %}

Modified: branches/djamnedlies/stats/templates/language-release-stats.tmpl
==============================================================================
--- branches/djamnedlies/stats/templates/language-release-stats.tmpl	(original)
+++ branches/djamnedlies/stats/templates/language-release-stats.tmpl	Wed Oct 22 23:24:44 2008
@@ -37,13 +37,13 @@
           {% if dom.1.partial_po %}
             {# This is a partial po, indented, with the domain description #}
             <td class="leftcell" style="padding-left:2em; padding-right:2em;">
-            <a href="{{ dom.1.po_url }}"><img src="{{ webroot }}/data/download.png" alt="{% trans "Download po file" %}"></a>
+            <a href="{{ dom.1.po_url }}"><img src="/media/img/download.png" alt="{% trans "Download po file" %}"></a>
             {{ dom.1.domain.description }}
             </td>
           {% else %}
             <td class="leftcell">
             {% if not dom.1.is_fake %}
-              <a href="{{ dom.1.po_url }}"><img src="{{ webroot }}/data/download.png" alt="{% trans "Download po file" %}"></a>
+              <a href="{{ dom.1.po_url }}"><img src="/media/img/download.png" alt="{% trans "Download po file" %}"></a>
               <a href="{% url stats.views.module modname %}">
             {% else %}
               <a href="{% url stats.views.module modname %}" style="font-style: italic;">

Modified: branches/djamnedlies/stats/templates/module.tmpl
==============================================================================
--- branches/djamnedlies/stats/templates/module.tmpl	(original)
+++ branches/djamnedlies/stats/templates/module.tmpl	Wed Oct 22 23:24:44 2008
@@ -12,7 +12,7 @@
   <p>{{ module.comment|safe }}</p>
 {% else %}
   {% ifnotequal module.vcs_root "http://svn.gnome.org/svn"; %}
-  <p><i><img src="{{ webroot }}/data/warn.png" alt="Warning logo" />{% trans "This module is not part of the GNOME SVN repository. Please check the module's web page to see where to send translations." %}</i></p>
+  <p><i><img src="/media/img/warn.png" alt="Warning logo" />{% trans "This module is not part of the GNOME SVN repository. Please check the module's web page to see where to send translations." %}</i></p>
   {% endifnotequal %}
 {% endif %}
 
@@ -29,7 +29,7 @@
     {% if maintainer.image %}
       <img class="people" src="{{ maintainer.image }}" alt="" />
     {% else %}
-      <img class="people" src="{{ webroot }}/data/nobody.png" alt="" />
+      <img class="people" src="/media/img/nobody.png" alt="" />
     {% endif %}
     <a style="font-size: 140%;" href="{% url stats.views.person maintainer.id %}">{{ maintainer.name }}</a>
     </div>

Modified: branches/djamnedlies/stats/templates/people.tmpl
==============================================================================
--- branches/djamnedlies/stats/templates/people.tmpl	(original)
+++ branches/djamnedlies/stats/templates/people.tmpl	Wed Oct 22 23:24:44 2008
@@ -13,10 +13,10 @@
 <div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
 {% for person in people %}
   <div class="maintainer">
-  {% ifnotequal person.image '/data/nobody.png' %}
+  {% ifnotequal person.image '/media/img/nobody.png' %}
     <img class="people" src="{{ person.image }}" alt="{{ person.name }}" />
   {% else %}
-    <img class="people" src="{{ webroot }}/data/nobody.png" alt="" />
+    <img class="people" src="/media/img/nobody.png" alt="" />
   {% endifnotequal %}
   <a style="font-size: 120%;" href="{{ webroot }}/people/{{ person.id }}">{{ person.name }}</a><br />
   {% if person.webpage_url %}

Modified: branches/djamnedlies/stats/templates/person-base.tmpl
==============================================================================
--- branches/djamnedlies/stats/templates/person-base.tmpl	(original)
+++ branches/djamnedlies/stats/templates/person-base.tmpl	Wed Oct 22 23:24:44 2008
@@ -5,13 +5,13 @@
 {% load i18n %}
 
   <div class="maintainer">
-  {% ifnotequal person.image '/data/nobody.png' %}
+  {% ifnotequal person.image '/media/img/nobody.png' %}
     <img class="people" src="{{ person.image }}" alt="{{ person.name }}" />
   {% else %}
-    <img class="people" src="{{ webroot }}/data/nobody.png" alt="" />
+    <img class="people" src="/media/img/nobody.png" alt="" />
   {% endifnotequal %}
 
-  <a style="font-size: 140%;" href="{{ webroot }}/people/{{ person.id }}">{{ person.name }}</a><br />
+  <a style="font-size: 140%;" href="/people/{{ person.id }}">{{ person.name }}</a><br />
 
   {% if person.nospamemail %}
     <a href="mailto:{{ person.nospamemail }}">{{ person.nospamemail }}</a><br />

Modified: branches/djamnedlies/urls.py
==============================================================================
--- branches/djamnedlies/urls.py	(original)
+++ branches/djamnedlies/urls.py	Wed Oct 22 23:24:44 2008
@@ -1,7 +1,7 @@
 from django.conf.urls.defaults import *
-
-# Uncomment the next two lines to enable the admin:
+from django.conf import settings
 from django.contrib import admin
+
 admin.autodiscover()
 
 urlpatterns = patterns('',
@@ -14,3 +14,9 @@
     (r'^stats/', include('djamnedlies.stats.urls')),
 
 )
+
+if settings.STATIC_SERVE:
+    urlpatterns += patterns('',
+        (r'^media/(?P<path>.*)$', 'django.views.static.serve',
+         {'document_root': settings.MEDIA_ROOT}),
+    )



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