Small clean up - spacing and some comments
authorArt Rhyno <art632000@yahoo.ca>
Mon, 14 Apr 2014 22:13:40 +0000 (18:13 -0400)
committerArt Rhyno <art632000@yahoo.ca>
Mon, 14 Apr 2014 22:13:40 +0000 (18:13 -0400)
Slowly clearing out tabs in the templates. Also added a comment
about the memoize decorator.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
conifer/integration/evergreen_site.py
conifer/templates/components/site.xhtml

index 1b30ac9..dd08f8e 100644 (file)
@@ -183,8 +183,14 @@ class EvergreenIntegration(object):
         idlist = make_obj_string(ids)
         return self._item_status(item.bib_id, item.barcode, bclist, idlist)
 
-    #in general, you want to cache this for a few minutes
-    #but bump this value to 0 or something low for debugging
+    """
+    in general, you want to cache this for a few minutes
+    but bump this value to 0 or something low for debugging
+    the count is in seconds, default is 2
+
+    see: http://code.activestate.com/recipes/325905/
+    """
+
     CACHE_TIME = 300
 
     @memoize(timeout=CACHE_TIME)
index 9e31b3e..bb48b28 100644 (file)
@@ -145,32 +145,33 @@ searchtext = _('search this site...')
         </span>
       </div>
       </span>
-      <div class="author_pub" py:if="item.author or item.publisher or item.published">
+      <div class="author_pub" py:if="item.author or item.publisher or item.published or (edit and user.is_staff)">
        <span py:with="vt=item.video_type()"><span class="videotype" py:if="vt">[${vt}]</span></span>
-               <span py:if="item.author">${item.author}<span py:if="item.author[-1]!='.'">.</span></span>
-               <span py:if="item.published">(${item.published}).</span>
-               <span py:if="item.source_title"><i>${item.source_title}.</i></span>
-               <span py:if="item.volume or item.issue"><i>${item.volume}</i>(${item.issue}), ${item.pages}.</span>
-                 <div py:if="edit and user.is_staff">
+       <span py:if="item.author">${item.author}<span py:if="item.author[-1]!='.'">.</span></span>
+       <span py:if="item.published">(${item.published}).</span>
+       <span py:if="item.source_title"><i>${item.source_title}.</i></span>
+       <span py:if="item.volume or item.issue"><i>${item.volume}</i>(${item.issue}), ${item.pages}.</span>
+       <div py:if="edit and user.is_staff">
             <span><i>Revert Parms: </i></span>
-                   <span py:for="k,v in item.CALLNO_PREFIX_CHOICES">
+            <span py:for="k,v in item.CALLNO_PREFIX_CHOICES">
                 <span py:if="int(item.orig_prefix)==int(k)">
-                   ${v} 
+                    ${v} 
                 </span>
             </span>
-                   <span py:if="item.orig_callno">${item.orig_callno}</span>
-                   <span py:for="k,v in item.CALLNO_SUFFIX_CHOICES">
+           <span py:if="item.orig_callno">${item.orig_callno}</span>
+           <span py:for="k,v in item.CALLNO_SUFFIX_CHOICES">
                 <span py:if="int(item.orig_suffix)==int(k)">
-                   ${v} 
+                    ${v} 
                 </span>
             </span>
-                   <span py:if="item.circ_modifier">(${item.circ_modifier}) </span>
-                   <span py:for="k,v in item.CIRC_DESK_CHOICES">
+            <span py:if="item.circ_modifier">(${item.circ_modifier}) </span>
+            <span py:for="k,v in item.CIRC_DESK_CHOICES">
                 <span py:if="item.circ_desk==k">
-                   ${v} 
+                    ${v} 
                 </span>
             </span>
-                 </div>
+                
+        </div>
       </div>
       <div class="forbidden_notice" py:if="forbidden">Awaiting copyright clearance: Not available to students.</div>
          <div>