mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Fix hardcoded value
This commit is contained in:
@@ -106,7 +106,9 @@ def challenges_preview(challenge_id):
|
|||||||
attempts=0,
|
attempts=0,
|
||||||
challenge=challenge,
|
challenge=challenge,
|
||||||
)
|
)
|
||||||
return render_template("admin/challenges/preview.html", content=content)
|
return render_template(
|
||||||
|
"admin/challenges/preview.html", content=content, challenge=challenge
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/admin/challenges/new")
|
@admin.route("/admin/challenges/new")
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{% extends "page.html" %}
|
{% extends "page.html" %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
<script>
|
||||||
|
var CHALLENGE_ID = {{ challenge.id }};
|
||||||
|
</script>
|
||||||
{% if "beta" in Configs.ctf_theme %}
|
{% if "beta" in Configs.ctf_theme %}
|
||||||
{{ Assets.js("assets/js/challenges.js") }}
|
{{ Assets.js("assets/js/challenges.js") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -127,7 +130,7 @@
|
|||||||
|
|
||||||
CTFd._internal.challenge = {};
|
CTFd._internal.challenge = {};
|
||||||
$.get(
|
$.get(
|
||||||
CTFd.config.urlRoot + "/api/v1/challenges/1",
|
CTFd.config.urlRoot + "/api/v1/challenges/" + window.CHALLENGE_ID,
|
||||||
function (response) {
|
function (response) {
|
||||||
// Preview should not show any solves
|
// Preview should not show any solves
|
||||||
var challenge_data = response.data;
|
var challenge_data = response.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user