diff --git a/CTFd/plugins/insanity_check/README.md b/CTFd/plugins/insanity_check/README.md new file mode 100644 index 0000000000..30d74d2584 --- /dev/null +++ b/CTFd/plugins/insanity_check/README.md @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/CTFd/plugins/insanity_check/__init__.py b/CTFd/plugins/insanity_check/__init__.py new file mode 100644 index 0000000000..e0ec765c08 --- /dev/null +++ b/CTFd/plugins/insanity_check/__init__.py @@ -0,0 +1,39 @@ +from flask import Blueprint + +from CTFd.models import ( + ChallengeFiles, + Challenges, + Fails, + Flags, + Hints, + Solves, + Tags, + db, +) +from CTFd.plugins import register_plugin_assets_directory +from CTFd.plugins.challenges import CHALLENGE_CLASSES, BaseChallenge + +class InsaneChallenge(BaseChallenge): + id = "insane" # Unique identifier used to register challenges + name = "insane" # Name of a challenge type + + # locations of the html templates + templates = { # Handlebars templates used for each aspect of challenge editing & viewing + 'create': '/plugins/insanity_check/assets/create.html', + 'update': '/plugins/insanity_check/assets/update.html', + 'view': '/plugins/insanity_check/assets/view.html', + } + + # location of the JavaScript files + scripts = { # Scripts that are loaded when a template is loaded + 'create': '/plugins/insanity_check/assets/create.js', + 'update': '/plugins/insanity_check/assets/update.js', + 'view': '/plugins/insanity_check/assets/view.js', + } + + challenge_model = Challenges + +CHALLENGE_CLASSES["insane"] = InsaneChallenge + +def load(app): + register_plugin_assets_directory(app, base_path='/plugins/insanity_check/assets/') \ No newline at end of file diff --git a/CTFd/plugins/insanity_check/assets/create.html b/CTFd/plugins/insanity_check/assets/create.html new file mode 100644 index 0000000000..dd985c3630 --- /dev/null +++ b/CTFd/plugins/insanity_check/assets/create.html @@ -0,0 +1 @@ +{% extends "admin/challenges/create.html" %} \ No newline at end of file diff --git a/CTFd/plugins/insanity_check/assets/create.js b/CTFd/plugins/insanity_check/assets/create.js new file mode 100644 index 0000000000..5ba26b2a1b --- /dev/null +++ b/CTFd/plugins/insanity_check/assets/create.js @@ -0,0 +1,4 @@ +CTFd.plugin.run((_CTFd) => { + const $ = _CTFd.lib.$ + const md = _CTFd.lib.markdown() +}) \ No newline at end of file diff --git a/CTFd/plugins/insanity_check/assets/update.html b/CTFd/plugins/insanity_check/assets/update.html new file mode 100644 index 0000000000..faec1b7957 --- /dev/null +++ b/CTFd/plugins/insanity_check/assets/update.html @@ -0,0 +1,3 @@ +{% extends "admin/challenges/update.html" %} + +