Changeset 5354 for main


Ignore:
Timestamp:
1 Aug 2010, 15:51:01 (14 years ago)
Author:
Henrik Bettermann
Message:
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  
    11<div class="portlet"
    22     tal:condition="python: request.principal.id == 'zope.anybody'">
     3   
     4   
     5    <form method="post" tal:condition='python:False'>
    36    <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" />
    79      <br />
    810      <input type="submit" name="SUBMIT" value="Login" />
    911    </form>
     12   
    1013    <a href="@@loginstaff">
    1114      <img tal:attributes="src static/login.png" /> Staff Login
    1215    </a>
     16    <br />
     17    <a href="@@loginstudent">
     18      <img tal:attributes="src static/login.png" /> Student Login
     19    </a>
    1320</div>
  • main/waeup.sirp/branches/henrik-experimental-layout/src/waeup/sirp/browser/viewlets.py

    r5351 r5354  
    216216    """
    217217    grok.viewletmanager(LeftSidebar)
    218     grok.context(IUniversity)
    219     grok.view(UniversityPage)
     218    #grok.context(IUniversity)
     219    #grok.view(UniversityPage)
    220220    grok.order(2)
    221221
     
    274274        return u'<div class="portlet"><a href="%s">Data Center</a></div>' % (
    275275            self.view.application_url('datacenter')) 
     276           
     277class 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           
    276299
    277300#
Note: See TracChangeset for help on using the changeset viewer.