[zopeorg-checkins] CVS: Products/ZopeOrg-NV/skins/nzo - login_slot.pt:1.3

Brian Lloyd brian at zope.com
Fri Jul 18 16:09:10 EDT 2003


Update of /cvs-zopeorg/Products/ZopeOrg-NV/skins/nzo
In directory cvs.zope.org:/tmp/cvs-serv27017

Modified Files:
	login_slot.pt 
Log Message:
Fix cachability by using javascript


=== Products/ZopeOrg-NV/skins/nzo/login_slot.pt 1.2 => 1.3 ===
         
             <div class="content odd">
                 <form action="logged_in"
+	              id="login_box_form"
                       method="post"
                       tal:attributes="action string:$portal_url/logged_in">
     
-                    <input type="hidden" name="came_from" value=""
-                           tal:condition="python:request.get('came_from', '')"
-                           tal:attributes="value request/came_from;
-                                           tabindex tabindex/next" />
-    
+ 
                     <strong i18n:translate="label_user_name">Name</strong> <br />
                     <input type="text" name="__ac_name" size="12"
-                           tal:attributes="value python:request.get('__ac_name', ''); tabindex tabindex/next" alt="Username" title="Username" i18n:attributes="alt" />
+                           tal:attributes="tabindex tabindex/next" alt="Username" title="Username" i18n:attributes="alt" />
     
                     <br />
     
@@ -48,7 +45,37 @@
                            value="Log in" 
                            tal:attributes="tabindex tabindex/next"
                            i18n:attributes="value"/>
+
+                   <input type="hidden" name="came_from" value=""
+                           tal:condition="python:request.get('came_from', '')"
+                           tal:attributes="value request/came_from;
+                                           tabindex tabindex/next" />
+    
                 </form>
+<script language="javascript"><!--
+
+function getCookie(cname) {
+  var search = cname + "="
+  if (document.cookie.length > 0) {
+    offset = document.cookie.indexOf(search);
+    if (offset != -1) {
+      offset += search.length;
+      end = document.cookie.indexOf(";", offset);
+      if (end == -1){
+          end = document.cookie.length;
+      }
+      var value = unescape(document.cookie.substring(offset, end));
+      if (value.charAt(0) == '"' && value.charAt(value.length -1) == '"') {
+        value = value.substring(1, value.length -1);
+      }
+      return value;
+    }
+  }
+  return '';
+}
+
+window.document.forms.login_box_form.elements[0].value=getCookie('__ac_name');            
+--></script>
             </div>
     
             <div class="content even"> 
@@ -59,9 +86,13 @@
                 </a>
             </div>
 
-            <div class="content odd">          
-                <a href=""
-                 tal:attributes="href string:$portal_url/portal_form/join_form">
+            <div class="content odd"
+                tal:define="
+actions python:here.portal_actions.listFilteredActionsFor(here);
+join python:actions and [a['url'] for a in actions.get('user', []) if a['id']=='join']"
+                tal:condition="python:test(join and hasattr(here,'portal_registration') and here.portal_membership.checkPermission('Add portal member', here), 1, 0)">
+          
+                <a href="" tal:attributes="href python:join.pop()">
                     <img tal:replace="structure here/linkTransparent.gif" />
                     <span tal:omit-tag="" i18n:translate="box_new_user_option">New user?</span>
                 </a>





More information about the zopeorg-checkins mailing list