minor UI tweaks; attachment-links now open directly
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 27 Jan 2009 02:28:30 +0000 (02:28 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 27 Jan 2009 02:28:30 +0000 (02:28 +0000)
(rather than having to click on the About page and then click on
'download')

git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@121 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/genshi_namespace.py
conifer/static/main.css
conifer/static/tango/view_detailed.png [new file with mode: 0644]
conifer/static/tango/x-office-address-book.png
conifer/syrup/models.py
conifer/syrup/urls.py
conifer/syrup/views.py
conifer/templates/components/item.xhtml
conifer/templates/item_metadata.xhtml
conifer/templates/master.xhtml
conifer/templates/simplemessage.xhtml [new file with mode: 0644]

index 3bd545d..75bbaf7 100644 (file)
@@ -11,11 +11,18 @@ from conifer.syrup import models
 # 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)
 
index 3e9d2a1..c2430fb 100644 (file)
@@ -122,6 +122,11 @@ a:hover {  text-decoration: underline;  }
     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;
diff --git a/conifer/static/tango/view_detailed.png b/conifer/static/tango/view_detailed.png
new file mode 100644 (file)
index 0000000..4fea77a
Binary files /dev/null and b/conifer/static/tango/view_detailed.png differ
index f3b5d9d..039391a 100644 (file)
Binary files a/conifer/static/tango/x-office-address-book.png and b/conifer/static/tango/x-office-address-book.png differ
index 8642479..8dd5549 100644 (file)
@@ -329,7 +329,7 @@ class Item(m.Model):
     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')
 
 #------------------------------------------------------------
 
index 3cff76f..8eefdb3 100644 (file)
@@ -11,7 +11,7 @@ urlpatterns = patterns('conifer.syrup.views',
     (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'),
index a5f5b84..bb6f581 100644 (file)
@@ -76,8 +76,10 @@ def instructors(request):
                     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...
index 6b93494..d1355fc 100644 (file)
@@ -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>
index ece8add..0be6ca4 100644 (file)
@@ -25,7 +25,7 @@ title = item.title
       <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>
index 74f0ec4..e6878ea 100644 (file)
@@ -40,7 +40,7 @@ app_name = 'Syrup E-Reserve System'
       <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()">
diff --git a/conifer/templates/simplemessage.xhtml b/conifer/templates/simplemessage.xhtml
new file mode 100644 (file)
index 0000000..8fe83c4
--- /dev/null
@@ -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>