[open-ils-commits] r204 - in servres/trunk/conifer: syrup templates (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 19 20:09:10 EDT 2009


Author: gfawcett
Date: 2009-03-19 20:09:10 -0400 (Thu, 19 Mar 2009)
New Revision: 204

Modified:
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/master.xhtml
Log:
remove Language link; for now, Preferences points just to Language.

We can fix this later when more preference options show up.

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-03-20 00:01:31 UTC (rev 203)
+++ servres/trunk/conifer/syrup/views.py	2009-03-20 00:09:10 UTC (rev 204)
@@ -143,17 +143,17 @@
             return _access_denied(_('Only instructors are allowed here.'))
     return hdlr
 
-
 # decorator
 def members_only(handler):
     def hdlr(request, course_id, *args, **kwargs):
-        allowed = request.user.is_superuser
+        user = request.user
+        allowed = user.is_superuser
         if not allowed:
             course = models.Course.objects.get(pk=course_id)
-            allowed = ((request.user.is_anonymous and course.access=='ANON') or \
-                       (request.user.is_authenticated and course.access=='LOGIN'))
+            allowed = ((user.is_anonymous and course.access=='ANON') or \
+                       (user.is_authenticated and course.access=='LOGIN'))
         if not allowed:
-            allowed = _fast_user_membership_query(request.user.id, course_id)
+            allowed = _fast_user_membership_query(user.id, course_id)
         if allowed:
             return handler(request, course_id, *args, **kwargs)
         else:
@@ -214,9 +214,8 @@
 
 
 def user_prefs(request):
-    return g.render('simplemessage.xhtml',
-                    title=_('Sorry...'), 
-                    content=_('The Preferences page isn\'t ready yet.'))
+    # for now, just send to the 'setlang' page. Better than 'under construction.'
+    return HttpResponseRedirect('../setlang')
 
 def z3950_test(request):
     conn = zoom.Connection ('z3950.loc.gov', 7090)

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2009-03-20 00:01:31 UTC (rev 203)
+++ servres/trunk/conifer/templates/master.xhtml	2009-03-20 00:09:10 UTC (rev 204)
@@ -42,13 +42,12 @@
       <span py:if="user.is_authenticated()">
 	<strong style="padding-right: 18;">Welcome, ${user.first_name or user.username}!</strong>
 	<a href="/accounts/logout">Log Out</a>
-	&bull; <a href="/syrup/setlang">Language</a>
 	&bull; <a href="/syrup/prefs/">Preferences</a>
       </span>
       <span py:if="not user.is_authenticated()">
 	<strong style="padding-right: 18;">Welcome!</strong>
 	<a class="loginbutton" href="/accounts/login/">Log In</a>
-	<a style="margin-left: 24;" href="/syrup/setlang">Language</a>
+	&bull; <a href="/syrup/prefs/">Preferences</a>
       </span>
     </div>
       <xi:include py:if="user.is_authenticated()" href="tabbar.xhtml"/>



More information about the open-ils-commits mailing list