[open-ils-commits] r121 - in servres/trunk/conifer: . static static/tango syrup templates templates/components

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 26 21:28:31 EST 2009


Author: gfawcett
Date: 2009-01-26 21:28:30 -0500 (Mon, 26 Jan 2009)
New Revision: 121

Added:
   servres/trunk/conifer/static/tango/view_detailed.png
   servres/trunk/conifer/templates/simplemessage.xhtml
Modified:
   servres/trunk/conifer/genshi_namespace.py
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/static/tango/x-office-address-book.png
   servres/trunk/conifer/syrup/models.py
   servres/trunk/conifer/syrup/urls.py
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/components/item.xhtml
   servres/trunk/conifer/templates/item_metadata.xhtml
   servres/trunk/conifer/templates/master.xhtml
Log:
minor UI tweaks; attachment-links now open directly

(rather than having to click on the About page and then click on
'download')


Modified: servres/trunk/conifer/genshi_namespace.py
===================================================================
--- servres/trunk/conifer/genshi_namespace.py	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/genshi_namespace.py	2009-01-27 02:28:30 UTC (rev 121)
@@ -11,11 +11,18 @@
 # approach?
 
 def item_url(item, suffix=''):
+    if item.item_type == 'ELEC' and suffix == '':
+        return item_download_url(item)
     if item.item_type == 'URL' and suffix == '':
         return item.url
     else:
         return '/syrup/course/%d/item/%d/%s' % (item.course_id, item.id, suffix)
 
+def item_download_url(item):
+    assert item.item_type == 'ELEC'
+    return '/syrup/course/%d/item/%d/dl/%s' % (
+        item.course_id, item.id, item.fileobj.name.split('/')[-1])
+
 def course_url(course, suffix=''):
     return '/syrup/course/%d/%s' % (course.id, suffix)
 

Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/static/main.css	2009-01-27 02:28:30 UTC (rev 121)
@@ -122,6 +122,11 @@
     font-weight: bold; color: navy; 
 }
 
