mirror of https://github.com/JohnHammond/CTFd.git
Adding ability to hide challenges
parent
f4964dffff
commit
6308165dea
|
@ -36,7 +36,7 @@ def chals():
|
|||
else:
|
||||
return redirect('/')
|
||||
if can_view_challenges():
|
||||
chals = Challenges.query.add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()
|
||||
chals = Challenges.query.filter(Challenges.hidden!=True).add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()
|
||||
|
||||
json = {'game':[]}
|
||||
for x in chals:
|
||||
|
|
|
@ -34,6 +34,10 @@ function loadchal(id, update) {
|
|||
$('.chal-value').val(obj.value);
|
||||
$('.chal-category').val(obj.category);
|
||||
$('.chal-id').val(obj.id);
|
||||
$('.chal-hidden').prop('checked', false);
|
||||
if (obj.hidden) {
|
||||
$('.chal-hidden').prop('checked', true);
|
||||
}
|
||||
//$('#update-challenge .chal-delete').attr({
|
||||
// 'href': '/admin/chal/close/' + (id + 1)
|
||||
//})
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="157.418px" height="44.518px" viewBox="0 0 157.418 44.518" enable-background="new 0 0 157.418 44.518"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<polyline fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="105.276,22.799 130.825,27.542 129.688,33.668
|
||||
123.296,39.467 117.625,41.749 107.5,39.332 105.183,29.467 "/>
|
||||
<g>
|
||||
<path d="M0,22.919v-0.12C0,10.919,8.879,1.08,21.239,1.08c7.62,0,12.18,2.7,16.379,6.66l-3.24,3.479
|
||||
c-3.54-3.36-7.5-5.76-13.2-5.76c-9.299,0-16.259,7.56-16.259,17.219v0.12c0,9.722,7.02,17.341,16.259,17.341
|
||||
c5.76,0,9.54-2.222,13.56-6.062l3.12,3.062c-4.38,4.438-9.18,7.379-16.799,7.379C8.939,44.518,0,34.979,0,22.919z"/>
|
||||
<path d="M52.438,6.18H38.339V1.8h32.999v4.38h-14.1v37.619h-4.8V6.18z"/>
|
||||
<path d="M73.319,1.8h30.179v4.38H78.059v15h22.739v4.32H78.059v18.299h-4.74V1.8z"/>
|
||||
<path d="M128.144,28.318v-0.119c0-7.14-5.459-11.939-11.22-11.939c-6,0-10.92,4.44-10.92,11.939v0.119c0,7.32,5.101,12,10.92,12
|
||||
C122.685,40.318,128.144,35.458,128.144,28.318z M102.265,28.379v-0.12c0-10.139,6.379-15.139,13.819-15.139
|
||||
c5.761,0,9.479,2.12,11.879,5.6V0h4.62v43.798h-4.62v-6.239c-2.521,3.719-6.18,5.899-11.879,5.899
|
||||
C108.644,43.458,102.265,38.579,102.265,28.379z"/>
|
||||
</g>
|
||||
<path d="M145.362,7.49C139.198,0.592,133.308,0,133.308,0v29.406c0,0,4.568-6.611,13.09-8.43c5.713-1.219,8.5-3.59,11.021-6.273
|
||||
C157.416,14.703,151.106,13.916,145.362,7.49"/>
|
||||
<path d="M119.754,30.537c0.293-1.602-0.769-3.137-2.37-3.426c-1.602-0.293-3.135,0.769-3.428,2.37
|
||||
c-0.223,1.223,0.346,2.402,1.34,3.021l-1.872,3.389l4.569,0.834l-0.557-3.832C118.585,32.662,119.534,31.757,119.754,30.537"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -76,6 +76,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input name="hidden" type="checkbox">
|
||||
Hide challenge on creation
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleInputFile">Upload challenge files</label>
|
||||
<input type="file" name="files[]" multiple="multiple">
|
||||
|
@ -130,6 +138,13 @@
|
|||
</div>
|
||||
<input class="chal-id" type='hidden' name='id' placeholder='ID'>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input class="chal-hidden" name="hidden" type="checkbox">
|
||||
Hidden
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<a href="#" data-toggle="modal" data-target="#update-tags" class="btn btn-primary">Tags</a>
|
||||
<a href="#" data-toggle="modal" data-target="#update-files" class="btn btn-primary">Files</a>
|
||||
|
|
Loading…
Reference in New Issue