UI tweaks
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 2 Oct 2010 19:57:57 +0000 (19:57 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 2 Oct 2010 19:57:57 +0000 (19:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1029 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/static/main.css
conifer/syrup/views/general.py
conifer/templates/browse_index.xhtml
conifer/templates/master.xhtml
conifer/templates/prefs.xhtml

index 18ebded..9986e53 100644 (file)
@@ -184,7 +184,7 @@ span.final_item { font-weight: bold; font-size: 110%; }
 .itemtree li { margin: 12px 8px; line-height: 115%; }
 .itemtree li .mainline { padding-left: 8px; }
 
-.itemtree li .author_pub { padding-left: 8px; font-size: 90%; margin: 4px 0 4px 0; color: #111; }
+.itemtree li .author_pub { padding-left: 8px; font-size: 90%; margin: 2px 0; color: #111; }
 
 .itemtree .metalink { padding-left: 8px; color: gray; }
 .itemtree .metalink a {
@@ -286,7 +286,7 @@ p.todo, div.todo { background-color: #fdd; padding: 6px; margin: 12px; border-le
     font-size: 80%; color: navy;
 }
 
-.menublock { color: #da9; font-size: 80%; }
+.menublock { color: #da9; font-size: 80%; margin: 1px 0; }
 .menublock a { color: #666; padding: 0 8px;  }
 .menublock a:hover { color: blue; }
 
index e350a57..d4fd6a3 100644 (file)
@@ -5,7 +5,11 @@ from search  import *
 #-----------------------------------------------------------------------------
 
 def welcome(request):
-    return HttpResponseRedirect('browse/')
+    user = request.user
+    if user.is_authenticated() and user.sites():
+        return HttpResponseRedirect('site/') # My Sites
+    else:
+        return HttpResponseRedirect('browse/')
 
 # MARK: propose we get rid of this. We already have a 'Sites' browser.
 def open_sites(request):
index 6bdab46..3820921 100644 (file)
@@ -12,21 +12,29 @@ blocks = itertools.groupby(sites, lambda s: s.course.department)
   <title>${title}</title>
 </head>
 <body>
-  <h1>${title}</h1> 
+  <h1>${title}</h1>
   <div py:if="user.is_anonymous()">
     (Note: some reserve materials may require you
     to <a href="${ROOT}${settings.LOGIN_URL}?next=${ROOT}/">log in</a>)
   </div>
-
-    
-    <div py:for="(dept, ss) in blocks">
-      <h2>${dept}</h2>
-      <p py:for="site in ss" style="margin-left: 16px;">
-       <a href="${site.site_url()}">${site}</a>
+  
+  <img py:def="lock(condition=True)" 
+          py:if="condition"
+          src="${ROOT}/static/tango/lock.png"
+          alt="lock" title="This resource is access-controlled."/>
+  
+  <div py:for="(dept, ss) in blocks">
+       <h2>${dept}</h2>
+       <div py:for="site in ss">
+         <span py:if="not site.is_open_to(request.user)" style="float: left;">
+               ${lock()}
+         </span>
+         <p style="margin-left: 26px;">
+               
+               <a href="${site.site_url()}">${site}</a>
       </p>
-
-    </div>
-
+       </div>
+  </div>
   <div class="gap"/>
 </body>
 </html>
index 3a1ddb2..df2c525 100644 (file)
@@ -58,7 +58,9 @@ import os
       <div id="welcome" py:if="not user.is_authenticated()">
        <strong style="padding-right: 18px;">Welcome!</strong>
        <a class="loginbutton" href="${ROOT}${settings.LOGIN_URL}">Log In</a>
-       &bull; <a href="${ROOT}/prefs/">Preferences</a>
+       <span py:if="settings.USE_I18N">
+         &bull; <a href="${ROOT}/prefs/">Preferences</a>
+       </span>
       </div>
     </div>
       <xi:include py:if="user.is_authenticated()" href="tabbar.xhtml"/>
index dc1e6aa..99c2ab3 100644 (file)
@@ -11,6 +11,7 @@ title = _('Preferences')
 </head>
 <body>
 <h1>${title}</h1>
+<div py:if="settings.USE_I18N">
 <h2>Preferred Language</h2>
 <form action="../i18n/setlang/" method="post">
 <input name="next" type="hidden" value="${ROOT}/" />
@@ -19,6 +20,7 @@ title = _('Preferences')
        value="${code}">${_(descr)}</option>
 </select> <input type="submit" value="Change" />
 </form>
+</div>
 <div py:if="user.is_authenticated()">
   <h2>Notification preferences</h2>
   <form action="." method="POST">