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

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Mar 25 21:36:14 EDT 2009


Author: gfawcett
Date: 2009-03-25 21:36:13 -0400 (Wed, 25 Mar 2009)
New Revision: 226

Modified:
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/components/course.xhtml
   servres/trunk/conifer/templates/course_detail.xhtml
Log:
more visual tweaks. It's looking pretty good IMHO.

Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2009-03-26 01:01:24 UTC (rev 225)
+++ servres/trunk/conifer/static/main.css	2009-03-26 01:36:13 UTC (rev 226)
@@ -137,22 +137,27 @@
 }
 .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 @@
     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; }

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-03-26 01:01:24 UTC (rev 225)
+++ servres/trunk/conifer/syrup/views.py	2009-03-26 01:36:13 UTC (rev 226)
@@ -156,14 +156,18 @@
         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

Modified: servres/trunk/conifer/templates/components/course.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/course.xhtml	2009-03-26 01:01:24 UTC (rev 225)
+++ servres/trunk/conifer/templates/components/course.xhtml	2009-03-26 01:36:13 UTC (rev 226)
@@ -31,8 +31,9 @@
       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 @@
 	  &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 @@
    </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>

Modified: servres/trunk/conifer/templates/course_detail.xhtml
===================================================================
--- servres/trunk/conifer/templates/course_detail.xhtml	2009-03-26 01:01:24 UTC (rev 225)
+++ servres/trunk/conifer/templates/course_detail.xhtml	2009-03-26 01:36:13 UTC (rev 226)
@@ -17,10 +17,13 @@
     <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>
 



More information about the open-ils-commits mailing list