Merge pull request #1 from wpi-acm/master

Updating fork
This commit is contained in:
Jacob Hackett 2017-12-18 21:50:28 -05:00 committed by GitHub
commit c4d1504b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 92 additions and 98 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
resumes
config_hackWPI.py
config.py
# Created by https://www.gitignore.io/api/web,vim,git,macos,linux,bower,grunt,python,pycharm,windows,eclipse,webstorm,intellij,jetbrains,virtualenv,visualstudio,visualstudiocode

View file

@ -13,9 +13,6 @@ from email.mime.text import MIMEText
from dateutil.relativedelta import relativedelta
from flask import Flask, render_template, redirect, url_for, request, session, jsonify
from flask_sqlalchemy import SQLAlchemy
from mailchimp3 import MailChimp
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
from werkzeug.utils import secure_filename
from config_hackWPI import api_keys, WAITLIST_LIMIT, HACKATHON_TIME, ALLOWED_EXTENSIONS
@ -25,13 +22,8 @@ app.config.from_pyfile('config.py')
db = SQLAlchemy(app)
pnconfig = PNConfiguration()
pnconfig.publish_key = api_keys['pubnub']['pub']
pnconfig.subscribe_key = api_keys['pubnub']['sub']
pnconfig.ssl = True
pn = PubNub(pnconfig)
class Hacker(db.Model):
@ -54,6 +46,14 @@ class AutoPromoteKeys(db.Model):
key = db.Column(db.String(4096))
val = db.Column(db.String(4096))
@app.errorhandler(413)
def filesize_too_big(erro):
print("Someone tried to send something too big")
return "That file was too big, please go back and try a smaller resume pdf"
@app.errorhandler(500)
def server_error():
print("There was a server error... If you're having trouble registering, please email hack@wpi.edu with your details and what you did to break our site :P")
@app.route('/')
def root():
@ -154,7 +154,7 @@ def register():
print(session['mymlh']['first_name'] + " put on database successfully.")
# Send a welcome email
msg = 'Hey ' + session['mymlh']['first_name'] + '\n\n'
msg = 'Dear ' + session['mymlh']['first_name'] + '\n\n'
msg += 'Thanks for applying to Hack@WPI!\n'
if waitlist:
msg += 'Sorry! We have hit our registration capacity. You have been placed on the waitlist.\n'
@ -163,8 +163,6 @@ def register():
msg += 'You are fully registered! We will send you more info closer to the hackathon.\n'
send_email(session['mymlh']['email'], 'Hack@WPI - Thanks for applying', msg)
pn.publish().channel('hackWPI-admin').message({'action': 'new_user'}).sync()
# Finally, send them to their dashboard
return redirect(url_for('dashboard'))
@ -266,9 +264,6 @@ def change_admin():
db.session.query(Hacker).filter(Hacker.mlh_id == request.args.get('mlh_id')).update({'admin': False})
db.session.commit()
pn.publish().channel('hackWPI-admin').message(
{'status': 'success', 'action': 'change_admin:' + request.args.get('action'), 'more_info': '',
'id': request.args.get('mlh_id')}).sync()
return jsonify({'status': 'success', 'action': 'change_admin:' + request.args.get('action'), 'more_info': '',
'id': request.args.get('mlh_id')})
@ -300,15 +295,11 @@ def check_in():
mlh_info = get_mlh_user(request.args.get('mlh_id'))
# Send a welcome email...
msg = 'Hey ' + mlh_info['first_name'] + ',\n\n'
msg = 'Dear ' + mlh_info['first_name'] + ',\n\n'
msg += 'Thanks for checking in!\n'
msg += 'We will start shortly, please check your dashboard for updates!\n'
send_email(mlh_info['email'], 'HackWPI - Thanks for checking in', msg)
pn.publish().channel('hackWPI-admin').message(
{'status': 'success', 'action': 'check_in', 'more_info': '',
'id': request.args.get('mlh_id')}).sync()
return jsonify(
{'status': 'success', 'action': 'check_in', 'more_info': '', 'id': request.args.get('mlh_id')})
@ -355,11 +346,9 @@ def drop():
# Send a goodbye email...
msg = 'Dear ' + mlh_info['first_name'] + ',\n\n'
msg += 'Your application was dropped, sorry to see you go.\n'
msg += 'Your application was dropped, sorry to see you go.\n If this was a mistake, you can re-register by going to hack.wpi.edu/register'
send_email(mlh_info['email'], 'Hack@WPI - Application Dropped', msg)
pn.publish().channel('hackWPI-admin').message(
{'status': 'success', 'action': 'drop', 'more_info': '', 'id': request.args.get('mlh_id')}).sync()
if is_self(request.args.get('mlh_id')):
session.clear()
@ -411,9 +400,6 @@ def promote_from_waitlist():
msg += 'If you cannot make it, please remove yourself at hack.wpi.edu\dashboard.\n'
send_email(mlh_info['email'], "Hack@WPI - You're off the Waitlist!", msg)
pn.publish().channel('hackWPI-admin').message(
{'status': 'success', 'action': 'promote_from_waitlist', 'more_info': '',
'id': request.args.get('mlh_id')}).sync()
print(mlh_info['first_name'] + "is off the waitlist!")
@ -463,7 +449,7 @@ def send_email(to, subject, body):
print("Email sent to: " + to)
body += '\nPlease let your friends know about the event as well!.\n'
body += 'To update your status, you can go to hack.wpi.edu/dashboard\n'
body += '\nThanks Again!\nThe HackWPI Team\nhttps://twitter.com/hackwpi?lang=en'
body += '\nAll the best!\nThe HackWPI Team\nhttps://twitter.com/hackwpi?lang=en'
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
@ -537,4 +523,4 @@ def allowed_file(filename):
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)
app.run(host='0.0.0.0', port=80, threaded=True)

