From 393ba068af3b8da8b90e433cf32900a5ede02c0b Mon Sep 17 00:00:00 2001 From: gfawcett Date: Tue, 27 Jan 2009 02:28:30 +0000 Subject: [PATCH] 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 --- conifer/genshi_namespace.py | 7 +++++++ conifer/static/main.css | 5 +++++ conifer/static/tango/view_detailed.png | Bin 0 -> 597 bytes conifer/static/tango/x-office-address-book.png | Bin 753 -> 757 bytes conifer/syrup/models.py | 2 +- conifer/syrup/urls.py | 2 +- conifer/syrup/views.py | 6 ++++-- conifer/templates/components/item.xhtml | 4 ++-- conifer/templates/item_metadata.xhtml | 2 +- conifer/templates/master.xhtml | 2 +- conifer/templates/simplemessage.xhtml | 12 ++++++++++++ 11 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 conifer/static/tango/view_detailed.png create mode 100644 conifer/templates/simplemessage.xhtml 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 0000000000000000000000000000000000000000..4fea77a1498bad4738fd6b3f97fd3cbb0958feb8 GIT binary patch literal 597 zcmV-b0;>IqP)?V;sdxNapB5^J_9TF8ptFD zGcmHz2|~C(eY<{K^vq>I5*OB{sycnD&pFlEvo}BXR+pDHT#VQ#ZKJfcq#Tq`McQ!v zT!Nx)jW)lh`P!ZS`>l^|V1Vdj__sws;Yho3TfxC7wzlyI;|IM~DM=`CRIz*n`CyQKlR;nhz7 z>Z;_+=MzSw9o%6&9$ynQ$r*qb5v0=R1FnPSq*c?%`s0u@%%E9A0A)49#1ZiR*)b_8&lm1+6pnG jUPa-C-`{@){yY8vGLOG$Q0rsm00000NkvXXu0mjf6Cwmo literal 0 HcmV?d00001 diff --git a/conifer/static/tango/x-office-address-book.png b/conifer/static/tango/x-office-address-book.png index f3b5d9d98cb0ba5a7dfdcc80a0762896f8426b88..039391a701a098bfb32953b89b5aa26df81be022 100644 GIT binary patch delta 624 zcmV-$0+0Ri1@#4xBnkm@Qb$4nuFf3kks&Y&*#R2?H8HWUw$hPXM1M3%L_t(I%Z-!C zYE(fOg})zW#(rqR|0-~;5NI(Sf85AOJ)Zog63tvFYqBSl=pTbSZKIj`LxDc{& zh$M;{FhtDIp@%!vFIp;jK z(2Up0bTUm~EiTOnb4^}Y!aPT}Q)-nMoj0kCPqX`X@udWa<5+rNyV=G%M|)$Npq!wS z1d}L=K%xNxi3iGYF|Z^7l0*TXH0y1sSdm+Y3MBPv2@hl*+<#sjB0T_v08t#_tQ#zP z>qsgAtyYGJLngR_s)1)`rvpHiD6I3xTfl=-A@zEdOdBqo9V5*Q2pD1C z+2~MdFh2xncT!%zc}FNc&i95f9w7yh3J^jd0Baq;es8+d-In~mybN$V1o-sv8&@w@ zkW&1&2c(pAMV*zcLav>=#FhTTLV#ww!}*CJCMVAvIZfD0sHZQh>&MpM*@xB5hDp0_ zeY22BqA=PV3}yd+SjY6`F~7L9DGuf)XJ+T0oV1fdHm=>7=}i6gAUnLjE(X>jmiN-Po%vy2U#+drva&iD8v1}&UKj}VTJlH4p)yLu5FbwG%LTW)_z z@njKhuQz)Dg8>7%3n>6hHch>)Nq*l&HCl9SMfK*yxf9h>U_dF0bUK0G(d38YB%=;o zAM5K%4QTue;5AyjS$>Np4Wa2Rtqnp7Y!yKWfdIPQkgw%xm~S4*&+F>|Pc48Ct6SW^ z5$})fc_F2wDbj502XcG-7I%-uSO8XsUW19;5QV~}Gl}9<0oOKn&aJ`x`_1Z%ZZ*T5 zY9L)#p*woO@E?TkhD_ecn5C7fINdinRa}_;&+p9Qt7!r78*{tc*=oLQ{{R3007*qo IM6N<$g7T{+5&!@I 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} + + -- 2.11.0
    Content type${item.fileobj_mimetype}
    Content length${item.fileobj.size}