[open-ils-commits] r1029 - in servres/trunk/conifer: static syrup/views templates (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Oct 2 15:58:02 EDT 2010


Author: gfawcett
Date: 2010-10-02 15:57:57 -0400 (Sat, 02 Oct 2010)
New Revision: 1029

Modified:
   servres/trunk/conifer/static/main.css
   servres/trunk/conifer/syrup/views/general.py
   servres/trunk/conifer/templates/browse_index.xhtml
   servres/trunk/conifer/templates/master.xhtml
   servres/trunk/conifer/templates/prefs.xhtml
Log:
UI tweaks

Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css	2010-10-02 19:57:54 UTC (rev 1028)
+++ servres/trunk/conifer/static/main.css	2010-10-02 19:57:57 UTC (rev 1029)
@@ -184,7 +184,7 @@
 .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 @@
     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; }
 

Modified: servres/trunk/conifer/syrup/views/general.py
===================================================================
--- servres/trunk/conifer/syrup/views/general.py	2010-10-02 19:57:54 UTC (rev 1028)
+++ servres/trunk/conifer/syrup/views/general.py	2010-10-02 19:57:57 UTC (rev 1029)
@@ -5,7 +5,11 @@
 #-----------------------------------------------------------------------------
 
 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):

Modified: servres/trunk/conifer/templates/browse_index.xhtml
===================================================================
--- servres/trunk/conifer/templates/browse_index.xhtml	2010-10-02 19:57:54 UTC (rev 1028)
+++ servres/trunk/conifer/templates/browse_index.xhtml	2010-10-02 19:57:57 UTC (rev 1029)
@@ -12,21 +12,29 @@
   <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>

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2010-10-02 19:57:54 UTC (rev 1028)
+++ servres/trunk/conifer/templates/master.xhtml	2010-10-02 19:57:57 UTC (rev 1029)
@@ -58,7 +58,9 @@
       <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"/>

Modified: servres/trunk/conifer/templates/prefs.xhtml
===================================================================
--- servres/trunk/conifer/templates/prefs.xhtml	2010-10-02 19:57:54 UTC (rev 1028)
+++ servres/trunk/conifer/templates/prefs.xhtml	2010-10-02 19:57:57 UTC (rev 1029)
@@ -11,6 +11,7 @@
 </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 @@
 	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">



More information about the open-ils-commits mailing list