[snowy] Preliminary base template work



commit ab94ee2fb1c83568e3dd18995dee17a88da2400c
Author: Brad Taylor <brad getcoded net>
Date:   Thu Apr 23 05:44:57 2009 -0400

    Preliminary base template work
    
    Add the neccessary magic to urls.py to make site_media work.  Tweak the theme
    to get something passable showing.  Still a lot of work to be done.
---
 site_media/css/screen.css |   31 ++++++++++++++++++++++++++++++-
 templates/base.html       |   14 ++++++++++++++
 urls.py                   |    9 +++++++++
 3 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/site_media/css/screen.css b/site_media/css/screen.css
index eac64d4..a6aa4b4 100644
--- a/site_media/css/screen.css
+++ b/site_media/css/screen.css
@@ -27,6 +27,27 @@ a, a:link, a:hover, a:active, a:visited {
 
 #header-auth {
     float: right;
+    margin: 1em 1em 0 0;
+    text-align: right;
+    vertical-align: middle;
+}
+
+#header-avatar {
+    float: right;
+    margin-left: 5px;
+}
+
+#header-avatar img {
+    border: 2px solid #FFFFFF;
+}
+
+#header-auth p, #header-auth h3 {
+    margin: 0;
+    padding: 0;
+}
+
+#header-auth p {
+    padding-top: .25em;
 }
 
 #content-container {
@@ -34,8 +55,13 @@ a, a:link, a:hover, a:active, a:visited {
 }
 
 #sidebar {
+    width: 20%;
+    min-width: 250px;
+    max-width: 500px;
+
+    margin-top: 20px;
+
     float: left;
-    width: 250px;
 
     background-color: #403b33;
     
@@ -70,8 +96,11 @@ a, a:link, a:hover, a:active, a:visited {
 }
 
 #content {
+    width: 80%;
+
     float: left;
     background-color: #edece6;
+    
 }
 
 #footer {
diff --git a/templates/base.html b/templates/base.html
index 6334169..84a340b 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -14,18 +14,32 @@
         <div id="header-logo">
             <img src="{{ MEDIA_URL }}img/tomboy-logo.png" alt="tomboy: simple note-taking."/>
         </div>
+        <div id="header-avatar">
+{% if user.is_authenticated %}
+            <img src="{{ MEDIA_URL }}img/blank-avatar.png" width="73" height="73" alt="Your Avatar"/>
+{% endif %}
+        </div>
         <div id="header-auth">
+{% if user.is_authenticated %}
             <!-- registration login form -->
+            <h3>{{ user }}</h3>
+            <p><a href="">preferences</a> / <a href="{% url django.contrib.auth.views.logout %}">log out</a></p>
+{% else %}
+            <p>care to <a href="{% url django.contrib.auth.views.login %}">log in</a>?</p>
+{% endif %}
         </div>
         <div class="clear"></div>
         </div>
     </div>
     <div id="content-container">
         <div id="sidebar">
+<br><br>
 {% block sidebar %}
 {% endblock %}
         </div>
         <div id="content">
+<br><br>
+<br><br>
 {% block content %}
 {% endblock %}
         </div>
diff --git a/urls.py b/urls.py
index f4a4aee..867119d 100644
--- a/urls.py
+++ b/urls.py
@@ -43,3 +43,12 @@ urlpatterns = patterns('',
     # Uncomment the next line to enable the admin:
     (r'^admin/', include(admin.site.urls)),
 )
+
+from django.conf import settings
+
+if settings.DEBUG:
+    urlpatterns += patterns('',
+        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {
+            'document_root': settings.MEDIA_ROOT,
+            'show_indexes': True
+        }))



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