review how sattic files are kept
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 21 Nov 2012 18:38:09 +0000 (19:38 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 21 Nov 2012 18:38:09 +0000 (19:38 +0100)
.gitignore
Makefile
auth/templates/auth.html
myslice/settings.py
myslice/static/css/mymenu.css [new file with mode: 0644]
myslice/static/img/myslice-logo.png [moved from myslice/static/myslice-logo.png with 100% similarity]
myslice/static/js/mymenu.js [new file with mode: 0644]
slice/templates/foo-base.html
slice/templates/foo-menu.html

index 90282c0..5c0ef9b 100644 (file)
@@ -2,4 +2,4 @@ TAGS
 *.pyc
 *.sqlite3
 *~
-
+all-static/
index 99fb321..fe0820f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,3 +5,6 @@ tags:
 # however sometimes we have stuff not yet added, so in this case
 ftags:
        find . -type f | fgrep -v '/.git/' | xargs etags
+
+static:
+       ./manage.py collectstatic --noinput 
index eda158b..5376577 100644 (file)
@@ -12,7 +12,7 @@ body{
 </head>
 <body>
        {{ state }}
-          <a href="/" alt="Home"><img class="logo" src="{{ STATIC_URL }}myslice-logo.png" alt="MySlice" /></a>
+          <a href="/" alt="Home"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a>
        <form action="/login/" method="post">
                {% csrf_token %}
                {% if next %}
index 31432e5..258c3e2 100644 (file)
@@ -173,4 +173,5 @@ AUTHENTICATION_BACKENDS = ( 'auth.backend.MyCustomBackend', )
 
 #################### for insert_above
 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
-IA_MEDIA_PREFIX = '/code/'
+# put stuff under static/
+# IA_MEDIA_PREFIX = '/code/'
diff --git a/myslice/static/css/mymenu.css b/myslice/static/css/mymenu.css
new file mode 100644 (file)
index 0000000..cddbfe8
--- /dev/null
@@ -0,0 +1,8 @@
+ul#mymenu {
+    position: fixed; 
+    display: block;
+    padding:0;
+    margin:0;
+    bottom: 10px;
+    right: 10px; 
+}
diff --git a/myslice/static/js/mymenu.js b/myslice/static/js/mymenu.js
new file mode 100644 (file)
index 0000000..d513d5d
--- /dev/null
@@ -0,0 +1,3 @@
+// a dummy javascript file 
+// I've seen this working, but of course it's painful ..
+//alert("loaded mymenu.js")
index b67a596..97f36ea 100644 (file)
@@ -1,8 +1,10 @@
+{# This is required by insert_above #}
 {% insert_handler %}
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html> <head>
 <title> Foo - an experimental slice page with foo= {{ foo }} </title>
-{% media_container media %}
+{# This is where insert_str will end up #}
+{% media_container prelude %}
 <script>
 {% container raw_js %}
 </script>
@@ -13,7 +15,9 @@
 
 <body>
 {% block menu %} <div class='menu'> {{ menu }} </div> {% endblock %}
-{% block float %} <div class='float'> {{ float|default:"The float area" }} </div> {% endblock %}
+{% block float %} <div class='float'>
+  <img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" />
+  {{ float|default:"The float area" }} </div> {% endblock %}
 {% block main %}
 <div class='main'>  <h1>Again, foo = {{ foo }} </h1> {{ main }} </div>
 <hr>
index 36d096c..ed91b02 100644 (file)
@@ -1,10 +1,8 @@
-{% insert_str media "js/mymenu.js" %}
-{% insert_str media "css/mymenu.css" %}
+{% insert_str prelude "js/mymenu.js" %}
+{% insert_str prelude "css/mymenu.css" %}
+{# this shows how to add raw js code #}
 {% insert raw_js %} "some script useful for mymenu" {% endinsert %}
-{% insert raw_css %}
-ul#mymenu { position: fixed; display: block; padding:0; margin:0;
-         bottom: 10px; right: 10px; }
-{% endinsert %}
+{# use the raw_css container for css style #}
 
 <ul id='mymenu'>
 {% for d in menu_items %}
@@ -12,12 +10,3 @@ ul#mymenu { position: fixed; display: block; padding:0; margin:0;
 {% endfor %}
 </ul>
 
-<!--
-<ul id='mymenu'>
-  <li class="other"> other text </li>
-  <li class="other"> another non-current text </li>
-  <li class="current" title="the title for the current item">
-    <span>"The label of the current menu" </span>
-  </li>
-</ul>
--->