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 31 31 32 32 # Define variables for each template 33 33 G = globals() 34 templates = ['login', 'yes_no', 'registration', 'account_settings' ]34 templates = ['login', 'yes_no', 'registration', 'account_settings', 'account_recovery', 'user_management', 'error_message'] 35 35 for name in templates: 36 36 G[name] = PageTemplate('%s.html'%name) -
a/sage/server/notebook/twist.py
old new 110 110 # An error message 111 111 ############################ 112 112 def 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) 131 114 132 115 ############################ 133 116 # Create a Sage worksheet from a latex2html'd file … … 1965 1948 1966 1949 return http.Response(stream=message("A new password has been sent to your e-mail address.", '/')) 1967 1950 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() 1980 1952 return http.Response(stream=s) 1981 1953 1982 1954 class ListOfUsers(resource.Resource): … … 1987 1959 if user_type(self.username) != 'admin': 1988 1960 s = message('You must an admin to manage other users.') 1989 1961 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()) 1996 1963 return http.Response(stream = s) 1997 1964 1998 1965 class InvalidPage(resource.Resource):