Changeset 5354
- Timestamp:
- 1 Aug 2010, 15:51:01 (14 years ago)
- Location:
- main/waeup.sirp/branches/henrik-experimental-layout/src/waeup/sirp/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/henrik-experimental-layout/src/waeup/sirp/browser/templates/login.pt
r4789 r5354 1 1 <div class="portlet" 2 2 tal:condition="python: request.principal.id == 'zope.anybody'"> 3 4 5 <form method="post" tal:condition='python:False'> 3 6 <h3>Login</h3> 4 <form method="post"> 5 User<br /><input type="text" name="form.login" size="20" /><br /> 6 Password<br /><input type="password" name="form.password" size="20" /> 7 User<br /><input type="text" name="form.login" size="15" /><br /> 8 Password<br /><input type="password" name="form.password" size="15" /> 7 9 <br /> 8 10 <input type="submit" name="SUBMIT" value="Login" /> 9 11 </form> 12 10 13 <a href="@@loginstaff"> 11 14 <img tal:attributes="src static/login.png" /> Staff Login 12 15 </a> 16 <br /> 17 <a href="@@loginstudent"> 18 <img tal:attributes="src static/login.png" /> Student Login 19 </a> 13 20 </div> -
main/waeup.sirp/branches/henrik-experimental-layout/src/waeup/sirp/browser/viewlets.py
r5351 r5354 216 216 """ 217 217 grok.viewletmanager(LeftSidebar) 218 grok.context(IUniversity)219 grok.view(UniversityPage)218 #grok.context(IUniversity) 219 #grok.view(UniversityPage) 220 220 grok.order(2) 221 221 … … 274 274 return u'<div class="portlet"><a href="%s">Data Center</a></div>' % ( 275 275 self.view.application_url('datacenter')) 276 277 class Logout(grok.Viewlet): 278 grok.viewletmanager(LeftSidebar) 279 #grok.context(IUniversity) 280 #grok.view(UniversityPage) 281 grok.order(7) 282 283 def isAuthenticated(self): 284 """Is the calling user authenticated? 285 """ 286 return self.request.principal.id != 'zope.anybody' 287 288 def render(self): 289 if self.isAuthenticated(): 290 return u'<div class="portlet"><a href="%s">Logout</a></div>' % ( 291 self.view.application_url('@@logout')) 292 else: 293 return '' 294 295 296 297 298 276 299 277 300 #
Note: See TracChangeset for help on using the changeset viewer.