changeset 33:28a512881850

Several fixes. See detailed commit message. - Clarify dependencies in README - Display real name in userpage if available - Change styling of login/logout links in navigation bar - Cleanup whitespace
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Thu, 01 Jul 2010 20:14:16 -0500
parents 3c56be2f61fc
children 22d514498935
files README apps/profile/views.py static/djangodocs.css templates/base.djhtml templates/index.djhtml templates/user.djhtml templates/whitebox.djhtml
diffstat 7 files changed, 40 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -3,10 +3,18 @@
 the Affero General Public License version 3 as published by the Free
 Software Foundation, or at your option, any later version.
 
+Required external libraries:
+
+    - Django registration      
+      (http://bitbucket.org/ubernostrum/django-registration/)
+
 Quickstart for personal debugging:
 
-    1) Install Django, Python, mercurial, SQLite3. On a Unix-based
-       system, Python is probably already installed.
+    1) Install Django 1.2 or higher, Python 2.5 or higher, the
+       external librariesm, and probably any version of mercurial,
+       SQLite3. On a Unix-based system, Python is probably already
+       installed, the rest can be gotten from source or your operating
+       system's package manager if it has one.
 
     2) Clone this repository
 
--- a/apps/profile/views.py
+++ b/apps/profile/views.py
@@ -21,11 +21,17 @@
         p = Profile(user=u, preferred_license=FreeLicense.objects.get(id=1))
         p.save()
 
+    if u.first_name or u.last_name:
+        n = u.first_name + " " + u.last_name
+    else:
+        n = u.username
+
     b = Bundle.objects.filter(uploader=u)
     s = Snippet.objects.filter(uploader=u)
 
     return render_to_response('user.djhtml', {'user' : u,
                                               'profile' : p,
                                               'bundles' : b,
-                                              'snippets' :s,
+                                              'snippets' : s,
+                                              'name' : n,
                                               })
--- a/static/djangodocs.css
+++ b/static/djangodocs.css
@@ -104,7 +104,7 @@
 #nav-main{position: relative; z-index: 1; height: 0.85em;}
 #nav-right{position: relative; z-index: 1; height: 0.85em;
            float :right;
-           color: #6A6354; padding-right: 2em; margin:0;}
+           color: #2e3436; padding-right: 2em; margin:0;}
 #nav{
     margin: 0; font-size: 12px; text-align: right;
     font-weight: normal; width: 100%;
--- a/templates/base.djhtml
+++ b/templates/base.djhtml
@@ -5,7 +5,7 @@
     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
     <meta http-equiv="Content-Language" content="en-us" />
 
-    <title>Agora Octave &mdash; 
+    <title>Agora Octave &mdash;
       {% block title %}
       Free your math!
       {% endblock %}
@@ -23,18 +23,18 @@
     enables collaboration with Octave-related personal projects and
     code" />
 
-    <link href="/static/{% block cssid %}base{% endblock %}.css" 
+    <link href="/static/{% block cssid %}base{% endblock %}.css"
           rel="stylesheet" type="text/css" media="screen" />
     {% block extrahead %}{% endblock %}
   </head>
 
-  <body id="{% block sectionid %}generic{% endblock %}" 
+  <body id="{% block sectionid %}generic{% endblock %}"
         class="{% block coltype %}default{% endblock %}">
 
   <div id="container">
     <div id="header">
       <img src="/static/agora.png" id="agora-logo">
-      <h1 id="logo"><a href="/">Agora Octave</a> 
+      <h1 id="logo"><a href="/">Agora Octave</a>
       </h1>
       <div id="nav">
         <div id="nav-top"></div>
@@ -54,16 +54,16 @@
     <div id="billboard">{% block billboard %}{% endblock %}</div>
     <div id="columnwrap">
 
-		  <div id="content-main">
-		    {% block content %}
-		    {% endblock %}
-		  </div>
-		  <!-- END #content-main -->
-		  <div id="content-related" class="sidebar">
-		    {% block content-related %}
-		    {% endblock %}
-		  </div>
-		  <!-- END #content-related -->
+      <div id="content-main">
+        {% block content %}
+        {% endblock %}
+      </div>
+      <!-- END #content-main -->
+      <div id="content-related" class="sidebar">
+        {% block content-related %}
+        {% endblock %}
+      </div>
+      <!-- END #content-related -->
 
     </div>
     <!-- END #content -->
@@ -79,4 +79,3 @@
   <!-- END #footer -->
   </body>
 </html>
-
--- a/templates/index.djhtml
+++ b/templates/index.djhtml
@@ -33,4 +33,3 @@
   </div>
 </div class="info">
 {% endblock %}
-
--- a/templates/user.djhtml
+++ b/templates/user.djhtml
@@ -5,8 +5,8 @@
 {% block boxcontents %}
 <div id="userinfo">
   {% if user.first_name or user.last_name %}
-  <span class="userfield">Name</span> 
-  <span class="userdata">{{user.first_name}} {{user.last_name}}</span> 
+  <span class="userfield">Name</span>
+  <span class="userdata">{{name}}</span>
   <br />
   {% endif %}
   <span class="userfield">Preferred license</span>
@@ -23,7 +23,7 @@
 
   {% if profile.blurb %}
   <h4>
-    About {{user.username}}
+    About {{name}}
   </h4>
   <p class="userdata">
     {{profile.blurb}}
@@ -36,7 +36,7 @@
 {% if bundles or snippets %}
 <div id="info">
   <h3>
-    Contributions by {{user.username}}
+    Contributions by {{name}}
   </h3>
   <div class="whitebox">
     {% if bundles %}
--- a/templates/whitebox.djhtml
+++ b/templates/whitebox.djhtml
@@ -13,12 +13,10 @@
 
 {% block session %}
 {% if user.is_authenticated %}
-<form action="{% url auth_logout %}" method="post" id="nav-right">
-  You are logged in
-  as <a href="/{{user.username}}">{{user.username}}</a>.
-  {% csrf_token %}
-  <input type="submit" value="logout" id="logout-button"/>
-</form>
+<a href="{% url auth_logout %}" id="nav-logout">Logout</a>
+<small>
+  (<a href="/{{user.username}}" id="nav-username">{{user.username}}</a>)
+</small>
 {% else %}
 <a href="{% url auth_login %}?next={{ request.path }}">Log in</a>
 {% endif %}