diff --git a/CTFd/themes/admin/templates/teams/team.html b/CTFd/themes/admin/templates/teams/team.html index 6f8160b..9fb9d97 100644 --- a/CTFd/themes/admin/templates/teams/team.html +++ b/CTFd/themes/admin/templates/teams/team.html @@ -130,7 +130,7 @@
-
+
{% if solves %}
@@ -148,13 +148,13 @@
{% else %} -

+

No solves yet

{% endif %}
-
+

Team Members

@@ -209,7 +209,7 @@ aria-controls="nav-awards" aria-selected="false">Awards - \", '\", '\", \"\", \"\"].join(\"\");\n table.append(row);\n }\n });\n};\n\nvar createGraph = function createGraph() {\n _CTFd.default.api.get_scoreboard_detail({\n count: 10\n }).then(function (response) {\n var places = response.data;\n var teams = Object.keys(places);\n var traces = [];\n\n if (teams.length === 0) {\n // Replace spinner\n graph.html('

No solves yet

');\n return;\n }\n\n for (var i = 0; i < teams.length; i++) {\n var team_score = [];\n var times = [];\n\n for (var j = 0; j < places[teams[i]][\"solves\"].length; j++) {\n team_score.push(places[teams[i]][\"solves\"][j].value);\n var date = (0, _moment.default)(places[teams[i]][\"solves\"][j].date);\n times.push(date.toDate());\n }\n\n var trace = {\n x: times,\n y: (0, _utils.cumulativeSum)(team_score),\n mode: \"lines+markers\",\n name: places[teams[i]][\"name\"],\n marker: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n },\n line: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n }\n };\n traces.push(trace);\n }\n\n traces.sort(function (a, b) {\n var score_diff = b[\"y\"][b[\"y\"].length - 1] - a[\"y\"][a[\"y\"].length - 1];\n\n if (!score_diff) {\n return a[\"x\"][a[\"x\"].length - 1] - b[\"x\"][b[\"x\"].length - 1];\n }\n\n return score_diff;\n });\n graph.empty(); // Remove spinners\n\n graph[0].fn = \"CTFd_scoreboard_\" + new Date().toISOString().slice(0, 19);\n\n _plotly.default.newPlot(graph[0], traces, layout, config);\n });\n};\n\nvar updateGraph = function updateGraph() {\n _CTFd.default.api.get_scoreboard_detail({\n count: 10\n }).then(function (response) {\n var places = response.data;\n var teams = Object.keys(places);\n var traces = [];\n\n if (teams.length === 0) {\n return;\n }\n\n for (var i = 0; i < teams.length; i++) {\n var team_score = [];\n var times = [];\n\n for (var j = 0; j < places[teams[i]][\"solves\"].length; j++) {\n team_score.push(places[teams[i]][\"solves\"][j].value);\n var date = (0, _moment.default)(places[teams[i]][\"solves\"][j].date);\n times.push(date.toDate());\n }\n\n var trace = {\n x: times,\n y: (0, _utils.cumulativeSum)(team_score),\n mode: \"lines+markers\",\n name: places[teams[i]][\"name\"],\n marker: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n },\n line: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n }\n };\n traces.push(trace);\n }\n\n traces.sort(function (a, b) {\n var score_diff = b[\"y\"][b[\"y\"].length - 1] - a[\"y\"][a[\"y\"].length - 1];\n\n if (!score_diff) {\n return a[\"x\"][a[\"x\"].length - 1] - b[\"x\"][b[\"x\"].length - 1];\n }\n\n return score_diff;\n });\n\n _plotly.default.react(graph[0], traces, layout, config);\n });\n};\n\nfunction update() {\n updateScores();\n updateGraph();\n}\n\n(0, _jquery.default)(function () {\n setInterval(update, 300000); // Update scores every 5 minutes\n\n createGraph();\n updateGraph();\n});\n\n//# sourceURL=webpack:///./CTFd/themes/core/assets/js/pages/scoreboard.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/core/assets/js/pages/main.js\");\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! ../CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _plotly = _interopRequireDefault(__webpack_require__(/*! plotly.js-basic-dist */ \"./node_modules/plotly.js-basic-dist/plotly-basic.js\"));\n\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\n\nvar _utils = __webpack_require__(/*! ../utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar graph = (0, _jquery.default)(\"#score-graph\");\nvar table = (0, _jquery.default)(\"#scoreboard tbody\");\nvar config = {\n displaylogo: false,\n responsive: true\n};\nvar layout = {\n title: \"Top 10 \" + (window.userMode === \"teams\" ? \"Teams\" : \"Users\"),\n paper_bgcolor: \"rgba(0,0,0,0)\",\n plot_bgcolor: \"rgba(0,0,0,0)\",\n hovermode: \"closest\",\n xaxis: {\n showgrid: false,\n showspikes: true\n },\n yaxis: {\n showgrid: false,\n showspikes: true\n },\n legend: {\n orientation: \"h\"\n }\n};\n\nvar updateScores = function updateScores() {\n _CTFd.default.api.get_scoreboard_list().then(function (response) {\n var teams = response.data;\n table.empty();\n\n for (var i = 0; i < teams.length; i++) {\n var row = [\"\", '\", '\", \"\", \"\"].join(\"\");\n table.append(row);\n }\n });\n};\n\nvar createGraph = function createGraph() {\n _CTFd.default.api.get_scoreboard_detail({\n count: 10\n }).then(function (response) {\n var places = response.data;\n var teams = Object.keys(places);\n var traces = [];\n\n if (teams.length === 0) {\n // Replace spinner\n graph.html('

