diff --git a/CTFd/plugins/ctfd-event-countdown/__init__.py b/CTFd/plugins/ctfd-event-countdown/__init__.py index 88767afffee0536ec35f0a108ee32273c8523e81..f41fc0d353761638195967acd8afb584a6f972dd 100644 --- a/CTFd/plugins/ctfd-event-countdown/__init__.py +++ b/CTFd/plugins/ctfd-event-countdown/__init__.py @@ -8,6 +8,7 @@ def load(app): app.jinja_env.globals.update(ctf_starts_in=ctf_starts_in) app.jinja_env.globals.update(ctf_ends_in=ctf_ends_in) app.jinja_env.globals.update(ctf_total_time=ctf_total_time) + app.jinja_env.globals.update(ctf_start_time=ctf_start_time) def ctf_starts_in(): """ If the CTF has a start time, returns number of seconds before CTF starts. Returns 0 otherwise. """ @@ -31,4 +32,7 @@ def ctf_ends_in(): def ctf_total_time(): - return int(utils.get_config("end")) - int(utils.get_config("start")) \ No newline at end of file + return int(utils.get_config("end")) - int(utils.get_config("start")) + +def ctf_start_time(): + return int(utils.get_config("start")) \ No newline at end of file diff --git a/CTFd/plugins/ctfd-event-countdown/assets/countdown.js b/CTFd/plugins/ctfd-event-countdown/assets/countdown.js index 7f5e32dd9362664bc855076eb846f4388e44e443..6b45df910a9b977a3b49bf3d9c5f4db462529c25 100644 --- a/CTFd/plugins/ctfd-event-countdown/assets/countdown.js +++ b/CTFd/plugins/ctfd-event-countdown/assets/countdown.js @@ -2,8 +2,6 @@ var now = Date.now(); var f = (element, prefix) => { - - var day = element.getElementsByClassName("countdown-title")[0]; day.textContent = `${prefix.day} ${prefix.month}`; diff --git a/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js b/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js index 5b0829f56b64cc39b26482fc11846b254fee547d..a52ecda7f587f7d285325d08ac15275d65f36b52 100644 --- a/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js +++ b/CTFd/themes/core-beta/assets/js/utils/graphs/echarts/scoreboard.js @@ -1,6 +1,7 @@ import { colorHash } from "@ctfdio/ctfd-js/ui"; import dayjs from "dayjs"; + export function cumulativeSum(arr) { let result = arr.concat(); for (let i = 0; i < arr.length; i++) { @@ -157,7 +158,16 @@ export function getTenLast(places, standings, dictIdChallenge){ } export function getTimeStamp(challengeDate){ - let timeBetween = dayjs() - dayjs(challengeDate); + console.log(challengeDate); + const dateOfChallenge = new Date(challengeDate); + const timestampInSeconds = Math.floor(dateOfChallenge.getTime() / 1000); + console.log(timestampInSeconds); + + const startTime = document.getElementsByName("start_time")[0].content + let secondsBetweenPostAndStartTime = Math.floor((timestampInSeconds-startTime)); + console.log( "real tinhg", secondsToYearDate(secondsBetweenPostAndStartTime,document.getElementsByName("total_time")[0].content)); + const date = secondsToYearDate(secondsBetweenPostAndStartTime,document.getElementsByName("total_time")[0].content); + return `${date.day} ${date.month}`; ; if (timeBetween/(1000*60*60*24) >= 1){ //avant il y avait les il y a return "il y a " + Math.floor(timeBetween/(1000*60*60*24)) + " jours"; @@ -180,3 +190,57 @@ export function dictUserIdToUserName(members){ } return output; } + +function secondsToYearDate(seconds, totalSeconds) { + if (seconds < 0){ + return { + day: "1", + month: "janvier" + }; + } else if (seconds > totalSeconds){ + return { + day: "", + month: "" + }; + } + // Vérifier que les secondes sont dans une plage valide + + // Calculer le jour de l'année (de 1 à 365) + // On inverse PAS le calcul car on veut commencer par le 1er janvier quand on a le maximum de secondes + const dayOfYear = Math.floor((seconds / totalSeconds * 365))+1; + + // Définir les mois et leur nombre de jours + const months = [ + { name: "janvier", days: 31 }, + { name: "février", days: 28 }, // On simplifie en ignorant les années bissextiles + { name: "mars", days: 31 }, + { name: "avril", days: 30 }, + { name: "mai", days: 31 }, + { name: "juin", days: 30 }, + { name: "juillet", days: 31 }, + { name: "août", days: 31 }, + { name: "septembre", days: 30 }, + { name: "octobre", days: 31 }, + { name: "novembre", days: 30 }, + { name: "décembre", days: 31 } + ]; + + // Déterminer le mois et le jour du mois + let dayCount = 0; + let monthIndex = 0; + let dayOfMonth = 0; + + for (let i = 0; i < months.length; i++) { + if (dayCount + months[i].days >= dayOfYear) { + monthIndex = i; + dayOfMonth = dayOfYear - dayCount; + break; + } + dayCount += months[i].days; + } + + return { + day: dayOfMonth, + month: months[monthIndex].name + }; +} diff --git a/CTFd/themes/core-beta/static/assets/index.84adcd49.js b/CTFd/themes/core-beta/static/assets/index.84adcd49.js deleted file mode 100644 index 938bb4e7a9c72dde21d12c21f11bd7e24e7fa490..0000000000000000000000000000000000000000 --- a/CTFd/themes/core-beta/static/assets/index.84adcd49.js +++ /dev/null @@ -1 +0,0 @@ -import{d as h}from"./index.1f9008f6.js";import{u as _,i as y,a as $,b,c as v,d as k,e as T,f as x,g as j,h as L,j as w,k as M,l as O,m as S}from"./echarts.54e741c1.js";function N(n){let e=n.concat();for(let a=0;a<n.length;a++)e[a]=n.slice(0,a+1).reduce(function(i,l){return i+l});return e}function B(n){let e=[];if(n.length>0)for(let i=0;i<n.length;i++){let l=n[i];if(e.length==0)e.push(l);else for(let u=e.length;u>0;u--)if(p(l)>p(e[u-1])){let f=e[u-1];e[u-1]=l,e[u]=f}else if(u==e.length){e.push(l);break}}let a={};for(let i=0;i<e.length;i++)e[i].pos=i+1,a[i]=e[i];return a}function p(n){let e=n.score+n.potential_score;return n.potential_score==0&&(e+=.1),e}function E(n,e,a){const i=Object.keys(n);let l=[],u=999;for(let f=0;f<(i.length>=u?u:i.length);f++){let o=n[i[f]].solves,r=n[i[f]].fails,g=U(e[f].members);for(let t=0;t<o.length;t++){let c=o[t].date;o[t].team_name=n[i[f]].name,o[t].user_name=g[o[t].user_id],o[t].challenge_name=a[o[t].challenge_id],o[t].challenge_name||(o[t].challenge_name=o[t].challenge_id),o[t].time=d(c),o[t].color=e[f].color;for(let s=l.length;s>0;s--)if(h(c)>h(l[s-1].date)){let m=l[s-1];l[s-1]=o[t],s<u&&(l[s]=m)}else if(l.length<u&&l.length==s){l.push(o[t]);break}else break;l.length==0&&l.push(o[t])}for(let t=0;t<r.length;t++)if(r[t].type=="manual"||r[t].type=="manualRecursive"||r[t].type=="flash"||r[t].type=="sport"){let c=r[t].date;r[t].team_name=n[i[f]].name,r[t].user_name=g[r[t].user_id],r[t].challenge_name=a[r[t].challenge_id],r[t].time=d(c),r[t].color=e[f].color;for(let s=l.length;s>0;s--)if(h(c)>h(l[s-1].date)){let m=l[s-1];l[s-1]=r[t],s<u&&(l[s]=m)}else if(l.length<u&&l.length==s){l.push(r[t]);break}else break;l.length==0&&l.push(r[t])}}return l}function d(n){let e=h()-h(n);return e/(1e3*60*60*24)>=1?"il y a "+Math.floor(e/(1e3*60*60*24))+" jours":e/(1e3*60*60)>=1?"il y a "+Math.floor(e/(1e3*60*60))+" heures":e/(1e3*60)>=1?"il y a "+Math.floor(e/(1e3*60))+" minutes":"\xE0 l'instant"}function U(n){let e={};for(let a=0;a<n.length;a++)e[n[a].id]=n[a].name;return e}_([y,$,b,v,k,T,x,j,L,w,M,O]);function I(n,e){let a=S(n);a.setOption(e),window.addEventListener("resize",()=>{a&&a.resize()})}export{N as c,I as e,E as g,B as t}; diff --git a/CTFd/themes/core-beta/static/assets/index.9da342e5.js b/CTFd/themes/core-beta/static/assets/index.9da342e5.js new file mode 100644 index 0000000000000000000000000000000000000000..12231c4ab491c27ada827e869d271f18ed43e625 --- /dev/null +++ b/CTFd/themes/core-beta/static/assets/index.9da342e5.js @@ -0,0 +1 @@ +import{d as c}from"./index.1f9008f6.js";import{u as _,i as b,a as v,b as $,c as T,d as k,e as j,f as x,g as O,h as N,j as w,k as B,l as E,m as L}from"./echarts.54e741c1.js";function I(a){let n=a.concat();for(let s=0;s<a.length;s++)n[s]=a.slice(0,s+1).reduce(function(l,e){return l+e});return n}function U(a){let n=[];if(a.length>0)for(let l=0;l<a.length;l++){let e=a[l];if(n.length==0)n.push(e);else for(let i=n.length;i>0;i--)if(g(e)>g(n[i-1])){let u=n[i-1];n[i-1]=e,n[i]=u}else if(i==n.length){n.push(e);break}}let s={};for(let l=0;l<n.length;l++)n[l].pos=l+1,s[l]=n[l];return s}function g(a){let n=a.score+a.potential_score;return a.potential_score==0&&(n+=.1),n}function z(a,n,s){const l=Object.keys(a);let e=[],i=999;for(let u=0;u<(l.length>=i?i:l.length);u++){let o=a[l[u]].solves,m=a[l[u]].fails,d=M(n[u].members);for(let t=0;t<o.length;t++){let f=o[t].date;o[t].team_name=a[l[u]].name,o[t].user_name=d[o[t].user_id],o[t].challenge_name=s[o[t].challenge_id],o[t].challenge_name||(o[t].challenge_name=o[t].challenge_id),o[t].time=y(f),o[t].color=n[u].color;for(let r=e.length;r>0;r--)if(c(f)>c(e[r-1].date)){let h=e[r-1];e[r-1]=o[t],r<i&&(e[r]=h)}else if(e.length<i&&e.length==r){e.push(o[t]);break}else break;e.length==0&&e.push(o[t])}for(let t=0;t<m.length;t++)if(m[t].type=="manual"||m[t].type=="manualRecursive"||m[t].type=="flash"||m[t].type=="sport"){let f=m[t].date;m[t].team_name=a[l[u]].name,m[t].user_name=d[m[t].user_id],m[t].challenge_name=s[m[t].challenge_id],m[t].time=y(f),m[t].color=n[u].color;for(let r=e.length;r>0;r--)if(c(f)>c(e[r-1].date)){let h=e[r-1];e[r-1]=m[t],r<i&&(e[r]=h)}else if(e.length<i&&e.length==r){e.push(m[t]);break}else break;e.length==0&&e.push(m[t])}}return e}function y(a){console.log(a);const n=new Date(a),s=Math.floor(n.getTime()/1e3);console.log(s);const l=document.getElementsByName("start_time")[0].content;let e=Math.floor(s-l);console.log("real tinhg",p(e,document.getElementsByName("total_time")[0].content));const i=p(e,document.getElementsByName("total_time")[0].content);return`${i.day} ${i.month}`}function M(a){let n={};for(let s=0;s<a.length;s++)n[a[s].id]=a[s].name;return n}function p(a,n){if(a<0)return{day:"1",month:"janvier"};if(a>n)return{day:"",month:""};const s=Math.floor(a/n*365)+1,l=[{name:"janvier",days:31},{name:"f\xE9vrier",days:28},{name:"mars",days:31},{name:"avril",days:30},{name:"mai",days:31},{name:"juin",days:30},{name:"juillet",days:31},{name:"ao\xFBt",days:31},{name:"septembre",days:30},{name:"octobre",days:31},{name:"novembre",days:30},{name:"d\xE9cembre",days:31}];let e=0,i=0,u=0;for(let o=0;o<l.length;o++){if(e+l[o].days>=s){i=o,u=s-e;break}e+=l[o].days}return{day:u,month:l[i].name}}_([b,v,$,T,k,j,x,O,N,w,B,E]);function Y(a,n){let s=L(a);s.setOption(n),window.addEventListener("resize",()=>{s&&s.resize()})}export{I as c,Y as e,z as g,U as t}; diff --git a/CTFd/themes/core-beta/static/assets/scoreboard.750611c8.js b/CTFd/themes/core-beta/static/assets/scoreboard.f9400274.js similarity index 99% rename from CTFd/themes/core-beta/static/assets/scoreboard.750611c8.js rename to CTFd/themes/core-beta/static/assets/scoreboard.f9400274.js index 36e4d55b6d457b0a2219da57fdd01fb88ca45055..cd3964ed696f0c99249c9c56e8aeb04fd8199b39 100644 --- a/CTFd/themes/core-beta/static/assets/scoreboard.750611c8.js +++ b/CTFd/themes/core-beta/static/assets/scoreboard.f9400274.js @@ -1 +1 @@ -import{m as c,C as h}from"./index.1f9008f6.js";import{t as y,g as E}from"./index.84adcd49.js";import"./echarts.54e741c1.js";import{e as C,h as x}from"./CommentBox.cdc9d9b9.js";window.Alpine=c;window.CTFd=h;window.ScoreboardDetail=0;window.standings=0;window.nbStandings=0;window.scoreboardListLoaded=!1;window.allImages=[];window.allSubmited=[];window.maxCount=0;window.maxCountIncrease=5;window.imageInit=!1;window.theninit=0;window.decalage=0;window.laoded=0;window.canShowMore=!0;window.splashPosition={1:[["-55px","0","-30px","0px"],["0px","-50px","50%","0px"],["","-50px","0px","0px"]],2:[["-50px","0px","35%","0"],["","-10px","60%","0px"],["-40px","","-35px","0px"]],3:[["-45px","0px","65%","0"],["","-30px","60%","0px"],["15%","","-35px","0px"]],4:[["-40px","0px","-10%","0"],["","-40px","60%","0"],["-40px","","-35px","0px"]],5:[["-40px","0px","-10%","0"],["","-30px","60%","0"],["","-30px","-25px","0px"]],6:[["-0px","0px","-30%","0"],["","40px","60%","0"],["","-30px","-30px","0px"]]};window.scoreboardSplashPosition={1:["95px","","","105px"],2:["110px","","","50px"],3:["85px","","-195px",""],4:["130px","","","190px"],5:["90px","","","290px"]};c.data("ScoreboardDetail",()=>({data:{},rankings:[],top:{},show:!0,async init(){window.standings=await h.pages.scoreboard.getScoreboard(),window.ScoreboardDetail=await h.pages.scoreboard.getScoreboardDetail(window.standings.length),document.getElementById("score-graph"),this.rankings=y(window.standings),this.top=this.rankings[0],this.show=window.standings.length>0}}));globalThis.loserSplash=function(t,e){if(t.value!="laoded"){if(t.parentElement.style.position="abosolute",window.standings.length-1==e)t.src="/themes/core/static/img/splash"+1+".png",t.parentElement.style.top="125px",t.parentElement.style.right="75%";else{t.src="/themes/core/static/img/splash"+(e%5+1)+".png";let l=window.scoreboardSplashPosition[e%5+1];t.parentElement.style.top=l[0],t.parentElement.style.left=l[2],t.parentElement.style.right=l[3]}t.value="laoded"}};c.data("ScoreboardList",()=>({standings:[],brackets:[],activeBracket:null,async init(){if(window.standings.length!=0){const e=await(await h.fetch(`/api/v1/brackets?type=${h.config.userMode}`,{method:"GET"})).json();this.brackets=e.data;const i=await(await h.fetch("/api/v1/challenges",{method:"GET"})).json();let s={};for(let n=0;n<i.data.length;n++)s[i.data[n].id]=i.data[n].name;let a=E(window.ScoreboardDetail,window.standings,s);for(let n=0;n<a.length;n++)a[n].provided||(a[n].provided=a[n].date),this.standings[n]=a[n];window.nbStandings=this.standings.length}}}));c.data("LogImage",()=>({async init(){let t=!1,e=0;try{e=JSON.parse(this.id)[0].id,window.allImages.push(e),window.allSubmited.push(e)}catch{t=!0;let i="";this.id=="M\xE9dia en traitement"&&(i="M\xE9dia en traitement"),e=i+"%"+String(Math.random()*1e17),window.allSubmited.push(e)}if(window.allSubmited.length>window.maxCount){let l=document.getElementById(this.id);(this.type=="manual"||this.type=="manualRecursive"||this.type=="flash"||this.type=="sport")&&(l.className+=" inSubmission"),t||(l.text=this.challenge_id);try{l.id=e,l.hidden=!0}catch{this.id=e}}(window.allSubmited.length==window.maxCountIncrease||window.allSubmited.length==window.nbStandings)&&(window.imageInit||window.allSubmited.length!=0&&(window.imageInit=!0,self.showXMore()))}}));globalThis.showXMore=async function(t){let e=[];for(let a=window.maxCount;a<window.maxCount+window.maxCountIncrease;a++)try{if(a<window.allSubmited.length){if(!window.allSubmited[a].toString().includes("%"))e.push(window.allImages[a-window.decalage]);else{document.getElementById(window.allSubmited[a]).getElementsByClassName("header")[1].style.height="100px",document.getElementById(window.allSubmited[a]).getElementsByClassName("header")[1].style.width="186px";let n=(Math.random()>.5?-1:1)*(Math.random()*6);document.getElementById(window.allSubmited[a]).style.transform+="rotate("+n+"deg)";let d=document.getElementById(window.allSubmited[a]).getElementsByClassName("splash"),o=window.splashPosition[Math.floor(Math.random()*6)+1];for(let m=0;m<d.length;m++){let g=o[m],r=d[m];r.firstChild.style.top=g[0],r.firstChild.style.bottom=g[1],r.firstChild.style.left=g[2],r.firstChild.style.right=g[3],r.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,window.decalage++}document.getElementById(window.allSubmited[a]).hidden=!1}}catch{}const i=await(await h.fetch("/api/v1/teams?ids="+JSON.stringify(e),{method:"GET"})).json();for(let a=0;a<window.maxCountIncrease;a++)try{if(a<e.length){let n=i.data[a].provided,d=document.getElementById(e[a]),o=!1;try{o=JSON.parse(n)}catch{}if(o){let m=!1,g=!1;for(let r=0;r<o.length;r++)o[r].type=="video/webm"&&(g=!0);for(let r=0;r<o.length;r++)if(o[r].type=="thumbsnail"){m=!0;let w=createMediaElement(o[r]);w.style["max-width"]="100%",w.style.display="block",w.style.height="auto",w.onload=function(p){stylingImage(p,o.length)},d.getElementsByClassName("imageContainer")[0].value!=!0&&(d.getElementsByClassName("imageContainer")[0].appendChild(w),console.log(w.className),d.getElementsByClassName("imageContainer")[0].value=!0),d.getElementsByClassName("imageContainer")[0].onclick=showLargeSubmissions,d.value=n}if(!m){let r=document.createElement("p");r.textContent="Aucune miniature trouv\xE9e pour ce m\xE9dia",d.getElementsByClassName("imageContainer")[0].appendChild(r)}}}}catch{}window.maxCount+=window.maxCountIncrease,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),window.allSubmited.length<=window.maxCount&&(document.getElementById("plus-btn").hidden=!0);let s=document.getElementsByClassName("award-icon");for(let a=0;a<s.length;a++)s[a].parentElement.getElementsByClassName("challenge_name")[0].textContent||(s[a].hidden=!1,s[a].parentElement.getElementsByClassName("challenge_name")[0].hidden=!0)};globalThis.stylingImage=function(t,e){const l=t.target;l.naturalWidth>l.naturalHeight?(l.classList.add("landscape"),l.parentElement.classList.add("landscape-td"),l.parentElement.parentElement.parentElement.classList.add("landscape-td")):(l.classList.add("portrait"),l.parentElement.classList.add("portrait-td"),l.parentElement.parentElement.parentElement.classList.add("portrait-td"));let i=(Math.random()>.5?-1:1)*(Math.random()*6);l.parentElement.parentElement.parentElement.style.transform+="rotate("+i+"deg)";let s=l.parentElement.parentElement.parentElement.getElementsByClassName("splash"),a=window.splashPosition[Math.floor(Math.random()*6)+1];for(let n=0;n<s.length;n++){let d=a[n],o=s[n];o.firstChild.style.top=d[0],o.firstChild.style.bottom=d[1],o.firstChild.style.left=d[2],o.firstChild.style.right=d[3],o.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),l.className=="portrait",console.log()};globalThis.drawLines=function(){document.body.getBoundingClientRect();let t=window.maxCount-window.maxCountIncrease;for(let s=t==0?t:t-2;s<window.laoded-1;s++){var i=document.getElementsByClassName("lineCanvas")[s];i.hidden=!1;try{let n=document.getElementsByClassName("lineStart")[s],d=document.getElementsByClassName("lineStart")[s+1],o=n.getBoundingClientRect(),m=d.getBoundingClientRect();var i=document.getElementsByClassName("lineCanvas")[s];let r=i.parentElement.parentElement.parentElement.style.transform,w=parseFloat(r.split("rotate(")[1].split("deg")[0]);i.style.transform="rotate("+-w+"deg)",i.style.left=(m.left<o.left?m.left-o.left:0)+"px",console.log(d);let p=i.getBoundingClientRect();console.log(m.left),i.width=m.left-p.left+Math.abs(o.left-p.left)+n.offsetHeight/2,i.height=m.top-p.top+Math.abs(o.top-p.top)+n.offsetWidth/2;let u={x:o.left-p.left+n.offsetWidth/2,y:o.top-p.top+n.offsetHeight/2},f={x:m.left-p.left+(m.left<o.left?n.offsetWidth:0),y:m.top-p.top+d.offsetHeight/4};var e=i.getContext("2d"),l=e.createLinearGradient(u.x,u.y,f.x,i.height);l.addColorStop(0,n.value),l.addColorStop(1,d.value),e.setLineDash([40,20]),e.strokeStyle=l,e.beginPath(),e.lineWidth="7",e.moveTo(u.x,u.y),e.lineTo(f.x,f.y),e.stroke()}catch(n){i.style.width="0px",console.log(n)}}var i=document.getElementsByClassName("lineCanvas")[window.laoded-1];i.hidden=!0};globalThis.createMediaElement=function(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm",e.poster=""):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e};globalThis.showLargeSubmissions=function(t){window.carouselPosition=0;let e,l;try{e=JSON.parse(t.srcElement.parentElement.parentElement.value),l=t.srcElement.parentElement.parentElement}catch{e=JSON.parse(t.srcElement.parentElement.parentElement.parentElement.value),l=t.srcElement.parentElement.parentElement.parentElement}console.log(e);let i=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let a=0;a<e.length;a++)if(e[a].type!="thumbsnail"){let n=createMediaElement(e[a]);n.style.width="100%",n.style.objectFit="contain",n.style.height="500px";let d=document.createElement("div");d.append(n),s+='<li class="slide '+(i?a-1:a)+'slide" style="min-height:50%">',s+=d.innerHTML,s+="</li>"}else i=!0;s+="</ul></section>",s+="<img src onerror='reloadCarousel(this.parentElement);'></img>",s+=`<button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button>`,s+=`<button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,C({title:"Visioneurs",body:s,button:"retour",challenge_id:l.text,ids:l.id,additionalClassMain:"FullSizeCarousel"},x,h.user),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"};window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let l=t.getElementsByClassName(e+"slide")[0].firstChild;l.nodeName=="VIDEO"&&l.pause()}};c.start(); +import{m as c,C as h}from"./index.1f9008f6.js";import{t as y,g as E}from"./index.9da342e5.js";import"./echarts.54e741c1.js";import{e as C,h as x}from"./CommentBox.cdc9d9b9.js";window.Alpine=c;window.CTFd=h;window.ScoreboardDetail=0;window.standings=0;window.nbStandings=0;window.scoreboardListLoaded=!1;window.allImages=[];window.allSubmited=[];window.maxCount=0;window.maxCountIncrease=5;window.imageInit=!1;window.theninit=0;window.decalage=0;window.laoded=0;window.canShowMore=!0;window.splashPosition={1:[["-55px","0","-30px","0px"],["0px","-50px","50%","0px"],["","-50px","0px","0px"]],2:[["-50px","0px","35%","0"],["","-10px","60%","0px"],["-40px","","-35px","0px"]],3:[["-45px","0px","65%","0"],["","-30px","60%","0px"],["15%","","-35px","0px"]],4:[["-40px","0px","-10%","0"],["","-40px","60%","0"],["-40px","","-35px","0px"]],5:[["-40px","0px","-10%","0"],["","-30px","60%","0"],["","-30px","-25px","0px"]],6:[["-0px","0px","-30%","0"],["","40px","60%","0"],["","-30px","-30px","0px"]]};window.scoreboardSplashPosition={1:["95px","","","105px"],2:["110px","","","50px"],3:["85px","","-195px",""],4:["130px","","","190px"],5:["90px","","","290px"]};c.data("ScoreboardDetail",()=>({data:{},rankings:[],top:{},show:!0,async init(){window.standings=await h.pages.scoreboard.getScoreboard(),window.ScoreboardDetail=await h.pages.scoreboard.getScoreboardDetail(window.standings.length),document.getElementById("score-graph"),this.rankings=y(window.standings),this.top=this.rankings[0],this.show=window.standings.length>0}}));globalThis.loserSplash=function(t,e){if(t.value!="laoded"){if(t.parentElement.style.position="abosolute",window.standings.length-1==e)t.src="/themes/core/static/img/splash"+1+".png",t.parentElement.style.top="125px",t.parentElement.style.right="75%";else{t.src="/themes/core/static/img/splash"+(e%5+1)+".png";let l=window.scoreboardSplashPosition[e%5+1];t.parentElement.style.top=l[0],t.parentElement.style.left=l[2],t.parentElement.style.right=l[3]}t.value="laoded"}};c.data("ScoreboardList",()=>({standings:[],brackets:[],activeBracket:null,async init(){if(window.standings.length!=0){const e=await(await h.fetch(`/api/v1/brackets?type=${h.config.userMode}`,{method:"GET"})).json();this.brackets=e.data;const i=await(await h.fetch("/api/v1/challenges",{method:"GET"})).json();let s={};for(let n=0;n<i.data.length;n++)s[i.data[n].id]=i.data[n].name;let a=E(window.ScoreboardDetail,window.standings,s);for(let n=0;n<a.length;n++)a[n].provided||(a[n].provided=a[n].date),this.standings[n]=a[n];window.nbStandings=this.standings.length}}}));c.data("LogImage",()=>({async init(){let t=!1,e=0;try{e=JSON.parse(this.id)[0].id,window.allImages.push(e),window.allSubmited.push(e)}catch{t=!0;let i="";this.id=="M\xE9dia en traitement"&&(i="M\xE9dia en traitement"),e=i+"%"+String(Math.random()*1e17),window.allSubmited.push(e)}if(window.allSubmited.length>window.maxCount){let l=document.getElementById(this.id);(this.type=="manual"||this.type=="manualRecursive"||this.type=="flash"||this.type=="sport")&&(l.className+=" inSubmission"),t||(l.text=this.challenge_id);try{l.id=e,l.hidden=!0}catch{this.id=e}}(window.allSubmited.length==window.maxCountIncrease||window.allSubmited.length==window.nbStandings)&&(window.imageInit||window.allSubmited.length!=0&&(window.imageInit=!0,self.showXMore()))}}));globalThis.showXMore=async function(t){let e=[];for(let a=window.maxCount;a<window.maxCount+window.maxCountIncrease;a++)try{if(a<window.allSubmited.length){if(!window.allSubmited[a].toString().includes("%"))e.push(window.allImages[a-window.decalage]);else{document.getElementById(window.allSubmited[a]).getElementsByClassName("header")[1].style.height="100px",document.getElementById(window.allSubmited[a]).getElementsByClassName("header")[1].style.width="186px";let n=(Math.random()>.5?-1:1)*(Math.random()*6);document.getElementById(window.allSubmited[a]).style.transform+="rotate("+n+"deg)";let d=document.getElementById(window.allSubmited[a]).getElementsByClassName("splash"),o=window.splashPosition[Math.floor(Math.random()*6)+1];for(let m=0;m<d.length;m++){let g=o[m],r=d[m];r.firstChild.style.top=g[0],r.firstChild.style.bottom=g[1],r.firstChild.style.left=g[2],r.firstChild.style.right=g[3],r.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,window.decalage++}document.getElementById(window.allSubmited[a]).hidden=!1}}catch{}const i=await(await h.fetch("/api/v1/teams?ids="+JSON.stringify(e),{method:"GET"})).json();for(let a=0;a<window.maxCountIncrease;a++)try{if(a<e.length){let n=i.data[a].provided,d=document.getElementById(e[a]),o=!1;try{o=JSON.parse(n)}catch{}if(o){let m=!1,g=!1;for(let r=0;r<o.length;r++)o[r].type=="video/webm"&&(g=!0);for(let r=0;r<o.length;r++)if(o[r].type=="thumbsnail"){m=!0;let w=createMediaElement(o[r]);w.style["max-width"]="100%",w.style.display="block",w.style.height="auto",w.onload=function(p){stylingImage(p,o.length)},d.getElementsByClassName("imageContainer")[0].value!=!0&&(d.getElementsByClassName("imageContainer")[0].appendChild(w),console.log(w.className),d.getElementsByClassName("imageContainer")[0].value=!0),d.getElementsByClassName("imageContainer")[0].onclick=showLargeSubmissions,d.value=n}if(!m){let r=document.createElement("p");r.textContent="Aucune miniature trouv\xE9e pour ce m\xE9dia",d.getElementsByClassName("imageContainer")[0].appendChild(r)}}}}catch{}window.maxCount+=window.maxCountIncrease,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),window.allSubmited.length<=window.maxCount&&(document.getElementById("plus-btn").hidden=!0);let s=document.getElementsByClassName("award-icon");for(let a=0;a<s.length;a++)s[a].parentElement.getElementsByClassName("challenge_name")[0].textContent||(s[a].hidden=!1,s[a].parentElement.getElementsByClassName("challenge_name")[0].hidden=!0)};globalThis.stylingImage=function(t,e){const l=t.target;l.naturalWidth>l.naturalHeight?(l.classList.add("landscape"),l.parentElement.classList.add("landscape-td"),l.parentElement.parentElement.parentElement.classList.add("landscape-td")):(l.classList.add("portrait"),l.parentElement.classList.add("portrait-td"),l.parentElement.parentElement.parentElement.classList.add("portrait-td"));let i=(Math.random()>.5?-1:1)*(Math.random()*6);l.parentElement.parentElement.parentElement.style.transform+="rotate("+i+"deg)";let s=l.parentElement.parentElement.parentElement.getElementsByClassName("splash"),a=window.splashPosition[Math.floor(Math.random()*6)+1];for(let n=0;n<s.length;n++){let d=a[n],o=s[n];o.firstChild.style.top=d[0],o.firstChild.style.bottom=d[1],o.firstChild.style.left=d[2],o.firstChild.style.right=d[3],o.firstChild.src="/themes/core/static/img/splash"+(Math.floor(Math.random()*5)+1)+".png"}window.laoded+=1,(window.laoded==window.allSubmited.length||window.laoded==window.maxCount)&&drawLines(),l.className=="portrait",console.log()};globalThis.drawLines=function(){document.body.getBoundingClientRect();let t=window.maxCount-window.maxCountIncrease;for(let s=t==0?t:t-2;s<window.laoded-1;s++){var i=document.getElementsByClassName("lineCanvas")[s];i.hidden=!1;try{let n=document.getElementsByClassName("lineStart")[s],d=document.getElementsByClassName("lineStart")[s+1],o=n.getBoundingClientRect(),m=d.getBoundingClientRect();var i=document.getElementsByClassName("lineCanvas")[s];let r=i.parentElement.parentElement.parentElement.style.transform,w=parseFloat(r.split("rotate(")[1].split("deg")[0]);i.style.transform="rotate("+-w+"deg)",i.style.left=(m.left<o.left?m.left-o.left:0)+"px",console.log(d);let p=i.getBoundingClientRect();console.log(m.left),i.width=m.left-p.left+Math.abs(o.left-p.left)+n.offsetHeight/2,i.height=m.top-p.top+Math.abs(o.top-p.top)+n.offsetWidth/2;let u={x:o.left-p.left+n.offsetWidth/2,y:o.top-p.top+n.offsetHeight/2},f={x:m.left-p.left+(m.left<o.left?n.offsetWidth:0),y:m.top-p.top+d.offsetHeight/4};var e=i.getContext("2d"),l=e.createLinearGradient(u.x,u.y,f.x,i.height);l.addColorStop(0,n.value),l.addColorStop(1,d.value),e.setLineDash([40,20]),e.strokeStyle=l,e.beginPath(),e.lineWidth="7",e.moveTo(u.x,u.y),e.lineTo(f.x,f.y),e.stroke()}catch(n){i.style.width="0px",console.log(n)}}var i=document.getElementsByClassName("lineCanvas")[window.laoded-1];i.hidden=!0};globalThis.createMediaElement=function(t){let e;return t.type=="video/webm"?(e=document.createElement("video"),e.controls=!0,e.type="video/webm",e.poster=""):(t.type=="image/png"||t.type=="thumbsnail")&&(e=document.createElement("img"),e.type="image/png"),e.src="/files/"+t.location,e};globalThis.showLargeSubmissions=function(t){window.carouselPosition=0;let e,l;try{e=JSON.parse(t.srcElement.parentElement.parentElement.value),l=t.srcElement.parentElement.parentElement}catch{e=JSON.parse(t.srcElement.parentElement.parentElement.parentElement.value),l=t.srcElement.parentElement.parentElement.parentElement}console.log(e);let i=!1;window.carouselMax=e.length-1;let s="<section class='slider-wrapper'><ul class='slides-container list-unstyled' style:'list-style: none !important;' id='slides-container'>";for(let a=0;a<e.length;a++)if(e[a].type!="thumbsnail"){let n=createMediaElement(e[a]);n.style.width="100%",n.style.objectFit="contain",n.style.height="500px";let d=document.createElement("div");d.append(n),s+='<li class="slide '+(i?a-1:a)+'slide" style="min-height:50%">',s+=d.innerHTML,s+="</li>"}else i=!0;s+="</ul></section>",s+="<img src onerror='reloadCarousel(this.parentElement);'></img>",s+=`<button class='btn btn-primary carousel__navigation-button slide-arrow-prev' id='slide-arrow-prev' onclick='downCarousel(this)' style='display:block;position:absolute;top:40%;left:1rem;'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(15,0) rotate(0)"></path></svg></button>`,s+=`<button style='position:absolute;top:40%;right:1rem;' class='btn btn-primary carousel__navigation-button slide-arrow-next' id='slide-arrow-next' onclick='upCarousel(this)'><svg viewBox="0 0 100 100"><path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" fill="white" transform="translate(85,100) rotate(180)"></path></svg></button>`,C({title:"Visioneurs",body:s,button:"retour",challenge_id:l.text,ids:l.id,additionalClassMain:"FullSizeCarousel"},x,h.user),document.getElementsByClassName("modal-dialog")[0].style.listStyle="none"};window.upCarousel=function(t){window.carouselPosition+=1,window.carouselPosition!=window.carouselMax-1?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!0,t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hidden=!1)};window.downCarousel=function(t){window.carouselPosition-=1,window.carouselPosition!=0?(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1):(window.reloadCarousel(t.parentElement),t.parentElement.getElementsByClassName("slide-arrow-prev")[0].hiddend=!0,t.parentElement.getElementsByClassName("slide-arrow-next")[0].hidden=!1)};window.reloadCarousel=function(t){window.carouselPosition==0&&(t.getElementsByClassName("slide-arrow-prev")[0].hidden=!0),window.carouselMax==1&&(t.getElementsByClassName("slide-arrow-next")[0].hidden=!0);for(let e=0;e<window.carouselMax;e++)if(e==window.carouselPosition)t.getElementsByClassName(e+"slide")[0].hidden=!1;else{t.getElementsByClassName(e+"slide")[0].hidden=!0;let l=t.getElementsByClassName(e+"slide")[0].firstChild;l.nodeName=="VIDEO"&&l.pause()}};c.start(); diff --git a/CTFd/themes/core-beta/static/assets/teams_private.511c7d6d.js b/CTFd/themes/core-beta/static/assets/teams_private.9d5ed359.js similarity index 97% rename from CTFd/themes/core-beta/static/assets/teams_private.511c7d6d.js rename to CTFd/themes/core-beta/static/assets/teams_private.9d5ed359.js index a4d1fc7e49175cf1262498e5024f6f304528f292..0600f8903c06d40a02f38f687defaadde17933e3 100644 --- a/CTFd/themes/core-beta/static/assets/teams_private.511c7d6d.js +++ b/CTFd/themes/core-beta/static/assets/teams_private.9d5ed359.js @@ -1 +1 @@ -import{m as i,C as o,M as m,f as h,$ as n}from"./index.1f9008f6.js";import{s as c,c as p}from"./clipboard.f81bf35a.js";import{g as f}from"./userscore.bc570994.js";import{e as g}from"./index.84adcd49.js";import{a as u}from"./CommentBox.cdc9d9b9.js";import"./echarts.54e741c1.js";window.Alpine=i;window.CTFd=o;i.store("inviteToken","");i.data("TeamEditModal",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=c(this.$el.querySelector("form"))},async updateProfile(){let t=c(this.$el,this.initial,!0);t.fields=[];for(const a in t)if(a.match(/fields\[\d+\]/)){let s={},r=parseInt(a.slice(7,-1));s.field_id=r,s.value=t[a],t.fields.push(s),delete t[a]}let e=await o.pages.teams.updateTeamSettings(t);e.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamCaptainModal",()=>({success:null,error:null,errors:[],async updateCaptain(){let t=c(this.$el,null,!0),e=await o.pages.teams.updateTeamSettings(t);e.success?window.location.reload():(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamInviteModal",()=>({copy(){p(this.$refs.link)}}));i.data("TeamDisbandModal",()=>({errors:[],async disbandTeam(){let t=await o.pages.teams.disbandTeam();t.success?window.location.reload():this.errors=t.errors[""]}}));i.data("CaptainMenu",()=>({captain:!1,editTeam(){this.teamEditModal=new m(document.getElementById("team-edit-modal")),this.teamEditModal.show()},chooseCaptain(){this.teamCaptainModal=new m(document.getElementById("team-captain-modal")),this.teamCaptainModal.show()},async inviteMembers(){const t=await o.pages.teams.getInviteToken();if(t.success){const e=t.data.code,a=`${window.location.origin}${o.config.urlRoot}/teams/invite?code=${e}`;document.querySelector("#team-invite-modal input[name=link]").value=a,this.$store.inviteToken=a,this.teamInviteModal=new m(document.getElementById("team-invite-modal")),this.teamInviteModal.show()}else Object.keys(t.errors).map(e=>{const a=t.errors[e];alert(a)})},disbandTeam(){this.teamDisbandModal=new m(document.getElementById("team-disband-modal")),this.teamDisbandModal.show()}}));i.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const t=[],e={};this.solves.data.map(s=>{t.push(s.challenge.category)}),t.forEach(s=>{s in e?e[s]+=1:e[s]=1});const a=[];for(const s in e)a.push({name:s,count:e[s],percent:e[s]/t.length*100,color:h(s)});return a},async init(){this.solves=await o.pages.teams.teamSolves("me"),this.solves.data[0].challenge.name="caca",console.log(this.solves),this.fails=await o.pages.teams.teamFails("me"),console.log(this.fails),this.awards=await o.pages.teams.teamAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,console.log(),g(this.$refs.scoregraph,f(o.team.id,o.team.name,this.solves.data,this.awards.data))}}));i.data("UserScore",()=>({members:[],async init(){const e=await(await o.fetch(`/api/v1/teams/${o.team.id}/members`,{method:"GET"})).json();console.log(e)}}));i.start();n(".delete-member").click(function(t){t.preventDefault();const e=n(this).attr("member-id"),a=n(this).attr("member-name"),s=n(this).attr("team-name"),r={user_id:e},l=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir supprimer <strong>"+a+"</strong> de <strong>"+s+"</strong>? <p><br><br><strong> Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices d\xE9bloqu\xE9s seront \xE9galement supprim\xE9s !</strong>",success:function(){o.fetch("/api/v1/teams/"+o.team.id+"/members",{method:"DELETE",body:JSON.stringify(r)}).then(function(d){return d.json()}).then(function(d){d.success&&(l.remove(),window.location.reload())})}})});n(".delete-submission").click(function(t){t.preventDefault();const e=n(this).attr("submission-id"),a=n(this).attr("submission-name"),s={submission_id:e},r=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir canceler <strong>"+a+"</strong>, id : <strong>"+e+"</strong>?",success:function(){o.fetch("/api/v1/submissions/"+e,{method:"DELETE",body:JSON.stringify(s)}).then(function(l){return l.json()}).then(function(l){l.success&&(r.remove(),window.location.reload())})}})}); +import{m as i,C as o,M as m,f as h,$ as n}from"./index.1f9008f6.js";import{s as c,c as p}from"./clipboard.f81bf35a.js";import{g as f}from"./userscore.6e631c76.js";import{e as g}from"./index.9da342e5.js";import{a as u}from"./CommentBox.cdc9d9b9.js";import"./echarts.54e741c1.js";window.Alpine=i;window.CTFd=o;i.store("inviteToken","");i.data("TeamEditModal",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=c(this.$el.querySelector("form"))},async updateProfile(){let t=c(this.$el,this.initial,!0);t.fields=[];for(const a in t)if(a.match(/fields\[\d+\]/)){let s={},r=parseInt(a.slice(7,-1));s.field_id=r,s.value=t[a],t.fields.push(s),delete t[a]}let e=await o.pages.teams.updateTeamSettings(t);e.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamCaptainModal",()=>({success:null,error:null,errors:[],async updateCaptain(){let t=c(this.$el,null,!0),e=await o.pages.teams.updateTeamSettings(t);e.success?window.location.reload():(this.success=!1,this.error=!0,Object.keys(e.errors).map(a=>{const s=e.errors[a];this.errors.push(s)}))}}));i.data("TeamInviteModal",()=>({copy(){p(this.$refs.link)}}));i.data("TeamDisbandModal",()=>({errors:[],async disbandTeam(){let t=await o.pages.teams.disbandTeam();t.success?window.location.reload():this.errors=t.errors[""]}}));i.data("CaptainMenu",()=>({captain:!1,editTeam(){this.teamEditModal=new m(document.getElementById("team-edit-modal")),this.teamEditModal.show()},chooseCaptain(){this.teamCaptainModal=new m(document.getElementById("team-captain-modal")),this.teamCaptainModal.show()},async inviteMembers(){const t=await o.pages.teams.getInviteToken();if(t.success){const e=t.data.code,a=`${window.location.origin}${o.config.urlRoot}/teams/invite?code=${e}`;document.querySelector("#team-invite-modal input[name=link]").value=a,this.$store.inviteToken=a,this.teamInviteModal=new m(document.getElementById("team-invite-modal")),this.teamInviteModal.show()}else Object.keys(t.errors).map(e=>{const a=t.errors[e];alert(a)})},disbandTeam(){this.teamDisbandModal=new m(document.getElementById("team-disband-modal")),this.teamDisbandModal.show()}}));i.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const t=[],e={};this.solves.data.map(s=>{t.push(s.challenge.category)}),t.forEach(s=>{s in e?e[s]+=1:e[s]=1});const a=[];for(const s in e)a.push({name:s,count:e[s],percent:e[s]/t.length*100,color:h(s)});return a},async init(){this.solves=await o.pages.teams.teamSolves("me"),this.solves.data[0].challenge.name="caca",console.log(this.solves),this.fails=await o.pages.teams.teamFails("me"),console.log(this.fails),this.awards=await o.pages.teams.teamAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,console.log(),g(this.$refs.scoregraph,f(o.team.id,o.team.name,this.solves.data,this.awards.data))}}));i.data("UserScore",()=>({members:[],async init(){const e=await(await o.fetch(`/api/v1/teams/${o.team.id}/members`,{method:"GET"})).json();console.log(e)}}));i.start();n(".delete-member").click(function(t){t.preventDefault();const e=n(this).attr("member-id"),a=n(this).attr("member-name"),s=n(this).attr("team-name"),r={user_id:e},l=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir supprimer <strong>"+a+"</strong> de <strong>"+s+"</strong>? <p><br><br><strong> Tous leurs d\xE9fis r\xE9solus, tentatives, r\xE9compenses et indices d\xE9bloqu\xE9s seront \xE9galement supprim\xE9s !</strong>",success:function(){o.fetch("/api/v1/teams/"+o.team.id+"/members",{method:"DELETE",body:JSON.stringify(r)}).then(function(d){return d.json()}).then(function(d){d.success&&(l.remove(),window.location.reload())})}})});n(".delete-submission").click(function(t){t.preventDefault();const e=n(this).attr("submission-id"),a=n(this).attr("submission-name"),s={submission_id:e},r=n(this).parent().parent();u({title:"Retirer un membre",body:"<p> Es-tu s\xFBr de vouloir canceler <strong>"+a+"</strong>, id : <strong>"+e+"</strong>?",success:function(){o.fetch("/api/v1/submissions/"+e,{method:"DELETE",body:JSON.stringify(s)}).then(function(l){return l.json()}).then(function(l){l.success&&(r.remove(),window.location.reload())})}})}); diff --git a/CTFd/themes/core-beta/static/assets/teams_public.cd9cbf99.js b/CTFd/themes/core-beta/static/assets/teams_public.0b9a92a0.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/teams_public.cd9cbf99.js rename to CTFd/themes/core-beta/static/assets/teams_public.0b9a92a0.js index ef71d830ae77401cc861d5faa509cd147a9fe2b2..d3a4cc5223591a71cb9841a6227544b69abc67bc 100644 --- a/CTFd/themes/core-beta/static/assets/teams_public.cd9cbf99.js +++ b/CTFd/themes/core-beta/static/assets/teams_public.0b9a92a0.js @@ -1 +1 @@ -import{m as o,f as n,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.bc570994.js";import{e as r}from"./index.84adcd49.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const s=[],a={};this.solves.data.map(t=>{s.push(t.challenge.category)}),s.forEach(t=>{t in a?a[t]+=1:a[t]=1});const i=[];for(const t in a)i.push({name:t,count:a[t],percent:(a[t]/s.length*100).toFixed(2),color:n(t)});return i},async init(){this.solves=await e.pages.teams.teamSolves(window.TEAM.id),this.fails=await e.pages.teams.teamFails(window.TEAM.id),this.awards=await e.pages.teams.teamAwards(window.TEAM.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,r(this.$refs.scoregraph,l(window.TEAM.id,window.TEAM.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as n,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.6e631c76.js";import{e as r}from"./index.9da342e5.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const s=[],a={};this.solves.data.map(t=>{s.push(t.challenge.category)}),s.forEach(t=>{t in a?a[t]+=1:a[t]=1});const i=[];for(const t in a)i.push({name:t,count:a[t],percent:(a[t]/s.length*100).toFixed(2),color:n(t)});return i},async init(){this.solves=await e.pages.teams.teamSolves(window.TEAM.id),this.fails=await e.pages.teams.teamFails(window.TEAM.id),this.awards=await e.pages.teams.teamAwards(window.TEAM.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,r(this.$refs.scoregraph,l(window.TEAM.id,window.TEAM.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/users_private.a644e620.js b/CTFd/themes/core-beta/static/assets/users_private.1030be97.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/users_private.a644e620.js rename to CTFd/themes/core-beta/static/assets/users_private.1030be97.js index c3b4af6fa53e3684263d709af357a61cc872af30..97905b645c91891057d58b798514102f664a35ad 100644 --- a/CTFd/themes/core-beta/static/assets/users_private.a644e620.js +++ b/CTFd/themes/core-beta/static/assets/users_private.1030be97.js @@ -1 +1 @@ -import{m as o,f as n,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.bc570994.js";import{e as u}from"./index.84adcd49.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const r=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:n(s),percent:r})}return i},async init(){this.solves=await e.pages.users.userSolves("me"),this.fails=await e.pages.users.userFails("me"),this.awards=await e.pages.users.userAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(e.user.id,e.user.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as n,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.6e631c76.js";import{e as u}from"./index.9da342e5.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const r=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:n(s),percent:r})}return i},async init(){this.solves=await e.pages.users.userSolves("me"),this.fails=await e.pages.users.userFails("me"),this.awards=await e.pages.users.userAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(e.user.id,e.user.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/users_public.916b159f.js b/CTFd/themes/core-beta/static/assets/users_public.1ab6b031.js similarity index 88% rename from CTFd/themes/core-beta/static/assets/users_public.916b159f.js rename to CTFd/themes/core-beta/static/assets/users_public.1ab6b031.js index 1f7d28d072cdd3bb4b84fb2ca6552fda664bb4cf..881fda31c88b80eba433aca0090eea7766c01cda 100644 --- a/CTFd/themes/core-beta/static/assets/users_public.916b159f.js +++ b/CTFd/themes/core-beta/static/assets/users_public.1ab6b031.js @@ -1 +1 @@ -import{m as o,f as r,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.bc570994.js";import{e as u}from"./index.84adcd49.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const n=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:r(s),percent:n})}return i},async init(){this.solves=await e.pages.users.userSolves(window.USER.id),this.fails=await e.pages.users.userFails(window.USER.id),this.awards=await e.pages.users.userAwards(window.USER.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(window.USER.id,window.USER.name,this.solves.data,this.awards.data))}}));o.start(); +import{m as o,f as r,C as e}from"./index.1f9008f6.js";import{g as l}from"./userscore.6e631c76.js";import{e as u}from"./index.9da342e5.js";import"./echarts.54e741c1.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const n=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:r(s),percent:n})}return i},async init(){this.solves=await e.pages.users.userSolves(window.USER.id),this.fails=await e.pages.users.userFails(window.USER.id),this.awards=await e.pages.users.userAwards(window.USER.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(window.USER.id,window.USER.name,this.solves.data,this.awards.data))}}));o.start(); diff --git a/CTFd/themes/core-beta/static/assets/userscore.bc570994.js b/CTFd/themes/core-beta/static/assets/userscore.6e631c76.js similarity index 93% rename from CTFd/themes/core-beta/static/assets/userscore.bc570994.js rename to CTFd/themes/core-beta/static/assets/userscore.6e631c76.js index c4c6613d9ecc27fb78c597f1a36c50087327a566..b2ed13435ade646f0d9105c23f41a1f5426fd3cb 100644 --- a/CTFd/themes/core-beta/static/assets/userscore.bc570994.js +++ b/CTFd/themes/core-beta/static/assets/userscore.6e631c76.js @@ -1 +1 @@ -import{d as u,f as n}from"./index.1f9008f6.js";import{c as d}from"./index.84adcd49.js";function m(s,o,c,p){let a={title:{left:"center",text:"Score au fil du temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[],axisLabel:""}],yAxis:[{type:"value",axisLabel:""}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const i=[],r=[],e=c.concat(p);e.sort((t,l)=>new Date(t.date)-new Date(l.date));for(let t=0;t<e.length;t++){const l=u(e[t].date);i.push(l.toDate());try{r.push(e[t].challenge.value)}catch{r.push(e[t].value)}}return i.forEach(t=>{a.xAxis[0].data.push(t)}),a.series.push({name:o,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:n(o+s)}},itemStyle:{normal:{color:n(o+s)}},data:d(r)}),a}export{m as g}; +import{d as u,f as n}from"./index.1f9008f6.js";import{c as d}from"./index.9da342e5.js";function m(s,o,c,p){let a={title:{left:"center",text:"Score au fil du temps"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[],axisLabel:""}],yAxis:[{type:"value",axisLabel:""}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const i=[],r=[],e=c.concat(p);e.sort((t,l)=>new Date(t.date)-new Date(l.date));for(let t=0;t<e.length;t++){const l=u(e[t].date);i.push(l.toDate());try{r.push(e[t].challenge.value)}catch{r.push(e[t].value)}}return i.forEach(t=>{a.xAxis[0].data.push(t)}),a.series.push({name:o,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:n(o+s)}},itemStyle:{normal:{color:n(o+s)}},data:d(r)}),a}export{m as g}; diff --git a/CTFd/themes/core-beta/static/manifest.json b/CTFd/themes/core-beta/static/manifest.json index aaf43564e8b00f5beca8ed5b13e3b4738564fd90..8d29164c1ce92772faa6e4455fc2fe93df72fd4e 100644 --- a/CTFd/themes/core-beta/static/manifest.json +++ b/CTFd/themes/core-beta/static/manifest.json @@ -39,12 +39,12 @@ ] }, "assets/js/scoreboard.js": { - "file": "assets/scoreboard.750611c8.js", + "file": "assets/scoreboard.f9400274.js", "src": "assets/js/scoreboard.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_index.84adcd49.js", + "_index.9da342e5.js", "_echarts.54e741c1.js", "_CommentBox.cdc9d9b9.js" ] @@ -58,25 +58,25 @@ ] }, "assets/js/teams/public.js": { - "file": "assets/teams_public.cd9cbf99.js", + "file": "assets/teams_public.0b9a92a0.js", "src": "assets/js/teams/public.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.bc570994.js", - "_index.84adcd49.js", + "_userscore.6e631c76.js", + "_index.9da342e5.js", "_echarts.54e741c1.js" ] }, "assets/js/teams/private.js": { - "file": "assets/teams_private.511c7d6d.js", + "file": "assets/teams_private.9d5ed359.js", "src": "assets/js/teams/private.js", "isEntry": true, "imports": [ "assets/js/index.js", "_clipboard.f81bf35a.js", - "_userscore.bc570994.js", - "_index.84adcd49.js", + "_userscore.6e631c76.js", + "_index.9da342e5.js", "_CommentBox.cdc9d9b9.js", "_echarts.54e741c1.js" ] @@ -90,24 +90,24 @@ ] }, "assets/js/users/public.js": { - "file": "assets/users_public.916b159f.js", + "file": "assets/users_public.1ab6b031.js", "src": "assets/js/users/public.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.bc570994.js", - "_index.84adcd49.js", + "_userscore.6e631c76.js", + "_index.9da342e5.js", "_echarts.54e741c1.js" ] }, "assets/js/users/private.js": { - "file": "assets/users_private.a644e620.js", + "file": "assets/users_private.1030be97.js", "src": "assets/js/users/private.js", "isEntry": true, "imports": [ "assets/js/index.js", - "_userscore.bc570994.js", - "_index.84adcd49.js", + "_userscore.6e631c76.js", + "_index.9da342e5.js", "_echarts.54e741c1.js" ] }, @@ -137,18 +137,18 @@ "assets/CommentBox.533f8693.css" ] }, - "_index.84adcd49.js": { - "file": "assets/index.84adcd49.js", + "_index.45310940.js": { + "file": "assets/index.45310940.js", "imports": [ "assets/js/index.js", "_echarts.54e741c1.js" ] }, - "_userscore.bc570994.js": { - "file": "assets/userscore.bc570994.js", + "_userscore.5770cce0.js": { + "file": "assets/userscore.5770cce0.js", "imports": [ "assets/js/index.js", - "_index.84adcd49.js" + "_index.45310940.js" ] }, "CommentBox.css": { @@ -159,5 +159,285 @@ "file": "assets/main.9adeb51a.css", "src": "assets/scss/main.scss", "isEntry": true + }, + "_index.1360d27f.js": { + "file": "assets/index.1360d27f.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.0cdb9d92.js": { + "file": "assets/userscore.0cdb9d92.js", + "imports": [ + "assets/js/index.js", + "_index.1360d27f.js" + ] + }, + "_index.86712f74.js": { + "file": "assets/index.86712f74.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.33ec092b.js": { + "file": "assets/userscore.33ec092b.js", + "imports": [ + "assets/js/index.js", + "_index.86712f74.js" + ] + }, + "_index.878e618d.js": { + "file": "assets/index.878e618d.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.aae66b48.js": { + "file": "assets/userscore.aae66b48.js", + "imports": [ + "assets/js/index.js", + "_index.878e618d.js" + ] + }, + "_index.c8058393.js": { + "file": "assets/index.c8058393.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.4e216a7c.js": { + "file": "assets/userscore.4e216a7c.js", + "imports": [ + "assets/js/index.js", + "_index.c8058393.js" + ] + }, + "_index.3408a013.js": { + "file": "assets/index.3408a013.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.e5884b7d.js": { + "file": "assets/userscore.e5884b7d.js", + "imports": [ + "assets/js/index.js", + "_index.3408a013.js" + ] + }, + "_index.4aea7c8a.js": { + "file": "assets/index.4aea7c8a.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.884c19ca.js": { + "file": "assets/userscore.884c19ca.js", + "imports": [ + "assets/js/index.js", + "_index.4aea7c8a.js" + ] + }, + "_index.66af16cf.js": { + "file": "assets/index.66af16cf.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.e462d559.js": { + "file": "assets/userscore.e462d559.js", + "imports": [ + "assets/js/index.js", + "_index.66af16cf.js" + ] + }, + "_index.1fce79cc.js": { + "file": "assets/index.1fce79cc.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.5b199f4c.js": { + "file": "assets/userscore.5b199f4c.js", + "imports": [ + "assets/js/index.js", + "_index.1fce79cc.js" + ] + }, + "_index.5df8acb4.js": { + "file": "assets/index.5df8acb4.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.045d4950.js": { + "file": "assets/userscore.045d4950.js", + "imports": [ + "assets/js/index.js", + "_index.5df8acb4.js" + ] + }, + "_index.c747c316.js": { + "file": "assets/index.c747c316.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.16a12830.js": { + "file": "assets/userscore.16a12830.js", + "imports": [ + "assets/js/index.js", + "_index.c747c316.js" + ] + }, + "_index.d298c5e8.js": { + "file": "assets/index.d298c5e8.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.ebbe6fc4.js": { + "file": "assets/userscore.ebbe6fc4.js", + "imports": [ + "assets/js/index.js", + "_index.d298c5e8.js" + ] + }, + "_index.87cfb30c.js": { + "file": "assets/index.87cfb30c.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.3a8d4c39.js": { + "file": "assets/userscore.3a8d4c39.js", + "imports": [ + "assets/js/index.js", + "_index.87cfb30c.js" + ] + }, + "_index.8a2b5aeb.js": { + "file": "assets/index.8a2b5aeb.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.02ef1689.js": { + "file": "assets/userscore.02ef1689.js", + "imports": [ + "assets/js/index.js", + "_index.8a2b5aeb.js" + ] + }, + "_index.75e6afc4.js": { + "file": "assets/index.75e6afc4.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.5bd262af.js": { + "file": "assets/userscore.5bd262af.js", + "imports": [ + "assets/js/index.js", + "_index.75e6afc4.js" + ] + }, + "_index.f7268712.js": { + "file": "assets/index.f7268712.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.ae2bdcb1.js": { + "file": "assets/userscore.ae2bdcb1.js", + "imports": [ + "assets/js/index.js", + "_index.f7268712.js" + ] + }, + "_index.4e73e487.js": { + "file": "assets/index.4e73e487.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.21067aef.js": { + "file": "assets/userscore.21067aef.js", + "imports": [ + "assets/js/index.js", + "_index.4e73e487.js" + ] + }, + "_index.19da0671.js": { + "file": "assets/index.19da0671.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.5fac17a6.js": { + "file": "assets/userscore.5fac17a6.js", + "imports": [ + "assets/js/index.js", + "_index.19da0671.js" + ] + }, + "_index.5eb45b09.js": { + "file": "assets/index.5eb45b09.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.38ecf6a1.js": { + "file": "assets/userscore.38ecf6a1.js", + "imports": [ + "assets/js/index.js", + "_index.5eb45b09.js" + ] + }, + "_index.9da262a3.js": { + "file": "assets/index.9da262a3.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.4b7a75ff.js": { + "file": "assets/userscore.4b7a75ff.js", + "imports": [ + "assets/js/index.js", + "_index.9da262a3.js" + ] + }, + "_index.9da342e5.js": { + "file": "assets/index.9da342e5.js", + "imports": [ + "assets/js/index.js", + "_echarts.54e741c1.js" + ] + }, + "_userscore.6e631c76.js": { + "file": "assets/userscore.6e631c76.js", + "imports": [ + "assets/js/index.js", + "_index.9da342e5.js" + ] } } \ No newline at end of file diff --git a/CTFd/themes/core-beta/templates/base.html b/CTFd/themes/core-beta/templates/base.html index f67968a09a411c3d4009ab200548059feebe7995..6cf45881e866eae4f8ad6453c6c55c804fe59ad1 100644 --- a/CTFd/themes/core-beta/templates/base.html +++ b/CTFd/themes/core-beta/templates/base.html @@ -20,6 +20,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="start_in" content="{{ ctf_starts_in() }}"> <meta name="ends_in" content="{{ ctf_ends_in() }}"> + <meta name="start_time" content="{{ ctf_start_time() }}"> <meta name="total_time" content="{{ ctf_total_time() }}"> <link rel="shortcut icon" href="{{ Configs.ctf_small_icon }}" type="image/x-icon"> diff --git a/CTFd/themes/core-beta/templates/challenges.html b/CTFd/themes/core-beta/templates/challenges.html index 2ec5f897688d9f472f4cd62f4dd496d446d03a80..e5fbc7223a3eb4dda39faf9af996e5afa74c2df9 100644 --- a/CTFd/themes/core-beta/templates/challenges.html +++ b/CTFd/themes/core-beta/templates/challenges.html @@ -115,25 +115,7 @@ <div class="col-md-12" style="display: flex; justify-content: space-around; padding-bottom:10px;"> <ul id="countdown" style="transform: translateY(-50%); width: 100%;"> - <li class="countdown-days"> - <div class="number">00</div> - <div class="label">Jours</div> - </li> - <li class="countdown-separator">:</li> - <li class="countdown-hours"> - <div class="number">00</div> - <div class="label">Heures</div> - </li> - <li class="countdown-separator">:</li> - <li class="countdown-minutes"> - <div class="number">00</div> - <div class="label">Minutes</div> - </li> - <li class="countdown-separator">:</li> - <li class="countdown-seconds"> - <div class="number">00</div> - <div class="label">Secondes</div> - </li> + <div class="countdown-title label"></div> </ul> </div> </div>