+.itemtree li.item_ELEC { 
+    list-style-image: url(tango/view_detailed.png);
+    margin-top: 4;
+}
+
 .itemtree li.item_URL { 
     list-style-image: url(tango/applications-internet.png);
     margin-top: 4;

Added: servres/trunk/conifer/static/tango/view_detailed.png
===================================================================
--- servres/trunk/conifer/static/tango/view_detailed.png	                        (rev 0)
+++ servres/trunk/conifer/static/tango/view_detailed.png	2009-01-27 02:28:30 UTC (rev 121)
@@ -0,0 +1,9 @@
+‰PNG
+
+   
+IHDR         óÿa   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIMEÔ%6NãUº  âIDATxÚ¥’ÍNTA…¿;ܹLÀÆè$D&Á%aé×¾ƒ¯â¸#qáÊ…>+÷È$31²Ð	B¸?}»~\ôÌe@Ö¦ª:}ªÏ9ÕÙ³7?öV——6\ŒØ(m£´µ¤”PEÚpý\‚¢m6¿§ùڝþû­•aN];MmÔ¥SUF]9Ufô2ÃÌi£a=ÇrÃ=@Ë×WŠáÖú
+Meuå”yÊýòz(`  ‘&œóí{΋m0QP•«:ʬh£#â˜:*Æۏ=òõì>àŸa昪)‹‡Ÿ2z¸àõ”p°G8ØÃëé-`ïÀWµ“»¥¸áÕO êªäËçF£Üa<_8=EÕ0³«Ùò}¯& ´MÉþþ£°³³{«w'÷™–ŠîB1XÅ=ÑT5Š¢?£nõÄÀéubžk¿©{Þ'3	ÞœÑ~x™È<‡kÝ«‹ ÅM¸;ù|˜àÓ£™‰—0ncfL&'×nn>AÕqgaý»‰`ÿácÎÏ«¿LŒQ	A˜ãò³ËÈ×ÓSC$$sTQ1T
+MY
+sÇÍ1O?ñü2’_¼O.V HSÝ
+Ú
+1¤^Eá†ßßþ;þ 2¿iPëcå    IEND®B`‚
\ No newline at end of file

Modified: servres/trunk/conifer/static/tango/x-office-address-book.png
===================================================================
--- servres/trunk/conifer/static/tango/x-office-address-book.png	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/static/tango/x-office-address-book.png	2009-01-27 02:28:30 UTC (rev 121)
@@ -1,16 +1,10 @@
 ‰PNG
 
    
-IHDR         óÿa   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIMEÕ
-*(¹dºÊ   5tEXtComment (c) 2004 Jakub Steiner
+IHDR         óÿa   sRGB ®Îé   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIMEÙ51±°¶Ò   5tEXtComment (c) 2004 Jakub Steiner
 
-Created with The GIMPÙ‹o  =IDAT8Ë•“MOSA†Ÿ™Þ¹÷öƒ¶`?PjbLŒ1&Æhü
-š`ܘâÂ…Á¤,Lü„=‘Ÿ`â„
-0V´T¡ -·íííôŽ‹b¡ÂBO2›™9ϼï9gÀTqa˜áßc~ñÕô,€˜*.̍H=óâùC<_ãµ:ZSóÚ H) Ç™
-? ^YæÙ½"©ìäK˜yüèA†FvƒÙTŒò>ÊCå=T«M¨"x£Z™ù‘8u •¤¶·ôÚpGààÐ#s¡Þ$]ªP»2JˆaùmR¥
-]‘81'è{± \W†–ß;_*ÔDzD‚¹Õ-ŒüºV ùmÆóDíÎ ÀvlÂnØ߇íBŽÌZ‰z!GâÇ>ÚµQM€wŸ|:jƒ+1$€­æT¡
-F¤îb"稉ŽÚgÚ!„€9!Ä]TÃÇê½n+’Û?©_Î÷ø$-œDŽ’Ü,S»zu@ˆ[nIñdn¯7{ ƒ¹) L6M½­I~ßE5ZtmEõæĹÕS`@)‹t:ßÑä‡ã$£\ëëJ
-hüà5Z¼Y~‹%
-¡é-­
-B
-lA ºÝ¯åj˜oÉÏëë O-€«[Ü¿ïíy!¥¤)Òlìr{üwÅX ‡^ƒ‰Ü…Â¥3‰âT×6wέÁüûÍêŒn5Ýj ]W¡;zÀð„î†LÞɘ¥•ª8Ý79U\˜ýÏïÌâ«iðs»ÛÙj¾lÿ    IEND®B`‚
\ No newline at end of file
+Created with The GIMPÙ‹o  4IDAT8ˍ“ÉjTA…¿ª{ëÞÛCÒm&A¢®\H@ñ"nÔàÊ…_@Ì¢5.DŸÂMÈ>è(¸²qˆ$Š0DÌС‡;Ôä¢;„Dȁ‚¢ŠúªÎê 3³ós@ƒ¨”D8ç^¼zzç1€˜™Ÿ‘¦ñàþuÚ™¡j
+cø³ÑDJAT˜(‹“‚îÖ[îN=¤6>ýH›7®9ç<¶ÐŒ×Êt2M`-.ÍsM^XÂ<G·Sj•7©O³ûwñ¥ˆãXz`»ÙÆ:G{c› œ ““(Š@¢‰Êq1°$’Dž4ëm¨X‘[‡
+$õj	dÜ^"= „ Qá¬,zëH*­V†ˆC&džI‹‚ÝVÀû¯Z­ðy©Ü(EjsD` ]XJ¥/%?Ö6ÐÆR:’J „ <‚÷k´$qˆR1ª,Rà¨ì«GqD„§Ä#På˜SÕ„íV
+@òSqk¦–»=€Çƒ‡‰ÑZÿAW[ªgg§@–(¬óÇ[ÀƒR!õz•L.œ#ÍaßÙèPi0?hwR^¿yG(=Î÷†1!‘
+B  k¿~oºÓÝ–ü¾¼p;øôñW/VRü·¤”tE•­B®»Ä•þÃB€f»Ãù‰!&'Ï9ØK¨§/«ëÇÖàÙ‡Õ͆I»n}³I¢0ÚeÿXÇôå1¿¸´)æ&gf矜´÷´ðüž ø‘åëe2݆    IEND®B`‚
\ No newline at end of file

Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/syrup/models.py	2009-01-27 02:28:30 UTC (rev 121)
@@ -329,7 +329,7 @@
     def needs_meta_link(self):
         """Should an 'About' link be displayed for this item?"""
 
-        return self.item_type == 'URL'
+        return self.item_type in ('ELEC', 'URL')
 
 #------------------------------------------------------------
 

Modified: servres/trunk/conifer/syrup/urls.py
===================================================================
--- servres/trunk/conifer/syrup/urls.py	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/syrup/urls.py	2009-01-27 02:28:30 UTC (rev 121)
@@ -11,7 +11,7 @@
     (r'^course/$', 'my_courses'),
     (r'^browse/$', 'browse_courses'),
     (r'^browse/(?P<browse_option>.*)/$', 'browse_courses'),
-    (r'^join/$', 'join_course'),
+    (r'^prefs/$', 'user_prefs'),
     (r'^opencourse/$', 'open_courses'),
     (r'^search/$', 'search'),
     (r'^instructors/$', 'instructors'),

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/syrup/views.py	2009-01-27 02:28:30 UTC (rev 121)
@@ -76,8 +76,10 @@
                     page_num=page_num,
                     count=count)
 
-def join_course(request):
-    return g.render('join_course.xhtml')
+def user_prefs(request):
+    return g.render('simplemessage.xhtml',
+                    title='Sorry...', 
+                    content='The Preferences page isn\'t ready yet.')
 
 def browse_courses(request, browse_option=''):
     #the defaults should be moved into a config file or something...

Modified: servres/trunk/conifer/templates/components/item.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/item.xhtml	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/templates/components/item.xhtml	2009-01-27 02:28:30 UTC (rev 121)
@@ -8,10 +8,10 @@
     <li py:for="item, subs in tree" class="item_${item.item_type}">
       <a href="${item_url(item)}">${item}</a> 
       <span py:if="item.needs_meta_link()" class="metalink">
-	[<a href="${item_url(item)}meta/">about</a>]
+	[<a href="${item_url(item, 'meta/')}">about</a>]
       </span>
       <span class="editlinks" py:if="edit">
-	[<a href="${item_url(item)}edit/">edit</a>]
+	[<a href="${item_url(item, 'edit/')}">edit</a>]
       </span>
       ${show_tree(subs, edit)}
     </li>

Modified: servres/trunk/conifer/templates/item_metadata.xhtml
===================================================================
--- servres/trunk/conifer/templates/item_metadata.xhtml	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/templates/item_metadata.xhtml	2009-01-27 02:28:30 UTC (rev 121)
@@ -25,7 +25,7 @@
       <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_url(item)}dl/${item.fileobj.name.split('/')[-1]}">Download</a></p>
+    <p><a href="${item_download_url(item)}">Download</a></p>
     <table>
     <tr><th>Content type</th><td>${item.fileobj_mimetype}</td></tr>
     <tr><th>Content length</th><td>${item.fileobj.size}</td></tr>

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2009-01-26 18:43:17 UTC (rev 120)
+++ servres/trunk/conifer/templates/master.xhtml	2009-01-27 02:28:30 UTC (rev 121)
@@ -40,7 +40,7 @@
       <span py:if="user.is_authenticated()">
 	<strong style="padding-right: 18;">Welcome, ${user.first_name or user.username}!</strong>
 	<a href="/accounts/logout">Log Out</a>
-	&bull; <a href="/user/prefs">Preferences</a>
+	&bull; <a href="/syrup/prefs/">Preferences</a>
 	&bull; <a href="/admin/">Admin UI</a>
       </span>
       <span py:if="not user.is_authenticated()">

Added: servres/trunk/conifer/templates/simplemessage.xhtml
===================================================================
--- servres/trunk/conifer/templates/simplemessage.xhtml	                        (rev 0)
+++ servres/trunk/conifer/templates/simplemessage.xhtml	2009-01-27 02:28:30 UTC (rev 121)
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      xmlns:py="http://genshi.edgewall.org/">
+<xi:include href="master.xhtml"/>
+<head>
+  <title>${title}</title>
+</head>
+<body>
+  <h1>${title}</h1>
+  ${content}
+</body>
+</html>



More information about the open-ils-commits mailing list