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

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 19 20:01:32 EDT 2009


Author: gfawcett
Date: 2009-03-19 20:01:31 -0400 (Thu, 19 Mar 2009)
New Revision: 203

Modified:
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/admin/index.xhtml
   servres/trunk/conifer/templates/components/course.xhtml
   servres/trunk/conifer/templates/master.xhtml
Log:
various tweaks. Permissions fix; moving around some admin links.

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-03-19 23:30:59 UTC (rev 202)
+++ servres/trunk/conifer/syrup/views.py	2009-03-20 00:01:31 UTC (rev 203)
@@ -149,6 +149,10 @@
     def hdlr(request, course_id, *args, **kwargs):
         allowed = request.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'))
+        if not allowed:
             allowed = _fast_user_membership_query(request.user.id, course_id)
         if allowed:
             return handler(request, course_id, *args, **kwargs)

Modified: servres/trunk/conifer/templates/admin/index.xhtml
===================================================================
--- servres/trunk/conifer/templates/admin/index.xhtml	2009-03-19 23:30:59 UTC (rev 202)
+++ servres/trunk/conifer/templates/admin/index.xhtml	2009-03-20 00:01:31 UTC (rev 203)
@@ -11,6 +11,10 @@
 <body>
   <h1>${title}</h1>
   <ul>
+    <li><a href="/admin/">Django Administrative UI</a></li>
+  </ul>
+
+  <ul>
     <li><a href="checkout/">Charge/Discharge</a></li>
   </ul>
   <ul>

Modified: servres/trunk/conifer/templates/components/course.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/course.xhtml	2009-03-19 23:30:59 UTC (rev 202)
+++ servres/trunk/conifer/templates/components/course.xhtml	2009-03-20 00:01:31 UTC (rev 203)
@@ -33,8 +33,10 @@
       <a href="${item.item_url()}">${item}</a> 
       <span class="menublock">
 	<span py:if="item.needs_meta_link()">
-	<a href="${item.item_url('meta')}">about</a> &bull;</span>
-	<a href="${item.item_url('edit/')}">edit</a>
+	<a href="${item.item_url('meta')}">about</a> </span>
+	<span py:if="edit">
+	  &bull; <a href="${item.item_url('edit/')}">edit</a>
+	</span>
       </span>
       <!-- !to show a full tree, uncomment the following: -->
       <!-- ${show_tree(subs, edit)} -->

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2009-03-19 23:30:59 UTC (rev 202)
+++ servres/trunk/conifer/templates/master.xhtml	2009-03-20 00:01:31 UTC (rev 203)
@@ -44,7 +44,6 @@
 	<a href="/accounts/logout">Log Out</a>
 	&bull; <a href="/syrup/setlang">Language</a>
 	&bull; <a href="/syrup/prefs/">Preferences</a>
-	&bull; <a href="/admin/">Admin UI</a>
       </span>
       <span py:if="not user.is_authenticated()">
 	<strong style="padding-right: 18;">Welcome!</strong>



More information about the open-ils-commits mailing list