From fb4d028af6608be00a4aa8b7d587bdfb580bf34b Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sun, 8 Sep 2024 10:50:44 +0200 Subject: [PATCH] refactor(meta): use template inheritance #9 --- data/www/admin/details.html | 297 +++++++++++------------------------- data/www/admin/index.html | 175 ++++----------------- data/www/base.html | 127 +++++++++++++++ data/www/details.html | 272 +++++++++------------------------ data/www/index.html | 180 ++++------------------ src/meta/admin.rs | 4 +- src/meta/errors.rs | 5 +- src/meta/mod.rs | 1 + src/meta/user.rs | 4 +- 9 files changed, 352 insertions(+), 713 deletions(-) create mode 100644 data/www/base.html diff --git a/data/www/admin/details.html b/data/www/admin/details.html index 5292743..bc3df0a 100644 --- a/data/www/admin/details.html +++ b/data/www/admin/details.html @@ -1,220 +1,97 @@ - - +{% extends "base" %} +{% block main %} +

{{title}}

+

+ You have reached the {{title}}. This site can be used by + the host of the challenge to see the challenge progress, solution, and + hints for that challenge. This site is NOT part of the + challenge. +

- - +
- - - - {{title}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bootstrap - - - - - - - +
+

Solution

+ +
+

+ + + + {{challenge_solution}} +

+
+
+ + +
+ +
+
+

Contestants

+

+ There are cuttently {{ contestants_amount }} contestants. + These contestants currently have had at least one connection to + the challenge: +

+
    + {% for contestant in contestants %}
  • - -
  • -
  • - -
  • -
  • - + {{ contestant.ip }} +
  • + {% endfor %}
- -
-
- - - - - {{title}} - -
- -
-

{{title}} Admin Interface

-

- You have reached the {{title}} Admin Interface. This site can be used by - the host of the challenge to see the challenge progress, solution, and - hints for that challenge. This site is NOT part of the - challenge. -

- -
- -
-

Challenge {{ challenge_idx}} — {{ challenge_title }}

-

{{ challenge_description }}

-
-

Hints

- -
-
    - {% for hint in challenge_hints %} -
  • -

    - - - - {{hint}} -

    -
  • - {% endfor %} -
-
-
-
-

Solution

- -
-

- - - - {{challenge_solution}} -

-
-
-
- -
- -
-
-

Contestants

-

- There are cuttently {{ contestants_amount }} contestants. - These contestants currently have had at least one connection to - the challenge: -

- -
- -
-

Winners

-

- There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the secret: -

- -
-
-
-
- Created by {{ author }} © {{year}} -
+
+

Winners

+

+ There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the secret: +

+
- - - - - +
+{% endblock %} diff --git a/data/www/admin/index.html b/data/www/admin/index.html index 534b920..bdb0f33 100644 --- a/data/www/admin/index.html +++ b/data/www/admin/index.html @@ -1,157 +1,34 @@ - - +{% extends "base" %} +{% block main %} +

{{title}}

+

+ You have reached the {{title}}. This site can be used by + the host of the challenge to see the challenge progress, solution, and + hints for that challenge. This site is NOT part of the + challenge. +

- - +
- - - - {{title}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bootstrap - - - - - - - + +
+ +
+
+

Contestants

+

+ There are cuttently {{ contestants_amount }} contestants. + These contestants currently have had at least one connection to + the challenge: +

+
    + {% for contestant in contestants %}
  • - -
  • -
  • - -
  • -
  • - + {{ contestant.ip }} +
  • + {% endfor %}
- -
-
- - - - - {{title}} - -
- -
-

{{title}} User Interface

-

- You have reached the {{title}} User - Interface. This site can be used by the - contestants see the challenges and their - progress and hints for that challenge. This - site is NOT part of the challenge. -

- -
- -
-

Challenge {{ challenge_idx}} — {{ challenge_title }}

-

{{ challenge_description }}

-
-

Hints

- -
-
    - {% for hint in challenge_hints %} -
  • -

    - - - - {{hint}} -

    -
  • - {% endfor %} -
-
-
-
- -
- -
-
-

Contestants

-

- There are cuttently {{ contestants_amount }} contestants. - These contestants currently have had at least one connection to - the challenge: -

- -
- -
-

Winners

-

- There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the - secret: -

- -
-
-
-
- Created by {{ author }} © {{year}} -
+
+

Winners

+

+ There are cuttently {{ winners_amount }} winners. These contestants currently have been sent the + secret: +

+
- - - - - +
+{% endblock %} diff --git a/data/www/index.html b/data/www/index.html index 4bc8808..be7412e 100644 --- a/data/www/index.html +++ b/data/www/index.html @@ -1,158 +1,34 @@ - - - - - - - - - - {{title}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bootstrap - - - - - - -