various tweaks. Permissions fix; moving around some admin links.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 20 Mar 2009 00:01:31 +0000 (00:01 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 20 Mar 2009 00:01:31 +0000 (00:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@203 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/views.py
conifer/templates/admin/index.xhtml
conifer/templates/components/course.xhtml
conifer/templates/master.xhtml

index df9e3ce..dcaa316 100644 (file)
@@ -149,6 +149,10 @@ def members_only(handler):
     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)
index d5ff32c..ff7df8a 100644 (file)
@@ -11,6 +11,10 @@ title = _('Administrative Options')
 <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>
index 5e0abda..7e5ed18 100644 (file)
@@ -33,8 +33,10 @@ searchtext = _('search this course...')
       <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)} -->
index d930660..d0853fa 100644 (file)
@@ -44,7 +44,6 @@ search = _('search...')
        <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>