No solves yet

');\n return;\n }\n\n for (var i = 0; i < teams.length; i++) {\n var team_score = [];\n var times = [];\n\n for (var j = 0; j < places[teams[i]][\"solves\"].length; j++) {\n team_score.push(places[teams[i]][\"solves\"][j].value);\n var date = (0, _moment.default)(places[teams[i]][\"solves\"][j].date);\n times.push(date.toDate());\n }\n\n var trace = {\n x: times,\n y: (0, _utils.cumulativeSum)(team_score),\n mode: \"lines+markers\",\n name: places[teams[i]][\"name\"],\n marker: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n },\n line: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n }\n };\n traces.push(trace);\n }\n\n traces.sort(function (a, b) {\n var score_diff = b[\"y\"][b[\"y\"].length - 1] - a[\"y\"][a[\"y\"].length - 1];\n\n if (!score_diff) {\n return a[\"x\"][a[\"x\"].length - 1] - b[\"x\"][b[\"x\"].length - 1];\n }\n\n return score_diff;\n });\n graph.empty(); // Remove spinners\n\n graph[0].fn = \"CTFd_scoreboard_\" + new Date().toISOString().slice(0, 19);\n\n _plotly.default.newPlot(graph[0], traces, layout, config);\n });\n};\n\nvar updateGraph = function updateGraph() {\n _CTFd.default.api.get_scoreboard_detail({\n count: 10\n }).then(function (response) {\n var places = response.data;\n var teams = Object.keys(places);\n var traces = [];\n\n if (teams.length === 0) {\n return;\n }\n\n for (var i = 0; i < teams.length; i++) {\n var team_score = [];\n var times = [];\n\n for (var j = 0; j < places[teams[i]][\"solves\"].length; j++) {\n team_score.push(places[teams[i]][\"solves\"][j].value);\n var date = (0, _moment.default)(places[teams[i]][\"solves\"][j].date);\n times.push(date.toDate());\n }\n\n var trace = {\n x: times,\n y: (0, _utils.cumulativeSum)(team_score),\n mode: \"lines+markers\",\n name: places[teams[i]][\"name\"],\n marker: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n },\n line: {\n color: (0, _utils.colorHash)(places[teams[i]][\"name\"] + places[teams[i]][\"id\"])\n }\n };\n traces.push(trace);\n }\n\n traces.sort(function (a, b) {\n var score_diff = b[\"y\"][b[\"y\"].length - 1] - a[\"y\"][a[\"y\"].length - 1];\n\n if (!score_diff) {\n return a[\"x\"][a[\"x\"].length - 1] - b[\"x\"][b[\"x\"].length - 1];\n }\n\n return score_diff;\n });\n\n _plotly.default.react(graph[0], traces, layout, config);\n });\n};\n\nfunction update() {\n updateScores();\n updateGraph();\n}\n\n(0, _jquery.default)(function () {\n setInterval(update, 300000); // Update scores every 5 minutes\n\n createGraph();\n updateGraph();\n});\n\n//# sourceURL=webpack:///./CTFd/themes/core/assets/js/pages/scoreboard.js?"); /***/ }) diff --git a/CTFd/themes/core/templates/teams/private.html b/CTFd/themes/core/templates/teams/private.html index 4543fed..2b8e5ee 100644 --- a/CTFd/themes/core/templates/teams/private.html +++ b/CTFd/themes/core/templates/teams/private.html @@ -189,7 +189,7 @@
-
+

Members

', i + 1, \"'.format(_CTFd.default.config.urlRoot, teams[i].account_id), (0, _utils.htmlEntities)(teams[i].name), \"\", teams[i].score, \"
', i + 1, \"'.format(_CTFd.default.config.urlRoot, teams[i].account_id), (0, _utils.htmlEntities)(teams[i].name), \"\", teams[i].score, \"
@@ -290,7 +290,11 @@ {% else %} -

No solves yet

+
+

+ No solves yet +

+
{% endif %} {% endif %} diff --git a/CTFd/themes/core/templates/teams/public.html b/CTFd/themes/core/templates/teams/public.html index 531b997..77febfe 100644 --- a/CTFd/themes/core/templates/teams/public.html +++ b/CTFd/themes/core/templates/teams/public.html @@ -168,7 +168,11 @@ {% else %} -

No solves yet

+
+

+ No solves yet +

+
{% endif %} {% endif %} diff --git a/CTFd/themes/core/templates/users/private.html b/CTFd/themes/core/templates/users/private.html index 407b79a..dfc7019 100644 --- a/CTFd/themes/core/templates/users/private.html +++ b/CTFd/themes/core/templates/users/private.html @@ -172,7 +172,11 @@ {% else %} -

No solves yet

+
+

+ No solves yet +

+
{% endif %} {% endif %} diff --git a/CTFd/themes/core/templates/users/public.html b/CTFd/themes/core/templates/users/public.html index 4eac95e..da68cc7 100644 --- a/CTFd/themes/core/templates/users/public.html +++ b/CTFd/themes/core/templates/users/public.html @@ -175,7 +175,11 @@ {% else %} -

No solves yet

+
+

+ No solves yet +

+
{% endif %} {% endif %}