From 499fea902bacdf6dab5f1eefb353eff4067c3a15 Mon Sep 17 00:00:00 2001 From: h4ckd0tm3 Date: Fri, 9 Jun 2023 13:26:10 +0200 Subject: [PATCH 01/12] Migrate to Bootstrap 5 --- .../templates/ctfpad/challenges/create.html | 106 ++-- .../templates/ctfpad/challenges/detail.html | 393 ++++++++------- .../templates/ctfpad/challenges/import.html | 54 +- ctfpad/templates/ctfpad/ctfs/create.html | 126 ++--- ctfpad/templates/ctfpad/ctfs/detail.html | 434 +++++++++-------- .../ctfpad/ctfs/detail_challenges.html | 82 ++-- .../templates/ctfpad/dashboard/dashboard.html | 194 ++++---- ctfpad/templates/ctfpad/footer.html | 6 +- ctfpad/templates/ctfpad/main.html | 32 +- ctfpad/templates/ctfpad/navbar.html | 84 ++-- ctfpad/templates/ctfpad/shortcuts.html | 64 ++- ctfpad/templates/ctfpad/stats/detail.html | 117 +++-- .../snippets/quick_add_category.html | 4 +- ctfpad/templates/snippets/quick_add_file.html | 4 +- ctfpad/templates/snippets/quick_add_tag.html | 4 +- ctfpad/templates/team/create.html | 8 +- ctfpad/templates/team/edit.html | 76 ++- ctfpad/templates/users/detail.html | 461 +++++++++--------- ctfpad/templates/users/edit.html | 104 ++-- ctfpad/templates/users/edit_advanced.html | 40 +- .../users/edit_advanced_change_password.html | 38 +- ctfpad/templates/users/login.html | 10 +- ctfpad/templates/users/password_change.html | 8 +- ctfpad/templates/users/password_reset.html | 4 +- ctfpad/templates/users/register.html | 20 +- static/css/main-dark.css | 14 +- static/css/main-light.css | 11 +- 27 files changed, 1233 insertions(+), 1265 deletions(-) diff --git a/ctfpad/templates/ctfpad/challenges/create.html b/ctfpad/templates/ctfpad/challenges/create.html index 97a3b04..fbc6d91 100644 --- a/ctfpad/templates/ctfpad/challenges/create.html +++ b/ctfpad/templates/ctfpad/challenges/create.html @@ -32,11 +32,9 @@
-
- - - -
+ + + @@ -44,11 +42,9 @@
-
- - - -
+ + + @@ -56,12 +52,9 @@
-
- - - -
- + + +
@@ -93,11 +83,9 @@
{% if form.instance.creation_time %}
-
- - - -
+ + + @@ -106,11 +94,9 @@
{% if form.solvers %}
-
- - - -
+ + + @@ -136,11 +120,9 @@
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + + - Solved by {{challenge.solvers.all|join:", "}} at {{challenge.solved_time}} UTC - {% else %} -
- {% csrf_token %} - - - -
- {% endif %} +
+ +
+
+ {% if challenge.status == "solved" %} + + Solved by {{ challenge.solvers.all|join:", " }} at {{ challenge.solved_time }} + UTC + {% else %} +
+ {% csrf_token %} + + + +
+ {% endif %} +
-
-
- - Add a file - - - - - - - - - - - {% for file in challenge.files %} - - - - - - + + {% endfor %} +
FileTypeSize
- - - {{file.name}} - - - - - - {{file.mime}} - - - {{file.size | filesizeformat}} - +
+ +
Add a + file + + + + + + + + + + + {% for file in challenge.files %} + + + + + + + + - - - {% endfor %} -
FileTypeSize
+ + + {{ file.name }} + + + + + + {{ file.mime }} + + + {{ file.size | filesizeformat }} + - - - + + - -
+ +
+
-
-
-
-
- +
+
+
+ +
-
- -{% if request.user.member.hedgedoc_password %} - -{% endif %} - -{% include 'snippets/quick_add_file.html' with challenge=challenge %} + + {% if request.user.member.hedgedoc_password %} + + {% endif %} + + {% include 'snippets/quick_add_file.html' with challenge=challenge %} {% endblock %} diff --git a/ctfpad/templates/ctfpad/challenges/import.html b/ctfpad/templates/ctfpad/challenges/import.html index 247c44f..2b2925f 100644 --- a/ctfpad/templates/ctfpad/challenges/import.html +++ b/ctfpad/templates/ctfpad/challenges/import.html @@ -1,4 +1,5 @@ {% extends 'ctfpad/main.html' %} +{% load static %} {% block content %}
@@ -40,65 +41,34 @@
-
-
+ required>{% if form.data.value %}{{ form.data.value }}{% endif %}
+
- - - + {% endblock %} diff --git a/ctfpad/templates/ctfpad/ctfs/create.html b/ctfpad/templates/ctfpad/ctfs/create.html index 2e8eb0c..1d7261e 100644 --- a/ctfpad/templates/ctfpad/ctfs/create.html +++ b/ctfpad/templates/ctfpad/ctfs/create.html @@ -29,11 +29,9 @@
-
- - - -
+ + + @@ -41,11 +39,9 @@
-
- - - -
+ + + @@ -53,26 +49,20 @@
-
- - - -
+ + + + class="form-control">{% if form.description.value %}{{ form.description.value }}{% endif %}
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + +
-
- - - -
+ + + @@ -188,11 +163,9 @@
href="{{ team.ctftime_url }}" target="_blank">
-
- - - -
+ + + @@ -203,18 +176,21 @@
diff --git a/ctfpad/templates/ctfpad/ctfs/detail.html b/ctfpad/templates/ctfpad/ctfs/detail.html index 93a6289..ecfd38a 100644 --- a/ctfpad/templates/ctfpad/ctfs/detail.html +++ b/ctfpad/templates/ctfpad/ctfs/detail.html @@ -1,96 +1,107 @@ -{% extends 'ctfpad/main.html' %} +{% extends 'ctfpad/main.html' %} {% block content %} -{% include 'ctfpad/ctfs/status.html' %} - -
- -{% include 'snippets/messages.html' %} - -{% load humanize %} -{% load ctfpad_filters %} - -
-
-
{{ctf.name | upper}}
-
-
-
-
- {% if request.user.member.selected_ctf.id == ctf.id %} - - {% else %} - {% if ctf.is_finished %} - - {% else %} -
- {% csrf_token %} - - -
- {% endif %} - {% endif %} -
- -
+ {% include 'ctfpad/ctfs/status.html' %} -
    -
  • -
    -
    - {{ctf.name|lower}} avatar -
    +
    -
    - {% autoescape off %} - {{ctf.description|html_sanitize|truncatewords:25}} - {% endautoescape %} -
    -
    -
  • + {% include 'snippets/messages.html' %} - {% if ctf.team|length > 0 %} -
  • -
    -
    - -
    -
    - {% for member in ctf.team %} - {{member.username}},  - {% endfor %} + {% load humanize %} + {% load ctfpad_filters %} + +
    +
    +
    {{ ctf.name | upper }}
    +
    +
    +
    +
    + {% if request.user.member.selected_ctf.id == ctf.id %} +
    + +
    + {% else %} + {% if ctf.is_finished %} +
    + +
    + {% else %} +
    + {% csrf_token %} + +
    + +
    +
    + {% endif %} + {% endif %} +
    + -
  • - {% endif %} +