View file

@ -50,5 +50,5 @@ msg += ' ' + str(errs) + '\n'
print(msg)
send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg)
#send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg)
send_email('bkayastha@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg)

View file

@ -5,3 +5,5 @@ pubnub==4.0.6
requests==2.13.0
Werkzeug==0.11.15
python_dateutil==2.6.0
mysql-connector-python==8.0.5
mysqlclient==1.3.12

BIN
static/img/nosponsors.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
static/img/sponsors.xcf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -172,20 +172,23 @@
<table id="shirts" class="table table-striped table-hover table-condensed sortable">
<thead>
<tr>
<th>XXS</th>
<th>XS</th>
<th>S</th>
<th>M</th>
<th>L</th>
<th>XL</th>
<th>XXL</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ shirt_count['xxs'] }}</td>
<td>{{ shirt_count['xs'] }}</td>
<td>{{ shirt_count['s'] }}</td>
<td>{{ shirt_count['m'] }}</td>
<td>{{ shirt_count['l'] }}</td>
<td>{{ shirt_count['xl'] }}</td>
<td>{{ shirt_count['xxl'] }}</td>
</tr>
</tbody>
</table>

View file

@ -12,11 +12,11 @@
<h1>You are fully registered! We look forward to seeing you!</h1>
{% endif %}
<br>
<h2>Here are your available actions... </h2>
<a href="#" id="drop-link"><p>Drop Application :(</p></a>
<a href="#" id="drop-link"><p class="sub-button btn waves-effect waves-light grey darken-1">Drop Application :(</p></a>
{% if admin %}
<a href="/admin"><p>Admin Dashboard</p></a>
<a href="/admin"><p class="btn">Admin Dashboard</p></a>
{% endif %}
<br>
Please sit tight, while we improve the UI of this page :P
</div>
</div>

View file

@ -1,7 +1,7 @@
<script src="../static/js/jquery-2.2.4.min.js"></script>
<script src="../static/js/jquery.easing.min.js"></script>
<script src="../static/js/materialize.min.js"></script>
<script src="../static/js/init.js"></script>
<script src="../static/js/jquery-2.2.4.min.js"></script>
<script src="../static/js/jquery.easing.min.js"></script>
<script src="../static/js/materialize.min.js"></script>
<script src="../static/js/init.js"></script>
</body>
</body>
</html>

View file

@ -1,22 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Hack @ WPI</title>
<link rel="icon" href="../static/favicon.png" type="image/png">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css" integrity="sha384-dNpIIXE8U05kAbPhy3G1cz+yZmTzA6CY8Vg/u2L9xRnHjJiAK76m2BIEaSEV+/aU" crossorigin="anonymous">
<link href="../static/css/materialize.min.css" rel="stylesheet">
<link href="../static/css/style.css" rel="stylesheet">
<!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script><![endif]--><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<nav class="white" role="navigation" style="height: 80px">
<div class="nav-wrapper container">
<a id="logo-container" href="#" class="red-text text-darken-4 brand-logo">
<img src="../static/img/hackwpi_longlogo.png" alt="hack@WPI" height="100%">
</a>
</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-2018/events?utm_source=na-2018&utm_medium=TrustBadge&utm_campaign=na-2018&utm_content=black" target="_blank"><img src="https://s3.amazonaws.com/logged-assets/trust-badge/2018/black.svg" alt="Major League Hacking 2018 Hackathon Season" style="width:100%"></a>
</nav>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Hack @ WPI</title>
<link rel="icon" href="../static/favicon.png" type="image/png">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css" integrity="sha384-dNpIIXE8U05kAbPhy3G1cz+yZmTzA6CY8Vg/u2L9xRnHjJiAK76m2BIEaSEV+/aU" crossorigin="anonymous">
<link href="../static/css/materialize.min.css" rel="stylesheet">
<link href="../static/css/style.css" rel="stylesheet">
<!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script><![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<nav class="white" role="navigation" style="height: 80px">
<div class="nav-wrapper container">
<a id="logo-container" href="#" class="red-text text-darken-4 brand-logo">
<img src="../static/img/hackwpi_longlogo.png" alt="hack@WPI" height="100%">
</a>
</div>
</nav>

View file

@ -15,12 +15,6 @@
<h5 class="header col s6 m5 light" style="margin-top:0; float: right; display: block">
<i class="small material-icons">room</i> WPI Odeum
</h5>
<!--<%= link_to "Registration", "/pages/registration",
class: "col s12 m2 btn-large waves-effect waves-light red darken-1",
style: "float: left; display: inline-block" %>-->
<!--<%= link_to 'Click here to apply!'.html_safe, questionnaires_path,
class: "col s12 m2 btn-large waves-effect waves-light red darken-1",
style: "float: left; display: inline-block" %>-->
<a class="col s12 m2 btn-large waves-effect waves-light red darken-1"
style= "float: left; display: inline-block; text-decoration: none;"
href= "/register">Register Here!</a>
@ -28,16 +22,16 @@
<div class="row center" style="margin:0">
<a id="cocbutton" class="sub-button col s6 push-s3 m2 push-m5 btn waves-effect waves-light grey darken-1"
href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" data-mode="1" target="_blank">MLH Code</a>
href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" data-mode="1" target="_blank">Code</a>
</div>
<div class="row center">
<div class="col s12 m6">
<a class="sub-button col s6 push-s3 m4 push-m4 btn waves-effect waves-light grey darken-1"
href="" data-mode="1" target="_blank">Slack Chatroom (TBA)</a>
<!-- <a class="sub-button col s6 push-s3 m4 push-m4 btn waves-effect waves-light grey darken-1"
href="" data-mode="1" target="_blank">Slack Chatroom (TBA)</a> -->
</div>
<div class="col s12 m6">
<a class="sub-button col s6 push-s3 m4 push-m4 btn waves-effect waves-light grey darken-1"
href="" data-mode="1" target="_blank">Devpost Link (TBA)</a>
<!-- <a class="sub-button col s6 push-s3 m4 push-m4 btn waves-effect waves-light grey darken-1"
href="" data-mode="1" target="_blank">Devpost Link (TBA)</a> -->
</div>
</div>
<br>
@ -141,7 +135,7 @@
</div>
<div class="col l6 s6">
<h5 class="white-text">Will there be travel reimbursements?</h5>
<p class="grey-text text-lighten-4">We are attempting to partner with some nearby schools to run a bus from there's to ours, but may not have the budget. If you're interested in providing a bus to our hackathon, let us know. At the moment we cannot provide travel reimburstments.</p>
<p class="grey-text text-lighten-4">We are attempting to partner with some nearby schools to run a bus from their's to ours, but may not have the budget. If you're interested in providing a bus to our hackathon, let us know. At the moment we cannot provide travel reimbursments.</p>
</div>
<div class="col l6 s6">
<h5 class="white-text">How do I know I'm registered?</h5>
@ -149,7 +143,7 @@
</div>
<div class="col l6 s6">
<h5 class="white-text">I am officially registered but now I want to unregister, how do I do that?</h5>
<p class="grey-text text-lighten-4">Go to hack.wpi.edu/dashboard, there is a link on the bottom to drop your registration</p>
<p class="grey-text text-lighten-4">Go to hack.wpi.edu/dashboard. There is a link on the bottom to drop your registration.</p>
</div>
</div>
</div>

View file

@ -11,32 +11,40 @@
<a id="mlh-trust-badge" href="https://mlh.io/seasons/na-2017/events?utm_source=na-2017&utm_medium=TrustBadge&utm_campaign=na-2017&utm_content=black" target="_blank"><img src="https://s3.amazonaws.com/logged-assets/trust-badge/2017/black.svg" alt="Major League Hacking 2017 Hackathon Season" style="width:100%"></a>
<div class="container">
<h1>Hi {{ name }}, thanks for logging in with MyMLH!</h1>
<h2>If you'd like, add your resume to send to sponsors... </h2>
<div class="section">
<h1>Hi {{ name }}, just a few more steps!</h1>
<div class="section">
<form method="post" action="/register" enctype="multipart/form-data">
<div class="file-field input-field">
<div class="btn">
<span>File</span>
<input id="resume" name="resume" type="file"/>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
<p>By registering & attending, you agree to the following policies:</p>
<p><a href="https://github.com/MLH/mlh-policies/blob/master/data-sharing.md">MLH's Data Sharing
Notice</a>
</p>
<p><a href="https://mlh.io/privacy">MLH's Privacy Policy</a></p>
<p>
<a href="https://github.com/MLH/mlh-policies/blob/master/prize-terms-and-conditions/contest-terms.md">MLH's
Contest Terms and Conditions</a></p>
<p><a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf">MLH's Code of Conduct</a></p>
<br>
<input type="checkbox" id="checkboxid" required><label for="checkboxid">Do you agree with MLH Rules?</label><br>
<input name="submit" class="btn btn-lg btn-primary btn-invert" type="submit" value="Submit"/>
</form>
<div>
<p><b>If you'd like, add your resume to send to sponsors... </b></p>
<div class="file-field input-field">
<div class="btn">
<span>File</span>
<input id="resume" name="resume" type="file"/>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
</div>
<p>By registering & attending, you agree to the following policies (We are no longer MLH afilliated, but we agree with their policies):</p>
<p>
<a href="https://github.com/MLH/mlh-policies/blob/master/data-sharing.md">MLH's Data Sharing Notice</a>
</p>
<p>
<a href="https://mlh.io/privacy">MLH's Privacy Policy</a>
</p>
<p>
<a href="https://github.com/MLH/mlh-policies/blob/master/prize-terms-and-conditions/contest-terms.md">MLH's
Contest Terms and Conditions</a>
</p>
<p>
<a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf">MLH's Code of Conduct</a>
</p>
<br>
<input type="checkbox" id="checkboxid" required><label for="checkboxid"><b style="color:black;">Do you agree with these Rules?</b></label>
<br><br>
<input name="submit" class="btn btn-lg btn-primary btn-invert" type="submit" value="Submit"/>
</form>
</div>
</div>
</div>