Skip to content

Commit 9dd8c98

Browse files
authored
Merge pull request #25 from wpi-acm/rewrite
UI rewrite
2 parents 9144ad8 + fa6a9ee commit 9dd8c98

29 files changed

+447
-1236
lines changed

goathacks/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
from flask_assets import Bundle, Environment
66
from flask_cors import CORS
77
from flask_mail import Mail, email_dispatched
8+
from flask_bootstrap import Bootstrap5
9+
from flask_font_awesome import FontAwesome
810
from flask_qrcode import QRcode
911

1012

13+
1114
db = SQLAlchemy()
1215
migrate = Migrate()
1316
login = LoginManager()
1417
environment = Environment()
1518
cors = CORS()
1619
mail = Mail()
20+
bootstrap = Bootstrap5()
21+
font_awesome = FontAwesome()
1722
qrcode = QRcode()
1823

1924
def create_app():
@@ -27,7 +32,9 @@ def create_app():
2732
environment.init_app(app)
2833
cors.init_app(app)
2934
mail.init_app(app)
35+
bootstrap.init_app(app)
3036
qrcode.init_app(app)
37+
font_awesome.init_app(app)
3138

3239
scss = Bundle('css/style.scss', filters='scss',
3340
output='css/style.css')

goathacks/admin/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Blueprint, jsonify, redirect, render_template, request, url_for
1+
from flask import Blueprint, current_app, jsonify, redirect, render_template, request, url_for
22
from flask_login import current_user, login_required
33
from flask_mail import Message
44

@@ -62,8 +62,20 @@ def mail():
6262
return redirect(url_for("dashboard.home"))
6363

6464
total_count = len(db.session.execute(db.select(User)).scalars().all())
65+
api_key = current_app.config["MCE_API_KEY"]
6566

66-
return render_template("mail.html", NUM_HACKERS=total_count)
67+
return render_template("mail.html", NUM_HACKERS=total_count,
68+
MCE_API_KEY=api_key)
69+
70+
@bp.route("/users")
71+
@login_required
72+
def users():
73+
if not current_user.is_admin:
74+
return redirect(url_for("dashboard.home"))
75+
76+
users = User.query.all()
77+
78+
return render_template("users.html", users=users)
6779

6880
@bp.route("/send", methods=["POST"])
6981
@login_required

goathacks/dashboard/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def home():
1919
current_user.accomodations = request.form.get('accomodations')
2020
db.session.commit()
2121
flash("Updated successfully")
22+
else:
23+
form = forms.ShirtAndAccomForm(obj=current_user)
2224
return render_template("dashboard.html", form=form, resform=resform)
2325

2426
@bp.route("/resume", methods=["POST"])

goathacks/dashboard/forms.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
from flask_wtf import FlaskForm
22
from flask_wtf.file import FileField, FileRequired, FileAllowed
3-
from wtforms import RadioField, TextAreaField
3+
from wtforms import SelectField, TextAreaField, SubmitField
44
from wtforms.validators import DataRequired
55

