more CSS and display tweaks.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sun, 11 Jan 2009 21:55:49 +0000 (21:55 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sun, 11 Jan 2009 21:55:49 +0000 (21:55 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@106 6d9bc8c9-1ec2-4278-b937-99fde70a366f

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

index 6b968c5..8d0dd69 100644 (file)
@@ -77,7 +77,18 @@ a:hover {  text-decoration: underline;  }
 .pagetable thead th { font-size: smaller; text-align: left; padding: 2 8; }
 
 
-.itemtree { margin-left: 100; }
+/* nested titles: like breadcrumbs when drilling into an itemtree */
+
+.nestedtitle h2 { margin-top: 8; }
+.nestedtitle a { color: navy; }
+
+/* item trees (tree of headings and items in a course */
+
+.itemtree { 
+    margin-left: 100; 
+    list-style-type: none; 
+}
+
 .itemtree .itemtree { margin-left: 0;}
 
 .itemtree li { width: 400; }
@@ -88,7 +99,24 @@ a:hover {  text-decoration: underline;  }
                     }
 .itemtree .metalinks a { color: navy; }
 
-.itemadd { margin-left: 100; }
+.itemadd { 
+    margin-left: 100; /* should match .itemtree{margin-left} */
+}
+
+/* specialized display of items in tree, by type */
+
+.itemtree li.item_HEADING { 
+    margin-top: 4;
+}
+.itemtree li.item_HEADING > a { 
+    font-weight: bold; color: navy; 
+}
+
+.itemtree li.item_URL { 
+    list-style-type: square;   /* fixme, nice URL icon */
+    margin-top: 4;
+}
+
 
 .instructors {
   border: 1px solid #ccc;
@@ -119,5 +147,3 @@ p.todo, div.todo { background-color: #fdd; padding: 6; margin: 12; border-left:
 .newsitem { 
     max-width: 600;
 }
-
-.nestedtitle h2 { margin-top: 8; }
\ No newline at end of file
index 3ee61b9..710454a 100644 (file)
@@ -186,7 +186,7 @@ def item_add(request, course_id, item_id):
                     item_type='HEADING',
                     parent_heading=parent_item,
                     title=title,
-                    author=request.user.get_full_name(),
+                    author=request.user.get_full_name() or request.user,
                     activation_date=datetime.now(),
                     last_modified=datetime.now())
                 item.save()
@@ -203,7 +203,7 @@ def item_add(request, course_id, item_id):
                     item_type='URL',
                     parent_heading=parent_item,
                     title=title,
-                    author=request.user.get_full_name(),
+                    author=request.user.get_full_name() or request.user,
                     activation_date=datetime.now(),
                     last_modified=datetime.now(),
                     url = url)
index 28680a8..82bff2b 100644 (file)
@@ -5,12 +5,10 @@
 
   <!-- !show_tree: display a tree of items in a hierarchical style. -->
   <ul py:def="show_tree(tree)" py:if="tree" class="itemtree">
-    <li py:for="item, subs in tree">
+    <li py:for="item, subs in tree" class="item_${item.item_type}">
       <a href="/syrup/course/${item.course_id}/item/${item.id}/">${item}</a> 
       <span class="metalinks">
-       [<a href="${item_url(item)}meta/">about</a>
-       &bull; <a href="${item_url(item)}edit/">edit</a>
-       ]
+       [<a href="${item_url(item)}meta/">about</a>&nbsp;&bull;&nbsp;<a href="${item_url(item)}edit/">edit</a>]
       </span>
       ${show_tree(subs)}
     </li>