- {% if ctf.team_login %} -
  • -
    -
    - +
      +
    • +
      +
      + {{ ctf.name|lower }} avatar +
      + +
      + {% autoescape off %} + {{ ctf.description|html_sanitize|truncatewords:25 }} + {% endautoescape %} +
      -
      - {{ctf.team_login}} / {{ctf.team_password}} -   - +
      +
      + +
      +
      + {% for member in ctf.team %} + {{ member.username }},  + {% endfor %} +
      +
      +
    • + {% endif %} + + {% if ctf.team_login %} +
    • +
      +
      + +
      +
      + {{ ctf.team_login }} / {{ ctf.team_password }} +   + -
      -
      -
    • - {% endif %} + > +
    +
    +
  • + {% endif %} - {% if not ctf.is_permanent %} -
  • -
    -
    -   -
    + {% if not ctf.is_permanent %} +
  • +
    +
    +   +
    -
    - {{ctf.start_date | date:"Y/m/d H:i"}} -    - {{ctf.end_date | date:"Y/m/d H:i"}} -
    -
    -
  • +
    + {{ ctf.start_date | date:"Y/m/d H:i" }} +    + {{ ctf.end_date | date:"Y/m/d H:i" }} +
    +
    + -
  • -
    -
    - -
    -
    - {{ ctf.duration | naturaltime}} -
    -
    -
  • - {% endif %} +
  • +
    +
    + +
    +
    + {{ ctf.duration | naturaltime }} +
    +
    +
  • + {% endif %} - {% if ctf.flag_prefix %} -
  • -
    -
    - -
    + {% if ctf.flag_prefix %} +
  • +
    +
    + +
    -
    - {{ctf.flag_prefix}} -
    -
    -
  • - {% endif %} +
    + {{ ctf.flag_prefix }} +
    +
    + + {% endif %} -
  • -
    -
    - +
  • +
    +
    + +
    +
    + {{ ctf.weight }}   + {% if ctf.weight <= 10 %} + Casual CTF + {% elif ctf.weight <= 35 %} + Minor CTF + {% elif ctf.weight <= 70 %} + Important CTF + {% elif ctf.weight <= 95 %} + Major CTF + {% elif ctf.weight <= 100 %} + Unmissable CTF + {% endif %} +
    -
    - {{ctf.weight}}   - {% if ctf.weight <= 10 %} - Casual CTF - {% elif ctf.weight <= 35 %} - Minor CTF - {% elif ctf.weight <= 70 %} - Important CTF - {% elif ctf.weight <= 95 %} - Major CTF - {% elif ctf.weight <= 100 %} - Unmissable CTF - {% endif %} -
    -
  • - + -
  • -
    -
    - -
    +
  • +
    +
    + +
    -
    - {% if ctf.url %} - Website  |  - {% endif %} +
    + {% if ctf.url %} + Website  |  + {% endif %} - {% if ctf.ctftime_id %} - CTFTime  |  - {% endif %} + {% if ctf.ctftime_id %} + CTFTime  |  + {% endif %} - - Jitsi  - + + Jitsi  + +
    -
    +
  • + +
    +
    + + -
    -
    - - -
    -
    - {% include 'ctfpad/ctfs/detail_challenges.html' %} -
    -
    - {% include 'ctfpad/ctfs/detail_notes.html' %} -
    -
    - {% include 'ctfpad/stats/ctf_stats.html' %} -
    -
    - {% include 'ctfpad/ctfs/detail_export.html' %} +
    +
    + {% include 'ctfpad/ctfs/detail_challenges.html' %} +
    +
    + {% include 'ctfpad/ctfs/detail_notes.html' %} +
    +
    + {% include 'ctfpad/stats/ctf_stats.html' %} +
    +
    + {% include 'ctfpad/ctfs/detail_export.html' %} +
    -
    -
    -