damned-lies r1183 - in trunk: . common media/css templates



Author: claudep
Date: Sat Nov 22 17:03:37 2008
New Revision: 1183
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1183&view=rev

Log:
2008-11-22  Claude Paroz  <claude 2xlibre net>

	* common/views.py: Use RequestContext to be able to access user object in
	template.
	* media/css/main.css: Style for div#authenticated.
	* templates/500.html: The server error template was missing.
	* templates/base.html: Show username if logged in.
	* urls.py: Add URLs path if django_openid is installed.

Added:
   trunk/templates/500.html
Modified:
   trunk/   (props changed)
   trunk/ChangeLog
   trunk/common/views.py
   trunk/media/css/main.css
   trunk/templates/base.html
   trunk/urls.py

Modified: trunk/common/views.py
==============================================================================
--- trunk/common/views.py	(original)
+++ trunk/common/views.py	Sat Nov 22 17:03:37 2008
@@ -19,6 +19,7 @@
 # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from django.shortcuts import render_to_response
+from django.template import RequestContext
 from django.utils.translation import ugettext_lazy as _
 
 def index(request):
@@ -33,4 +34,4 @@
         'pageSection': 'home',
         'translator_credits': translator_credits
     }
-    return render_to_response('index.html', context)
+    return render_to_response('index.html', context, context_instance=RequestContext(request))

Modified: trunk/media/css/main.css
==============================================================================
--- trunk/media/css/main.css	(original)
+++ trunk/media/css/main.css	Sat Nov 22 17:03:37 2008
@@ -121,6 +121,13 @@
   margin-left: auto;
 }
 
+div#authenticated {
+  text-align: right;
+  font-size: small;
+  font-style: italic;
+  color: #aaaaaa;
+}
+
 div.col1 { float: left }
 div.col2 { float: left }
 div.col3 { float: left }

Added: trunk/templates/500.html
==============================================================================
--- (empty file)
+++ trunk/templates/500.html	Sat Nov 22 17:03:37 2008
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %} {% trans "Error: server error (500)" %} {% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+<h1>{% trans "Server Error" %}</h1>
+
+<p>{% trans "We're sorry but a server error has occurred." %}
+
+</div>
+{% endblock %}

Modified: trunk/templates/base.html
==============================================================================
--- trunk/templates/base.html	(original)
+++ trunk/templates/base.html	Sat Nov 22 17:03:37 2008
@@ -77,6 +77,11 @@
     </div> <!-- end of #header -->
   </div>
 <!-- end site header -->
+  <div id="authenticated">
+  {% if user.is_authenticated %}
+  {% blocktrans with user.username as username %} Logged in as: {{ username }}{% endblocktrans %}
+  {% endif %}
+  </div>
 
   <div class="body">
     <div id="content">

Modified: trunk/urls.py
==============================================================================
--- trunk/urls.py	(original)
+++ trunk/urls.py	Sat Nov 22 17:03:37 2008
@@ -22,6 +22,14 @@
     (r'^releases/(?P<release_name>[\w-]+)$', 'release'),
 )
 
+if 'django_openid' in settings.INSTALLED_APPS:
+    from django_openid.auth import AuthConsumer
+    
+    urlpatterns += patterns('',
+        # ...
+        (r'^openid/(.*)', AuthConsumer()),
+    )
+
 if settings.STATIC_SERVE:
     urlpatterns += patterns('',
         (r'^media/(?P<path>.*)$', 'django.views.static.serve',



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