[open-ils-commits] r228 - 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 22:26:37 EDT 2009


Author: gfawcett
Date: 2009-03-25 22:26:35 -0400 (Wed, 25 Mar 2009)
New Revision: 228

Modified:
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/syrup/models.py
   servres/trunk/conifer/templates/components/course.xhtml
   servres/trunk/conifer/templates/item_metadata.xhtml
Log:
cleanup of item-metadata interface ('about' links)

Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2009-03-26 01:54:00 UTC (rev 227)
+++ servres/trunk/conifer/static/main.css	2009-03-26 02:26:35 UTC (rev 228)
@@ -241,13 +241,29 @@
     font-weight: normal; 
 }
 
+.metadata_table tbody th,
+.metadata_table tbody td {
+    padding: 8; border: #ddd 1px solid;
+}
+
+.metadata_table tbody th {
+    background-color: #eee;
+}
+   
+.metadata_table a.bigdownload { padding: 8 58; font-weight: bold; font-size: 105%; }
+
+h2.metadata_subhead {font-size: 105%; padding: 0; margin: 18 0 9 0;}
+
+.metadata_table tbody th {
+    text-align: left; width: 120;
+}
 .gap { height: 24; }
 
 /* panels that appear when specific OPTIONs or radio-buttons are selected. */
 .specific { padding: 8; margin: 0 16; background-color: #eef; }
 
 
-li.sort_item { margin-top: 20px !important;
+li.sort_item { margin-top: 20px} !important;
 	     border: gray 1px dotted; width: 400; }
 
 li.sort_item:hover { background-color: #eee; }

Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py	2009-03-26 01:54:00 UTC (rev 227)
+++ servres/trunk/conifer/syrup/models.py	2009-03-26 02:26:35 UTC (rev 228)
@@ -426,7 +426,7 @@
     def needs_meta_link(self):
         """Should an 'About' link be displayed for this item?"""
 
-        return self.item_type in ('ELEC', 'URL')
+        return self.item_type in ('ELEC', 'URL', 'PHYS')
 
     def item_url(self, suffix='', force_local_url=False):
         if self.item_type == 'ELEC' and suffix == '':

Modified: servres/trunk/conifer/templates/components/course.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/course.xhtml	2009-03-26 01:54:00 UTC (rev 227)
+++ servres/trunk/conifer/templates/components/course.xhtml	2009-03-26 02:26:35 UTC (rev 228)
@@ -38,7 +38,7 @@
 	  <!-- !I'm really sorry, this is ugly, but I want
 	       non-breaking spaces here, so that on long-named items,
 	       the links will stay togeter. A better way?  -->
-	  <span py:if="item.needs_meta_link()"><a href="${item.item_url('meta')}">about</a>&#160;</span><span py:if="edit">&bull;&#160;<a href="${item.item_url('edit/')}">edit</a></span><span py:if="edit">&#160;&bull;&#160;<a href="${item.item_url('relocate/')}">put under heading</a></span>
+	  <span py:if="item.needs_meta_link()"><a href="${item.item_url('meta')}">about</a>&#160;</span><span py:if="edit">&bull;&#160;<a href="${item.item_url('edit/')}">edit</a></span><span py:if="edit">&#160;&bull;&#160;<a href="${item.item_url('relocate/')}">put&#160;under&#160;heading</a></span>
 	</span>
       </div>
       <!-- !to show a full tree, uncomment the following: -->

Modified: servres/trunk/conifer/templates/item_metadata.xhtml
===================================================================
--- servres/trunk/conifer/templates/item_metadata.xhtml	2009-03-26 01:54:00 UTC (rev 227)
+++ servres/trunk/conifer/templates/item_metadata.xhtml	2009-03-26 02:26:35 UTC (rev 228)
@@ -2,6 +2,7 @@
 course_title = '%s: %s (%s)' % (course.code, course.title, course.term)
 hier = item.hierarchy()[:-1]
 title = item.title
+metadata = item.metadata_set.all()
 ?>
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xi="http://www.w3.org/2001/XInclude"
@@ -14,24 +15,26 @@
   <body>
     ${course_banner(course)}
     ${nested_title(item)}
-
-    <table>
+    <table class="metadata_table" style="margin-top: 1em;">
       <tr><th>Title</th><td>${item.title}</td></tr>
-      <tr><th>Type</th><td>${item.item_type}</td></tr>
+      <tr><th>Type</th><td>${item.get_item_type_display()}</td></tr>
       <tr py:if="item.url"><th>URL</th><td><a href="${item.url}">${item.url}</a></td></tr>
     </table>
     <div py:if="item.item_type=='ELEC'">
-    <p><a href="${item.item_url()}">Download</a></p>
-    <table>
+    <h2 class="metadata_subhead">Attached document</h2>
+    <table class="metadata_table">
     <tr><th>Content type</th><td>${item.fileobj_mimetype}</td></tr>
-    <tr><th>Content length</th><td>${item.fileobj.size}</td></tr>
+    <tr><th>Size</th><td>${item.fileobj.size} bytes</td></tr>
+    <tr><th/><td><a class="bigdownload" href="${item.item_url()}">Download</a></td></tr>
     </table>
     </div>
-
-    <table>
-      <tr py:for="attr in item.metadata_set.all()">
-	<th>${attr.get_name_display()}</th><td>${attr.value}</td>
-      </tr>
-    </table>
+    <div py:if="metadata">
+      <h2 class="metadata_subhead">Additional metadata</h2>
+      <table class="metadata_table">
+	<tr py:for="attr in metadata">
+	  <th>${attr.get_name_display()}</th><td>${attr.value}</td>
+	</tr>
+      </table>
+      </div>
   </body>
 </html>



More information about the open-ils-commits mailing list