sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) else: DATA += """<p align="center"><br/><button><a href="/register.py">Register Now</a></button></p> <p class="footnote">Website designed by Brian Hession</p>""" ASIDE = """ <h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Register now and invite your friends!</p> """ MOBILE = '<p align="center"><br/><button><a href="/register.py">Register Now</a></button></p>' if loggedin: ASIDE = """<h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Create a group now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create a Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('About'), 'navLinks': sshtml.buildNavLinks('About'), 'accountLinks': sshtml.buildAccountLinks(loggedin), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) except: sshttp.senderror(500) import sys, traceback traceback.print_exc(file=sys.stderr)
ERROR = '<p><font color="#a93226">{}</font><br/></p>' formatting = '' if 'noemail' in args: formatting = ERROR.format('Must provide an email') elif 'nopassword' in args: formatting = ERROR.format('Must provide a password') elif 'invalid' in args: formatting = ERROR.format('Invalid username or password') data = DATA.format( formatting, sshttp.build_redirect_uri('/signin.py', redirect)) replace = { 'resources': sshtml.buildResources({'/css/signin.css': 'stylesheet'}), 'desktopNavLinks': sshtml.buildDesktopNavLinks(), 'navLinks': sshtml.buildNavLinks(), 'accountLinks': sshtml.buildAccountLinks(False), 'body': sshtml.buildBody(data=data, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) elif sshttp.is_post(): parameters = dict() if redirect: parameters['redirect'] = redirect if 'email' not in args: parameters['noemail'] = 1
<p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Create a group now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) user = sessions.get_user() DATA = DATA.format( userstable.USERS_SCHEMA.get(user, 'name'), userstable.USERS_SCHEMA.get(user, 'email'), sshttp.build_redirect_uri('/getacc.py', '/updateacc.py?changename=1'), sshttp.build_redirect_uri('/getacc.py', '/updateacc.py?changepassword=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('Account'), 'navLinks': sshtml.buildNavLinks('Account'), 'accountLinks': sshtml.buildAccountLinks(True), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) else: sshttp.senderror(403) except: sshttp.senderror(500) import sys, traceback traceback.print_exc(file=sys.stderr)
import sessions, sshtml loggedin = sessions.session_is_valid() DATA = '<h1>Support</h1><p>Please contact Brian Hession.</p>' ASIDE = """ <h2>What is it?</h2> <p>Support page</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Reach out to me if there are any technical issues. There is currently no support portal.</p>""" MOBILE = '<p align="center"><br/><button><a href="/register.py">Register Now</a></button></p>' if loggedin: ASIDE = """<h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Create a group now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create a Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('Support'), 'navLinks': sshtml.buildNavLinks('Support'), 'accountLinks': sshtml.buildAccountLinks(loggedin), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) except: sshttp.senderror(500) import sys, traceback traceback.print_exc(file=sys.stderr)
import sshttp try: import sessions, sshtml, userstable args = sshttp.get_parameters() if sessions.session_is_valid(): DATA = '<p>You are already signed in. Please sign out to continue.</p>' ASIDE = """<h2>What is it?</h2> <p>Secret santa account registration</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Enter your information in the fields. Once completed, you can either create a group or be invited by others.</p>""" MOBILE = '' replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks(), 'navLinks': sshtml.buildNavLinks(), 'accountLinks': sshtml.buildAccountLinks(False), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) else: if sshttp.is_get(): DATA = """<form id="register" action="/register.py" method="post"> <div class="register"> <h1>Register</h1> <p>Please fill out this form to create an account.</p> {} <hr/> <label for="email">Email</label>
admindata=ADMIN_MEMBER_DATA, listitems='\n'.join(memberlist)) else: DATA = '<h3>You have no groups</h3>' ASIDE = """<h2>What is it?</h2> <p>Your groups are listed here. Whatever shows up are groups you have either created or been invited to.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Choose a group from the list and it will show you the members and your assigned secret santa target, if they have been assigned. If no group shows up, create one now!</p> <p>Only group owners and moderators can assign the targets so wait for one of them to kick it off!</p> <p>Moderators can add and remove group members. Only owners can set moderators and delete the group.</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create a Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('Groups'), 'navLinks': sshtml.buildNavLinks('Groups'), 'accountLinks': sshtml.buildAccountLinks(True), 'body': sshtml.buildMenuBody(menu=menu, data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) else: sshttp.senderror(403) except:
'/groupctl.py?creategroup=1')) else: DATA += """<h2>Create your group today!</h2> <p align="center" style="margin: 15px;"><button><a href="/getacc.py">Sign in</a></button></p> <p align="center" style="margin-top: 15px;">Or if you do not have an account, <a href="/register.py">register now</a></p>""" ASIDE = """<h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Register now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="/register.py">Register Now</a></button></p>' if loggedin: ASIDE = """<h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Create a group now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create a Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('Home'), 'navLinks': sshtml.buildNavLinks('Home'), 'accountLinks': sshtml.buildAccountLinks(loggedin), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) except: sshttp.senderror(500) import sys, traceback traceback.print_exc(file=sys.stderr)
import sessions, sshtml loggedin = sessions.session_is_valid() DATA = '<h1 style="text-align: center">Under construction</h1><p style="font-size: 256px;text-align: center"><i class="fas fa-tools"></i></p>' ASIDE = """ <h2>What?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How?</h2> <p>Register now and invite your friends!</p> """ MOBILE = '<p align="center"><br/><button><a href="/register.py">Register Now</a></button></p>' if loggedin: ASIDE = """<h2>What is it?</h2> <p>Secret santa registration and group planner.</p> <h2 style="margin-top: 15px;">How does it work?</h2> <p>Create a group now and invite your friends!</p>""" MOBILE = '<p align="center"><br/><button><a href="{}">Create a Group Now</a></button></p>'.format( sshttp.build_redirect_uri('/getacc.py', '/groupctl.py?creategroup=1')) replace = { 'desktopNavLinks': sshtml.buildDesktopNavLinks('Registry'), 'navLinks': sshtml.buildNavLinks('Registry'), 'accountLinks': sshtml.buildAccountLinks(loggedin), 'body': sshtml.buildBody(data=DATA, aside=ASIDE, mobile=MOBILE) } sshttp.send200(sshtml.buildContainerPage(replace)) except: sshttp.senderror(500) import sys, traceback traceback.print_exc(file=sys.stderr)