Skip to content

Commit 2f60261

Browse files
author
Michael Zhang
committed
Checkpoint commit
1 parent 826a4aa commit 2f60261

File tree

8 files changed

+20
-19
lines changed

8 files changed

+20
-19
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.idea
44
.env
55
.secret_key
6+
npm-debug.log

Procfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
web: python manage.py db upgrade && gunicorn cal:app --log-file -
1+
web: python manage.py db upgrade && gunicorn cal:app --log-file -
2+
dev: python manage.py db upgrade && python manage.py runserver

config.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def __init__(self, app_root=None, testing=False):
1717
self._load_secret_key()
1818
self.SQLALCHEMY_DATABASE_URI = self._get_database_url()
1919
self.SQLALCHEMY_TRACK_MODIFICATIONS = False
20+
self.TEMPLATES_AUTO_RELOAD = True
2021

2122
if testing:
2223
self.TESTING = True

forms.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def validate_password(self, field):
3232

3333
class RegisterForm(Form):
3434
email = StringField('Email', validators=[InputRequired()])
35-
username = StringField('Username', validators=[InputRequired(), Length(min=4, max=128)])
36-
password = PasswordField('Password', validators=[InputRequired(), Length(min=8, max=56)])
35+
username = StringField('Username', validators=[InputRequired(), Length(min=4, max=16, message='Username must be between 4 and 16 characters long.')])
36+
password = PasswordField('Password', validators=[InputRequired(), Length(min=8, max=56, message='Password must be between 8 and 56 characters long.')])
3737

3838
def validate_email(self, field):
3939
if not util.validate_email_format(field.data):

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ bcrypt
33
Flask
44
Flask-Login
55
Flask-Migrate
6+
Flask-OAuthlib
67
Flask-Script
78
Flask-SQLAlchemy
89
Flask-WTF

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ apt-get -y upgrade
77
apt-get -y install python-dev python-pip libffi-dev
88
apt-get -y install postgresql postgresql-contrib libpq-dev
99

10-
pip install -r requirements.txt
10+
pip install -r /vagrant/requirements.txt

templates/events/manage.html

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h2 class="panel-title">Manage Event</h2>
4949
<label class="col-sm-3 control-label"></label>
5050
<div class="col-sm-9">
5151
<input type="submit" class="btn btn-success" value="Update"/>
52+
<a href="javascript:delete_event();" class="btn btn-danger btn-sm">Delete</a>
5253
</div>
5354
</div>
5455
</div>
@@ -67,4 +68,12 @@ <h4>How does this work?</h4>
6768
</div>
6869
</div>
6970
</div>
71+
72+
<script type="text/javascript">
73+
var delete_event = function() {
74+
if (confirm("Are you sure you want to delete this event?")) {
75+
76+
}
77+
};
78+
</script>
7079
{% endblock %}

templates/layout.html

+3-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<span class="icon-bar"></span>
2626
<span class="icon-bar"></span>
2727
</button>
28-
<!-- <a class="navbar-brand" href="/">CTF Calendar</a> -->
28+
<a class="navbar-brand" href="/">CTF Calendar</a>
2929
</div>
3030
<div id="navbar-content" class="collapse navbar-collapse">
3131
<ul class="nav navbar-nav">
@@ -54,7 +54,7 @@
5454
</ul>
5555
{% if current_user.is_authenticated %}
5656
<ul class="nav navbar-nav navbar-right">
57-
<li><a href="{{ url_for('events.events_create') }}">Add CTF</a></li>
57+
<li><a href="{{ url_for('events.events_create') }}">Create CTF</a></li>
5858
{% if current_user.admin == true %}
5959
<li class="dropdown">
6060
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"
@@ -97,19 +97,7 @@
9797
</div>
9898
{% endif %}
9999
{% endwith %}
100-
<div class="row">
101-
<div class="col-sm-3">
102-
<div id="sidebar" data-spy="affix">
103-
<div class="jumbotron">
104-
<h3 style="text-align:center;"><a href="/" style="text-decoration:none;"><i
105-
class="fa fa-fw fa-calendar"></i> Calendar</a></h3>
106-
</div>
107-
</div>
108-
</div>
109-
<div class="col-sm-9">
110-
{% block content %}{% endblock %}
111-
</div>
112-
</div>
100+
{% block content %}{% endblock %}
113101
</div>
114102
</body>
115103
</html>

0 commit comments

Comments
 (0)