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.py54
1 files changed, 48 insertions, 6 deletions
diff --git a/tools/mmd/MmdWidgets.py b/tools/mmd/MmdWidgets.py
index 252b6f8..1c83ac5 100644
--- a/tools/mmd/MmdWidgets.py
+++ b/tools/mmd/MmdWidgets.py
@@ -54,7 +54,46 @@ def registerFormWidget ():
def registerWidget ():
html = '''
<h3>Thank you for registering!</h3>
- You will receive an email conataining a link to confirm your registration. Please use this link within 24 hours to complete registration.
+ You will receive an email containing a link to confirm your registration. Please use this link within 24 hours to complete registration.
+ '''
+
+ return html
+
+def completeRegistrationWidget (code):
+ html = '''
+ <h3>Completing registration!</h3>
+ <div>
+ By clicking <a href="?cmd=confirmRegistration&code={0}">confirm</a> you confirm you registration to the MURSAT1 Mission Dashboard. If you received an email that brought you here but never registered, you might want to <a href="?cmd=cancelRegistration&code={0}">cancel</a> the registration or simply do nothing since a registration code is only valid vor 24 hrs.
+ </div>
+ <div>
+ Greetings from the MURSAT1 Team!
+ </div>
+ '''.format (code)
+
+ return html
+
+def confirmRegistrationWidget (user):
+ html = '''
+ <h3>Dear {0} {1}!</h3>
+ <div>
+ Thank you for participating in this project by registerting here! We are looking forward to receiving your reports from MURSAT1.
+ </div>
+ <div>
+ Sessions here stay valid for 24 hours after your last click. If your session expires, just use your email and password to logon again using this link: <a href="http://hofos.at/mmd/?cmd=login">http://hofos.at/mmd/?cmd=login</a>.
+ </div>
+ '''.format (user.firstname, user.lastname)
+
+ return html
+
+def cancelRegistrationWidget ():
+ html = '''
+ <h3>We are sorry!</h3>
+ <div>
+ Your registration has been canceled and all the data has been deleted from our records.
+ </div>
+ <div>
+ Regards from the MURSAT1 team
+ </div>
'''
return html
@@ -114,16 +153,20 @@ def osmWidget (longitude = 15.4426, latitude = 47.06576):
return html
-def statusWidget (ip, email):
+def statusWidget (session):
+ if session.status == 'auth':
+ inout = '''<span id="logout"><a href="?cmd=logout">logout</a></span>'''
+ else:
+ inout = '''<span id="login"><a href="?cmd=loginForm">login</a></span>'''
html = '''
- <a href="">
+ <a href="/mmd/">
<img src="http://sat.mur.at/pics/sat-logo-notext.png" alt="mur.sat logo" />
</a>
MURSAT1 Mission Dashboard
<div id="info">
- Hello {0} with session id '{1}'! Local time is {2}
+ Hello {0} with session id '{1}'! Local time is {2}. {3}
</div>
- '''.format (email, ip, time.strftime ('%c'))
+ '''.format (session.email, session.session_id, time.strftime ('%c'), inout)
return html
@@ -165,7 +208,6 @@ def dataWidget (longitude = 15.44226, latitude = 47.06576):
<div>Latitude: {1}</div>
<hr />
<div><a href="?cmd=submitForm">Submit</a> a report</div>
- <div><a href="?cmd=loginForm">Login</a> to your personal account</div>
<div>View <a href="?cmd=viewlog">Log</a> of reports</div>
<hr />
<div>Checkout the <a href="http://sat.mur.at/">project page</a>!</div>