more visual tweaks. It's looking pretty good IMHO.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 26 Mar 2009 01:36:13 +0000 (01:36 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 26 Mar 2009 01:36:13 +0000 (01:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@226 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/static/main.css
conifer/syrup/views.py
conifer/templates/components/course.xhtml
conifer/templates/course_detail.xhtml

index c1b0038..d2e75c7 100644 (file)
@@ -137,22 +137,27 @@ padding-left: 15;
 }
 .itemadd a { color: navy; }
 
+.itemtree li .mainline { margin-left: 24; }
 
 /* specialized display of items in tree, by type */
 
 .itemtree li.item_HEADING { 
     list-style-image: url(tango/folder.png);
-    margin-top: 4;
+    margin: 9 0; 
 }
 .itemtree li.item_HEADING > a { 
     color: navy; 
 }
 
-li.item_HEADING > a.mainlink {
+li.item_HEADING > .mainline {
+    margin-bottom: 12;
+}
+
+li.item_HEADING > div.mainline  a.mainlink {
     border-bottom: #aaa 1px solid; 
 }
 
-li.item_HEADING > a.mainlink:hover {
+li.item_HEADING > .mainline a.mainlink:hover {
     border-bottom: none;
 }
 
@@ -207,7 +212,7 @@ p.todo, div.todo { background-color: #fdd; padding: 6; margin: 12; border-left:
     font-size: 80%; color: navy;
 }
 
-.menublockopener { margin-left: 0.25em; color: #aaa !important; font-weight: normal !important; }
+.menublockopener { margin-left: 0.25em; color: #bbb !important; font-weight: normal !important; }
 .menublock { background-color: #f0f0e0; font-size: 95%; padding: 1 4; }
 
 #coursebanner { background-color: #f2e4cc; margin: -12 -12 0 -12; padding: 8; }
index 03b2cff..ed279fb 100644 (file)
@@ -156,14 +156,18 @@ def members_only(handler):
         allowed = user.is_superuser
         if not allowed:
             course = models.Course.objects.get(pk=course_id)
-            allowed = ((user.is_anonymous and course.access=='ANON') or \
-                       (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(user.id, course_id)
         if allowed:
             return handler(request, course_id, *args, **kwargs)
         else:
-            return _access_denied(_('Only course members are allowed here.'))
+            if course.access=='LOGIN':
+                msg = _('Please log in, so that you can enter this site.')
+            else:
+                msg = _('Only course members are allowed here.')
+            return _access_denied(msg)
     return hdlr
 
 # decorator
index 353a486..b00eedf 100644 (file)
@@ -31,8 +31,9 @@ searchtext = _('search this course...')
       class="itemtree">
     <li py:for="item, subs in tree" class="item_${item.item_type} an_item"
        id="item_${item.id}">
-      <a href="${item.item_url()}" class="mainlink">${item}</a> 
-      <span class="menublock">
+      <div class="mainline">
+       <a href="${item.item_url()}" class="mainlink">${item}</a> 
+       <span class="menublock" py:if="not (item.item_type=='HEADING' and not edit)">
        <span py:if="item.needs_meta_link()">
        <a href="${item.item_url('meta')}">about</a> </span>
        <span py:if="edit">
@@ -42,6 +43,7 @@ searchtext = _('search this course...')
          &bull; <a href="${item.item_url('relocate/')}">put under heading</a>
        </span>
       </span>
+      </div>
       <!-- !to show a full tree, uncomment the following: -->
       ${show_tree(subs, edit)}
     </li>
@@ -109,9 +111,6 @@ searchtext = _('search this course...')
    </div>
 
    <div py:def="item_resequence_panel()" py:strip="True">
-    <div id="showtree_panel" class="little_action_panel">
-      <a href="javascript:doToggleItemTree();">Show/hide tree</a>
-    </div>
     <div id="resequence_panel" class="little_action_panel">
       <a href="javascript:doResequence();">Resequence items</a>
     </div>
index 8c99bb9..51054d9 100644 (file)
@@ -17,10 +17,13 @@ is_editor = course.can_edit(request.user)
     <p py:if="not item_tree">
       There are no items associated with this course yet.
     </p>
-    <div py:if="instructs(request.user, course)" id="edit_course" class="little_action_panel">
+    <div py:if="is_editor" id="edit_course" class="little_action_panel">
       <a href="${course.course_url()}edit/">Edit course details</a>
     </div>
-    ${item_resequence_panel()}
+    <div id="showtree_panel" class="little_action_panel">
+      <a href="javascript:doToggleItemTree();">Show/hide tree</a>
+    </div>
+    <div py:if="is_editor">${item_resequence_panel()}</div>
     ${show_tree(item_tree, edit=is_editor)}
     <div py:if="is_editor">${add_subs()}</div>