From 1f890ea0c653d62c2127921d43cf6ef233d7968b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 21 Nov 2012 19:38:09 +0100 Subject: [PATCH] review how sattic files are kept --- .gitignore | 2 +- Makefile | 3 +++ auth/templates/auth.html | 2 +- myslice/settings.py | 3 ++- myslice/static/css/mymenu.css | 8 ++++++++ myslice/static/{ => img}/myslice-logo.png | Bin myslice/static/js/mymenu.js | 3 +++ slice/templates/foo-base.html | 8 ++++++-- slice/templates/foo-menu.html | 19 ++++--------------- 9 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 myslice/static/css/mymenu.css rename myslice/static/{ => img}/myslice-logo.png (100%) create mode 100644 myslice/static/js/mymenu.js diff --git a/.gitignore b/.gitignore index 90282c09..5c0ef9b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ TAGS *.pyc *.sqlite3 *~ - +all-static/ diff --git a/Makefile b/Makefile index 99fb3210..fe0820fc 100644 --- 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 diff --git a/auth/templates/auth.html b/auth/templates/auth.html index eda158b6..5376577d 100644 --- a/auth/templates/auth.html +++ b/auth/templates/auth.html @@ -12,7 +12,7 @@ body{ {{ state }} - +
{% csrf_token %} {% if next %} diff --git a/myslice/settings.py b/myslice/settings.py index 31432e5c..258c3e28 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -173,4 +173,5 @@ AUTHENTICATION_BACKENDS = ( 'auth.backend.MyCustomBackend', ) #################### for insert_above #IA_JS_FORMAT = " @@ -13,7 +15,9 @@ {% block menu %} {% endblock %} -{% block float %}
{{ float|default:"The float area" }}
{% endblock %} +{% block float %}
+ + {{ float|default:"The float area" }}
{% endblock %} {% block main %}

Again, foo = {{ foo }}

{{ main }}

diff --git a/slice/templates/foo-menu.html b/slice/templates/foo-menu.html index 36d096c7..ed91b028 100644 --- a/slice/templates/foo-menu.html +++ b/slice/templates/foo-menu.html @@ -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 #} - -- 2.43.0