Ticket #3949: sage-3949_1.patch

File sage-3949_1.patch, 3.2 kB (added by TimothyClemans, 4 months ago)
  • a/sage/server/notebook/template.py

    old new  
    3131 
    3232# Define variables for each template 
    3333G = globals() 
    34 templates = ['login', 'yes_no', 'registration', 'account_settings'
     34templates = ['login', 'yes_no', 'registration', 'account_settings', 'account_recovery', 'user_management', 'error_message'
    3535for name in templates: 
    3636    G[name] =  PageTemplate('%s.html'%name) 
  • a/sage/server/notebook/twist.py

    old new  
    110110# An error message 
    111111############################ 
    112112def message(msg, cont=None): 
    113     s = notebook.html_banner()  
    114     s += '<br><a class="usercontrol" href="/">Home</a>' 
    115     s += '<hr class="usercontrol">' 
    116     s += '<br>'*2 
    117     s += msg 
    118     s += '<br>'*2 
    119     if cont: 
    120         s += '<center><a class="boldusercontrol" href="%s"><font size=+1>Continue</font></a></center>'%cont 
    121     return """ 
    122         <html> 
    123         <head> 
    124            <link rel=stylesheet href="/css/main.css"> 
    125            <title>The Sage Notebook</title> 
    126         </head> 
    127         <body> 
    128         %s 
    129         </body> 
    130     """%s 
     113    return template.error_message(msg=msg, cont=cont) 
    131114 
    132115############################ 
    133116# Create a Sage worksheet from a latex2html'd file 
     
    19651948             
    19661949            return http.Response(stream=message("A new password has been sent to your e-mail address.", '/')) 
    19671950        else: 
    1968             s = """<html><h1 align=center>Account Recovery</h1> 
    1969             <br> 
    1970             <hr> 
    1971             <br> 
    1972             <form method="GET" action="/forgotpass"> 
    1973             <br><br> 
    1974             <table align=center><tr> 
    1975             <td align=right>Username:</td><td><input type="text" name="username" size="15" /></td></tr> 
    1976             <tr><td></td><td align=left><input type="submit" value="Submit" /><input type="button" value="Cancel" style="margin-left:5px" onClick="parent.location=\'/'"></td></tr> 
    1977             </table> </form> 
    1978              
    1979             </html>""" 
     1951            s = template.account_recovery() 
    19801952        return http.Response(stream=s) 
    19811953 
    19821954class ListOfUsers(resource.Resource): 
     
    19871959            if user_type(self.username) != 'admin': 
    19881960                s = message('You must an admin to manage other users.') 
    19891961            else: 
    1990                 s = """ 
    1991                 <html><head><title>Users | Sage Notebook</title></head> 
    1992                 <body> 
    1993                 %s 
    1994                 </body></html> 
    1995                 """ % '<br/>'.join(['<a href="/home/%s/">%s</a>' % (i, i) for i in notebook.valid_login_names()]) 
     1962                s = template.user_management(users=notebook.valid_login_names()) 
    19961963            return http.Response(stream = s) 
    19971964 
    19981965class InvalidPage(resource.Resource):