From 135b7144796b81693c35b9744f240063484f8284 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sat, 29 Apr 2017 23:45:08 -0400 Subject: [PATCH] Some styling updates --- CTFd/templates/admin/base.html | 4 +-- CTFd/templates/original/errors/403.html | 5 +-- CTFd/templates/original/errors/404.html | 5 +-- CTFd/templates/original/errors/500.html | 3 +- CTFd/templates/original/errors/502.html | 3 +- CTFd/templates/original/setup.html | 7 +--- ...dds_challenge_types_and_uses_keys_table.py | 32 +++++++++---------- 7 files changed, 29 insertions(+), 30 deletions(-) diff --git a/CTFd/templates/admin/base.html b/CTFd/templates/admin/base.html index 6395796..5a215ec 100644 --- a/CTFd/templates/admin/base.html +++ b/CTFd/templates/admin/base.html @@ -67,13 +67,13 @@
- {% block content %} + {% block content %} {% endblock %}
- + diff --git a/CTFd/templates/original/errors/403.html b/CTFd/templates/original/errors/403.html index 6bd6bb8..2db93db 100644 --- a/CTFd/templates/original/errors/403.html +++ b/CTFd/templates/original/errors/403.html @@ -3,8 +3,9 @@ {% block content %}
-

I don't think you're allowed here

-

Not so sorry about that

+

403

+

An authorization error has occured

+

Please try again

diff --git a/CTFd/templates/original/errors/404.html b/CTFd/templates/original/errors/404.html index ee45ffc..dc85120 100644 --- a/CTFd/templates/original/errors/404.html +++ b/CTFd/templates/original/errors/404.html @@ -3,8 +3,9 @@ {% block content %}
-

Whoops, looks like we can't find that.

-

Sorry about that

+

404

+

Whoops, looks like we can't find that.

+

Sorry about that

diff --git a/CTFd/templates/original/errors/500.html b/CTFd/templates/original/errors/500.html index 1b776fe..6683516 100644 --- a/CTFd/templates/original/errors/500.html +++ b/CTFd/templates/original/errors/500.html @@ -3,7 +3,8 @@ {% block content %}
-

Uhh what did you just do?

+

500

+

An Internal Server Error has occured

diff --git a/CTFd/templates/original/errors/502.html b/CTFd/templates/original/errors/502.html index 8c10db5..b15e9cc 100644 --- a/CTFd/templates/original/errors/502.html +++ b/CTFd/templates/original/errors/502.html @@ -3,7 +3,8 @@ {% block content %}
-

That action isn't allowed

+

502

+

That action isn't allowed

diff --git a/CTFd/templates/original/setup.html b/CTFd/templates/original/setup.html index 63f1910..a20d8f4 100644 --- a/CTFd/templates/original/setup.html +++ b/CTFd/templates/original/setup.html @@ -48,16 +48,11 @@
- - -
-
-
+
- {% endblock %} diff --git a/migrations/versions/87733981ca0e_adds_challenge_types_and_uses_keys_table.py b/migrations/versions/87733981ca0e_adds_challenge_types_and_uses_keys_table.py index 39ab5ef..cf8e4b0 100644 --- a/migrations/versions/87733981ca0e_adds_challenge_types_and_uses_keys_table.py +++ b/migrations/versions/87733981ca0e_adds_challenge_types_and_uses_keys_table.py @@ -30,16 +30,16 @@ def upgrade(): # ### commands auto generated by Alembic - please adjust! ### ## Copy over flags data to Keys table - print("Getting bind...") + # print("Getting bind...") conn = op.get_bind() - print("Executing: SELECT id, flags from challenges") + # print("Executing: SELECT id, flags from challenges") res = conn.execute(text("SELECT id, flags from challenges")) results = res.fetchall() - print("There are {} results".format(len(results))) + # print("There are {} results".format(len(results))) new_keys = [] - print("Processing existing flags") + # print("Processing existing flags") for r in results: if r[1]: ## Check if flags are NULL data = json.loads(r[1]) @@ -48,48 +48,48 @@ def upgrade(): if new_keys: ## Base CTFd databases actually already insert into Keys but the database does not make use of them ## This prevents duplicate entries of keys - print("Executing: TRUNCATE keys") + # print("Executing: TRUNCATE keys") conn.execute(text("TRUNCATE `keys`")) print("Bulk inserting the keys") op.bulk_insert(keys_table, new_keys) ## Add type column to challenges - print("Adding type column to challenges") + # print("Adding type column to challenges") op.add_column('challenges', sa.Column('type', sa.Integer(), nullable=True, default=0)) ## Set all NULLs to 0 - print("Setting all NULLs to 0") + # print("Setting all NULLs to 0") conn.execute("UPDATE challenges set type=0 WHERE type IS NULL") ## Drop flags from challenges - print("Dropping flags column from challenges") + # print("Dropping flags column from challenges") try: op.drop_column('challenges', 'flags') except sa.exc.OperationalError: print("Failed to drop flags. Likely due to SQLite") - print("Finished") + # print("Finished") # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - print("Getting bind...") + # print("Getting bind...") conn = op.get_bind() - print("Adding flags column back to challenges table") + # print("Adding flags column back to challenges table") op.add_column('challenges', sa.Column('flags', sa.TEXT(), nullable=True)) - print("Dropping type column from challenges table") + # print("Dropping type column from challenges table") op.drop_column('challenges', 'type') - print("Executing: SELECT id, flags from challenges") + # print("Executing: SELECT id, flags from challenges") res = conn.execute("SELECT id, flags from challenges") results = res.fetchall() - print("There are {} results".format(len(results))) + # print("There are {} results".format(len(results))) for chal_id in results: new_keys = Keys.query.filter_by(chal=chal_id[0]).all() old_flags = [] @@ -97,8 +97,8 @@ def downgrade(): flag_dict = {'flag': new_key.flag, 'type': new_key.key_type} old_flags.append(flag_dict) old_flags =json.dumps(old_flags) - print("Updating challenge {} to insert {}".format(chal_id[0], flag_dict)) + # print("Updating challenge {} to insert {}".format(chal_id[0], flag_dict)) conn.execute(text('UPDATE challenges SET flags=:flags WHERE id=:id'), id=chal_id[0], flags=old_flags) - print("Finished") + # print("Finished") # ### end Alembic commands ###