Make preliminary updates for 2020, lock registration behind flag

This commit is contained in:
Nick Krichevsky 2019-08-22 21:10:56 -04:00
parent a7bc086f66
commit b3410fd781
No known key found for this signature in database
GPG key ID: A7567E699BE5AAE4
4 changed files with 56 additions and 53 deletions

View file

@ -15,7 +15,8 @@ from flask import Flask, render_template, redirect, url_for, request, session, j
from flask_sqlalchemy import SQLAlchemy from flask_sqlalchemy import SQLAlchemy
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
from config_hackWPI import api_keys, SERVER_LISTEN_ADDR, SERVER_PORT, WAITLIST_LIMIT, HACKATHON_TIME, ALLOWED_EXTENSIONS from config_hackWPI import (api_keys, SERVER_LISTEN_ADDR, SERVER_PORT, WAITLIST_LIMIT, HACKATHON_TIME,
ALLOWED_EXTENSIONS, REGISTRATION_OPEN)
app = Flask(__name__) app = Flask(__name__)
app.config.from_pyfile('config.py') app.config.from_pyfile('config.py')
@ -54,11 +55,13 @@ def server_error():
@app.route('/') @app.route('/')
def root(): def root():
print("Someone visited!.") return render_template('index.html', registration_open=REGISTRATION_OPEN)
return render_template('index.html')
@app.route('/resumepost', methods=['POST']) @app.route('/resumepost', methods=['POST'])
def resumepost(): def resumepost():
if not REGISTRATION_OPEN:
return 'Registration is currently closed.', 403
"""A last minute hack to let people post their resume after they've already registered""" """A last minute hack to let people post their resume after they've already registered"""
if request.method == 'POST': if request.method == 'POST':
if 'resume' not in request.files: if 'resume' not in request.files:
@ -85,6 +88,9 @@ def resumepost():
@app.route('/register', methods=['GET', 'POST']) @app.route('/register', methods=['GET', 'POST'])
def register(): def register():
if not REGISTRATION_OPEN:
return 'Registration is currently closed.', 403
if request.method == 'GET': if request.method == 'GET':
# Register a hacker... # Register a hacker...
if is_logged_in() and db.session.query( if is_logged_in() and db.session.query(

Binary file not shown.

View file

@ -1,6 +1,5 @@
{% include 'header.html' %} {% include 'header.html' %}
<div> <div>
<a id="mlh-trust-badge" style="display:block;max-width:100px;min-width:60px;position:fixed;right:50px;top:0;width:10%;z-index:10000" href="https://mlh.io/seasons/na-2019/events?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2019-season&utm_content=red" target="_blank"><img src="https://s3.amazonaws.com/logged-assets/trust-badge/2019/mlh-trust-badge-2019-red.svg" alt="Major League Hacking 2019 Hackathon Season" style="width:100%"></a>
<div id="index-banner" class="parallax-container valign-wrapper"> <div id="index-banner" class="parallax-container valign-wrapper">
<div class="section no-pad-bot"> <div class="section no-pad-bot">
<div class="container"> <div class="container">
@ -11,26 +10,34 @@
</div> </div>
<div id="event-info" class="row center"> <div id="event-info" class="row center">
<h5 class="header col s6 m5 light" style="margin-top:0; float: left; display: block"> <h5 class="header col s6 m5 light" style="margin-top:0; float: left; display: block">
<i class="small material-icons">today</i> January 18 - 20th, 2019 <i class="small material-icons">today</i> January 17 - 19th, 2020
</h5> </h5>
<h5 class="header col s6 m5 light" style="margin-top:0; float: right; display: block"> <h5 class="header col s6 m5 light" style="margin-top:0; float: right; display: block">
<i class="small material-icons">room</i> WPI Odeum <i class="small material-icons">room</i> WPI Odeum
</h5> </h5>
</div> </div>
<div class="row center"> <div class="row center">
{% if registration_open %}
<a class="col s12 m8 push-m2 btn-large waves-effect waves-light red darken-1" <a class="col s12 m8 push-m2 btn-large waves-effect waves-light red darken-1"
style= "float: left; display: inline-block; text-decoration: none;" style= "float: left; display: inline-block; text-decoration: none;"
href="/register">Register</a> href="/register">Register</a>
{% else %}
<span class="col s12 m8 push-m2 btn-large waves-effect waves-light red lighten-3"
style= "float: left; display: inline-block; text-decoration: none;"
disabled="true">Registration isn't open yet.</a>
{% endif %}
</div> </div>
<div class="row center"> <div class="row center">
<a id="cocbutton" class="sub-button col s8 push-s2 m6 push-m3 btn waves-effect waves-light grey darken-1" <a id="cocbutton" class="sub-button col s8 push-s2 m6 push-m3 btn waves-effect waves-light grey darken-1"
href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" data-mode="1" target="_blank">Code of Conduct</a> href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" data-mode="1" target="_blank">Code of Conduct</a>
</div> </div>
{% if registration_open %}
<div class="row center"> <div class="row center">
<a id="schedule" class="sub-button col s8 push-s2 m6 push-m3 btn waves-effect waves-light grey darken-1" <a id="schedule" class="sub-button col s8 push-s2 m6 push-m3 btn waves-effect waves-light grey darken-1"
href="https://docs.google.com/spreadsheets/d/1r1Fp3vmZ_PcHNvyULnhPPPGu-AScnqbWXwA_qj6PPE4/edit" data-mode="1" target="_blank">Schedule</a> href="https://docs.google.com/spreadsheets/d/1r1Fp3vmZ_PcHNvyULnhPPPGu-AScnqbWXwA_qj6PPE4/edit" data-mode="1" target="_blank">Schedule</a>
</div> </div>
{% endif %}
<br> <br>
</div> </div>
</div> </div>
@ -98,7 +105,7 @@
<div class="row"> <div class="row">
<a class="col s12 btn waves-effect waves-light red darken-2" <a class="col s12 btn waves-effect waves-light red darken-2"
style= "float: left; display: inline-block; text-decoration: none;" style= "float: left; display: inline-block; text-decoration: none;"
href= "../static/assets/Hack@WPI-SponsorshipInformation-2019.pdf">Sponsorship Package</a> href= "../static/assets/Hack@WPI-SponsorshipInformation-2020.pdf">Sponsorship Package</a>
</div> </div>
<h1 class="center brown-text"><strong>&#11015;</strong></h1> <h1 class="center brown-text"><strong>&#11015;</strong></h1>
</div> </div>
@ -112,34 +119,22 @@
<div class="section no-pad-bot"> <div class="section no-pad-bot">
<div class="container"> <div class="container">
<div class="row center sponsors"> <div class="row center sponsors">
<div class="partner-sponsors">
<h2>Partners</h2>
<img class="logo" src="../static/img/logos/mlh.png">
</div>
<div class="platinum-sponsors"> <div class="platinum-sponsors">
<h2>Platinum Sponsors</h2> <h2>Platinum Sponsors</h2>
<div class="sponsor-name">WPI Computer Science</div> <div class="sponsor-name">Could be you!</div>
</div> </div>
<div class="gold-sponsors"> <div class="gold-sponsors">
<h2>Gold Sponsors</h2> <h2>Gold Sponsors</h2>
<img class="logo" style="max-height: 180px;" src="../static/img/logos/state-street.png">
<img class="logo" src="../static/img/logos/paytronix.png"> <img class="logo" src="../static/img/logos/paytronix.png">
</div> </div>
<div class="silver-sponsors"> <div class="silver-sponsors">
<h2>Silver Sponsors</h2> <h2>Silver Sponsors</h2>
<img class="logo" src="../static/img/logos/google.png">
<img class="logo" src="../static/img/logos/carbon-black.png"> <img class="logo" src="../static/img/logos/carbon-black.png">
</div> </div>
<div class="bronze-sponsors"> <div class="bronze-sponsors">
<h2>Bronze Sponsors</h2> <h2>Bronze Sponsors</h2>
<img class="logo" src="../static/img/logos/amazon.png">
<img class="logo" src="../static/img/logos/everquote.png"> <img class="logo" src="../static/img/logos/everquote.png">
<img class="logo" src="../static/img/logos/wakefly.png"> <img class="logo" src="../static/img/logos/wakefly.png">
<img class="logo" src="../static/img/logos/vistaprint.png">
</div>
<div class="other-sponsors">
<h2>Other Sponsors</h2>
<img class="logo" src="../static/img/logos/irobot.png">
</div> </div>
</div> </div>
</div> </div>
@ -156,6 +151,7 @@
<p class="grey-text text-lighten-4">For any inquiries regarding sponsoring the event as a company or co-sponsoring the event as an on campus club, please email <a class="white-text" href="mailto:hack@wpi.edu?subject=[Hackathon]" target="_top"><u>hack@wpi.edu</u></a>, and we will happily discuss it with you!</p> <p class="grey-text text-lighten-4">For any inquiries regarding sponsoring the event as a company or co-sponsoring the event as an on campus club, please email <a class="white-text" href="mailto:hack@wpi.edu?subject=[Hackathon]" target="_top"><u>hack@wpi.edu</u></a>, and we will happily discuss it with you!</p>
</div> </div>
</div> </div>
{% if registration_open %}
<div class="footer-info row"> <div class="footer-info row">
<h4 class="white-text">FAQ</h4> <h4 class="white-text">FAQ</h4>
</div> </div>
@ -187,6 +183,7 @@
<p class="grey-text text-lighten-4">Doesn't matter! We'll have plenty of mentors from sponsoring companies, as well as workshops throughout the weekend!</p> <p class="grey-text text-lighten-4">Doesn't matter! We'll have plenty of mentors from sponsoring companies, as well as workshops throughout the weekend!</p>
</div> </div>
</div> </div>
{% endif %}
<div class="footer-copyright"> <div class="footer-copyright">
<div class="container"> <div class="container">
For issues, please contact <a class="white-text" href="mailto:acm@wpi.edu?subject=[Site]" target="_top"><u>acm@wpi.edu</u></a> For issues, please contact <a class="white-text" href="mailto:acm@wpi.edu?subject=[Site]" target="_top"><u>acm@wpi.edu</u></a>