summaryrefslogtreecommitdiff
path: root/tools/mmd/MmdWidgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mmd/MmdWidgets.py')
-rw-r--r--tools/mmd/MmdWidgets.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/mmd/MmdWidgets.py b/tools/mmd/MmdWidgets.py
index 8bade15..9219e8c 100644
--- a/tools/mmd/MmdWidgets.py
+++ b/tools/mmd/MmdWidgets.py
@@ -6,12 +6,12 @@ import time
def loginFormWidget ():
html = '''
- Please enter your email/callsign and your password in the form below.
- <form method="post">
+ Please enter your email and password in the form below.
+ <form method="post" accept-charset="UTF-8">
<table>
<tr><td class="formfield">Email:</td><td><input type="text" name="email" /></td></tr>
<tr><td class="formfield">Password:</td><td><input type="password" name="password" /></td></tr>
- <tr><td class="formfield"><input type="submit" value="Login" /></td><td></td></tr>
+ <tr><td class="formfield"><input type="submit" value="Login" disabled="disabled" /></td><td></td></tr>
</table>
<input type="hidden" name="cmd" value="login" />
</form>
@@ -30,7 +30,7 @@ def loginWidget (email):
def registerFormWidget ():
html = '''
Please fill in the form below an click on Register. You will receive a confirmation email.
- <form method="post">
+ <form method="post" accept-charset="UTF-8">
<table>
<tr><td class="formfield">Firstname*:</td><td><input type="text" name="firstname" /></td></tr>
<tr><td class="formfield">Lastname*: </td><td><input type="text" name="lastname" /></td></tr>
@@ -40,7 +40,7 @@ def registerFormWidget ():
<tr><td class="formfield">Latitude: </td><td><input type="text" name="longitude" /></td></tr>
<tr><td class="formfield">Password*: </td><td><input type="password" name="password" /></td></tr>
<tr><td class="formfield">Confirm Password*: </td><td><input type="password" name="confirm" /></td></tr>
- <tr><td class="formfield"><input type="submit" value="Register" /></td><td></td></tr>
+ <tr><td class="formfield"><input type="submit" value="Register" disabled="disabled" /></td><td></td></tr>
</table>
<input type="hidden" name="cmd" value="register" />
</form>
@@ -56,6 +56,15 @@ def registerWidget ():
return html
+def errorWidget (error_message):
+ html = '''
+ <h3>An error occured!</h3>
+ <div>Error: {0}</div>
+ <div>Description: {1}</div>
+ '''.format (error_message['error'], error_message['description'])
+
+ return html
+
def submitFormWidget ():
html = '''
sorry, no form yet!
@@ -102,7 +111,7 @@ def osmWidget (longitude = 15.4426, latitude = 47.06576):
return html
-def statusWidget (ip, user = 'Anonymous'):
+def statusWidget (ip, email):
html = '''
<a href="mmd">
<img src="http://sat.mur.at/pics/sat-logo-notext.png" alt="mur.sat logo" />
@@ -111,7 +120,7 @@ def statusWidget (ip, user = 'Anonymous'):
<div id="info">
Hello {0} with session id '{1}'! Local time is {2}
</div>
- '''.format (user, ip, time.strftime ('%c'))
+ '''.format (email, ip, time.strftime ('%c'))
return html