From: gfawcett Date: Tue, 27 Jan 2009 02:28:30 +0000 (+0000) Subject: minor UI tweaks; attachment-links now open directly X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=393ba068af3b8da8b90e433cf32900a5ede02c0b;p=Syrup.git minor UI tweaks; attachment-links now open directly (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 --- diff --git a/conifer/genshi_namespace.py b/conifer/genshi_namespace.py index 3bd545d..75bbaf7 100644 --- a/conifer/genshi_namespace.py +++ b/conifer/genshi_namespace.py @@ -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) diff --git a/conifer/static/main.css b/conifer/static/main.css index 3e9d2a1..c2430fb 100644 --- a/conifer/static/main.css +++ b/conifer/static/main.css @@ -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 index 0000000..4fea77a Binary files /dev/null and b/conifer/static/tango/view_detailed.png differ diff --git a/conifer/static/tango/x-office-address-book.png b/conifer/static/tango/x-office-address-book.png index f3b5d9d..039391a 100644 Binary files a/conifer/static/tango/x-office-address-book.png and b/conifer/static/tango/x-office-address-book.png differ diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index 8642479..8dd5549 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -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') #------------------------------------------------------------ diff --git a/conifer/syrup/urls.py b/conifer/syrup/urls.py index 3cff76f..8eefdb3 100644 --- a/conifer/syrup/urls.py +++ b/conifer/syrup/urls.py @@ -11,7 +11,7 @@ urlpatterns = patterns('conifer.syrup.views', (r'^course/$', 'my_courses'), (r'^browse/$', 'browse_courses'), (r'^browse/(?P.*)/$', 'browse_courses'), - (r'^join/$', 'join_course'), + (r'^prefs/$', 'user_prefs'), (r'^opencourse/$', 'open_courses'), (r'^search/$', 'search'), (r'^instructors/$', 'instructors'), diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index a5f5b84..bb6f581 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -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... diff --git a/conifer/templates/components/item.xhtml b/conifer/templates/components/item.xhtml index 6b93494..d1355fc 100644 --- a/conifer/templates/components/item.xhtml +++ b/conifer/templates/components/item.xhtml @@ -8,10 +8,10 @@
  • ${item} - [about] + [about] - [edit] + [edit] ${show_tree(subs, edit)}
  • diff --git a/conifer/templates/item_metadata.xhtml b/conifer/templates/item_metadata.xhtml index ece8add..0be6ca4 100644 --- a/conifer/templates/item_metadata.xhtml +++ b/conifer/templates/item_metadata.xhtml @@ -25,7 +25,7 @@ title = item.title URL${item.url}
    -

    Download

    +

    Download

    diff --git a/conifer/templates/master.xhtml b/conifer/templates/master.xhtml index 74f0ec4..e6878ea 100644 --- a/conifer/templates/master.xhtml +++ b/conifer/templates/master.xhtml @@ -40,7 +40,7 @@ app_name = 'Syrup E-Reserve System' Welcome, ${user.first_name or user.username}! Log Out - • Preferences + • PreferencesAdmin UI diff --git a/conifer/templates/simplemessage.xhtml b/conifer/templates/simplemessage.xhtml new file mode 100644 index 0000000..8fe83c4 --- /dev/null +++ b/conifer/templates/simplemessage.xhtml @@ -0,0 +1,12 @@ + + + + ${title} + + +

    ${title}

    + ${content} + +
    Content type${item.fileobj_mimetype}
    Content length${item.fileobj.size}