# HG changeset patch # User Jordi GutiĆ©rrez Hermoso # Date 1278033256 18000 # Node ID 28a512881850bcdcd2b3682be191b1be3ce1758e # Parent 3c56be2f61fcbadbf769da5c7847068c14c82af8 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 diff -r 3c56be2f61fc -r 28a512881850 README --- a/README Thu Jul 01 15:00:23 2010 -0500 +++ b/README Thu Jul 01 20:14:16 2010 -0500 @@ -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 diff -r 3c56be2f61fc -r 28a512881850 apps/profile/views.py --- a/apps/profile/views.py Thu Jul 01 15:00:23 2010 -0500 +++ b/apps/profile/views.py Thu Jul 01 20:14:16 2010 -0500 @@ -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, }) diff -r 3c56be2f61fc -r 28a512881850 static/djangodocs.css --- a/static/djangodocs.css Thu Jul 01 15:00:23 2010 -0500 +++ b/static/djangodocs.css Thu Jul 01 20:14:16 2010 -0500 @@ -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%; diff -r 3c56be2f61fc -r 28a512881850 templates/base.djhtml --- a/templates/base.djhtml Thu Jul 01 15:00:23 2010 -0500 +++ b/templates/base.djhtml Thu Jul 01 20:14:16 2010 -0500 @@ -5,7 +5,7 @@ - Agora Octave — + <title>Agora Octave — {% 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> - diff -r 3c56be2f61fc -r 28a512881850 templates/index.djhtml --- a/templates/index.djhtml Thu Jul 01 15:00:23 2010 -0500 +++ b/templates/index.djhtml Thu Jul 01 20:14:16 2010 -0500 @@ -33,4 +33,3 @@ </div> </div class="info"> {% endblock %} - diff -r 3c56be2f61fc -r 28a512881850 templates/user.djhtml --- a/templates/user.djhtml Thu Jul 01 15:00:23 2010 -0500 +++ b/templates/user.djhtml Thu Jul 01 20:14:16 2010 -0500 @@ -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 %} diff -r 3c56be2f61fc -r 28a512881850 templates/whitebox.djhtml --- a/templates/whitebox.djhtml Thu Jul 01 15:00:23 2010 -0500 +++ b/templates/whitebox.djhtml Thu Jul 01 20:14:16 2010 -0500 @@ -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 %}