66
class ShirtAndAccomForm(FlaskForm):
7-
shirt_size = RadioField("Shirt size", choices=["XS", "S", "M", "L", "XL",
7+
shirt_size = SelectField("Shirt size", choices=["XS", "S", "M", "L", "XL",
88
"None"],
99
validators=[DataRequired()])
1010
accomodations = TextAreaField("Special needs and/or Accomodations")
11+
submit = SubmitField("Save")
1112

1213
class ResumeForm(FlaskForm):
1314
resume = FileField("Resume", validators=[FileRequired(),
1415
FileAllowed(['pdf', 'docx', 'doc',
1516
'txt', 'rtf'],
1617
"Documents only!")])
18+
19+
submit = SubmitField("Submit")

goathacks/registration/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from datetime import datetime, timedelta
22
from flask import Blueprint, abort, config, current_app, flash, redirect, render_template, request, url_for
33
import flask_login
4-
from flask_login import current_user
4+
from flask_login import current_user, login_required
55
from goathacks.registration.forms import LoginForm, PwResetForm, RegisterForm, ResetForm
66
from werkzeug.security import check_password_hash, generate_password_hash
77
from flask_mail import Message
@@ -97,6 +97,13 @@ def login():
9797

9898
return render_template("login.html", form=form)
9999

100+
@bp.route("/logout")
101+
@login_required
102+
def logout():
103+
flask_login.logout_user()
104+
flash("See you later!")
105+
return redirect(url_for("registration.login"))
106+
100107
@bp.route("/reset", methods=["GET", "POST"])
101108
def reset():
102109
form = ResetForm(request.form)

goathacks/static/css/style.css

Lines changed: 10 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,18 @@
1-
@font-face {
2-
font-family: "Krungthep";
3-
src: url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.eot");
4-
src: url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.eot?#iefix") format("embedded-opentype"), url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.woff2") format("woff2"), url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.woff") format("woff"), url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.ttf") format("truetype"), url("//db.onlinewebfonts.com/t/736cf5b08b01082a3645e14038868e20.svg#Krungthep") format("svg");
1+
.navbar-dark, .modal-header, .table-header {
2+
background-color: #974355;
3+
color: #FFFFFF;
54
}
65

7-
html {
8-
height: 100%;
6+
.modal-header, .table-header {
7+
color: #FFFFFF;
98
}
109

11-
body {
12-
background-color: #003049;
13-
font-family: 'Montserrat', sans-serif;
14-
font-size: 1.1rem;
15-
color: #eee;
10+
.container {
11+
min-height: 100vh;
1612
position: relative;
17-
min-height: 100%;
18-
}
19-
20-
p {
21-
line-height: 2rem;
22-
}
23-
24-
#logo-container {
25-
display: flex;
26-
justify-content: center;
27-
flex-direction: row;
28-
padding-top: 5px;
29-
padding-bottom: 5px;
30-
height: 100%;
31-
width: 100%;
32-
}
33-
34-
#goat {
35-
height: 100%;
36-
}
37-
38-
.button-collapse {
39-
color: #26a69a;
40-
}
41-
42-
.parallax-container {
43-
min-height: 380px;
44-
line-height: 0;
45-
height: auto;
46-
color: rgba(255, 255, 255, 0.9);
47-
}
48-
49-
.parallax-container .section {
50-
width: 100%;
51-
}
52-
53-
label {
54-
color: white !important;
55-
}
56-
57-
@media only screen and (max-width: 992px) {
58-
.parallax-container .section {
59-
top: 40%;
60-
}
61-
#index-banner .section {
62-
top: 10%;
63-
}
64-
}
65-
66-
@media only screen and (max-width: 600px) {
67-
.parallax-container .section {
68-
height: auto;
69-
overflow: auto;
70-
}
71-
.container {
72-
height: auto;
73-
}
74-
#index-banner .section {
75-
top: 0;
76-
}
77-
}
78-
79-
#tagline {
80-
font-weight: 600;
81-
}
82-
83-
#event-info {
84-
font-weight: 400;
85-
}
86-
87-
#registration-banner {
88-
min-height: 100px;
89-
max-height: 150px;
90-
}
91-
92-
#registration-banner .section {
93-
top: auto;
94-
}
95-
96-
.icon-block {
97-
padding: 0 15px;
98-
}
99-
100-
.icon-block .material-icons {
101-
font-size: inherit;
102-
}
103-
104-
.parallax img {
105-
display: inherit;
106-
max-width: 200%;
107-
}
108-
109-
#mlh-trust-badge {
110-
display: block;
111-
max-width: 100px;
112-
min-width: 60px;
113-
position: fixed;
114-
right: 50px;
115-
top: 0;
116-
width: 10%;
117-
z-index: 10000;
118-
}
119-
120-
nav {
121-
line-height: normal !important;
122-
font-family: "Jost", sans-serif;
123-
font-weight: 700;
124-
}
125-
126-
/*
127-
.navbar-brand {
128-
} */
129-
.footer-nav {
130-
position: absolute;
131-
bottom: 0;
132-
width: 100%;
133-
}
134-
135-
label {
136-
padding-bottom: 0.5rem;
137-
}
138-
139-
form input {
140-
border-radius: 5px;
14113
}
14214

143-
form input[type="submit"] {
144-
background: #26a69a;
145-
border-radius: 10px;
146-
border-color: #26a69a;
147-
}
148-
149-
form input[type="radio"] {
150-
padding-right: 5px;
151-
}
152-
153-
form input[type="checkbox"]:checked {
154-
visibility: visible;
155-
left: unset;
156-
position: unset;
157-
}
158-
159-
form label {
160-
font-size: 1.1rem;
161-
padding-right: 10px;
162-
padding-left: 25px !important;
163-
}
164-
165-
form select {
166-
display: unset;
167-
background: #974355;
168-
max-width: 11rem;
169-
}
170-
171-
.flashes {
172-
list-style-type: none;
173-
display: flex;
174-
justify-content: center;
175-
}
176-
177-
.message {
178-
width: 80%;
179-
justify-content: center;
180-
border: 1px solid #eee;
181-
background-color: #26a69a;
182-
padding: 0.2rem;
183-
font-size: large;
184-
color: #eee;
15+
body {
16+
min-height: 100vh;
17+
background-color: #003049;
18518
}

0 commit comments

Comments
 (0)