mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-21 14:14:21 +01:00
112 lines
4.5 KiB
HTML
112 lines
4.5 KiB
HTML
{% extends "admin/base.html" %}
|
|
|
|
{% block stylesheets %}
|
|
<style>
|
|
.btn-primary { background-color: #337ab7; }
|
|
.btn-danger { background-color: #d9534f; }
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
|
<br>
|
|
<h1>Correct Key Submissions</h1>
|
|
<div id="confirm" class="modal fade" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header text-center">
|
|
<h3>Delete Key</h3>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form method="POST" action="">
|
|
<input id="nonce" type="hidden" name="nonce" value="{{ nonce }}">
|
|
<div class="small-6 small-centered text-center columns">
|
|
<p>Are you sure you want to delete successful key submission for team: <strong id="confirm-team-name"></strong> in challenge: <strong id="confirm-chal-name"></strong>?</p>
|
|
<a onclick="$('#confirm').modal('hide')" class="btn btn-primary">No</a>
|
|
<button class="btn btn-danger" id="delete-solve" type="button">Yes</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table id="teamsboard" class=" table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<td class="text-center"><b>Team</b>
|
|
</td>
|
|
<td class="text-center"><b>Challenge</b>
|
|
</td>
|
|
<td class="text-center"><b>Date</b>
|
|
</td>
|
|
<td class="text-center"><b>Key Submitted</b>
|
|
</td>
|
|
<td class="text-center"><b>Delete</b>
|
|
</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for solve in solves %}
|
|
<tr>
|
|
<td class="text-center team" id="{{ solve.teamid }}"><a href="{{ request.script_root }}/admin/team/{{ solve.teamid }}">{{ solve.team_name }}</a>
|
|
<td class="text-center chal" id="{{ solve.chalid }}">{{ solve.chal_name }}</td>
|
|
<td class="text-center solve-time"><script>document.write( moment({{ solve.date|unix_time_millis }}).local().format('MMMM Do, h:mm:ss A'))</script></td>
|
|
<td class="text-center">{{ solve.flag }}</td>
|
|
<td class="text-center"><i class="fa fa-times"></i></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% if pages > 1 %}
|
|
<div class="text-center">Page
|
|
<br>
|
|
{% if curr_page != 1 %}<a href="{{ request.script_root }}/admin/correct_keys/{{ curr_page-1 }}"><<<</a>{% endif %}
|
|
{% for page in range(1, pages + 1) %}
|
|
{% if curr_page != page %}
|
|
<a href="{{ request.script_root }}/admin/correct_keys/{{ page }}">{{ page }}</a>
|
|
{% else %}
|
|
<b>{{ page }}</b>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if curr_page != pages %}<a href="{{ request.script_root }}/admin/correct_keys/{{ curr_page+1 }}">>>></a>{% endif %}
|
|
<a href="{{ request.script_root }}">
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ request.script_root }}/static/js/utils.js"></script>
|
|
<script src="{{ request.script_root }}/static/admin/js/team.js"></script>
|
|
<script>
|
|
$('#delete-solve').click(function(e){
|
|
e.preventDefault();
|
|
var solve = $('#confirm input[name="solve"]').val()
|
|
$.post($('#confirm form').attr('action'), $('#confirm form').serialize(), function(data){
|
|
var data = $.parseJSON(JSON.stringify(data))
|
|
if (data == "1"){
|
|
location.reload()
|
|
}
|
|
})
|
|
});
|
|
|
|
function load_confirm_modal(team, chal, team_name, chal_name){
|
|
var modal = $('#confirm')
|
|
modal.find('#confirm-team-name').text(team_name)
|
|
modal.find('#confirm-chal-name').text(chal_name)
|
|
$('#confirm form').attr('action', '{{ request.script_root }}/admin/solves/'+team+'/'+chal+'/delete');
|
|
$('#confirm').modal('show');
|
|
}
|
|
|
|
$('.fa-times').click(function(){
|
|
var elem = $(this).parent().parent();
|
|
var chal = elem.find('.chal').attr('id');
|
|
var chal_name = elem.find('.chal').text().trim();
|
|
var team = elem.find('.team').attr('id');
|
|
var team_name = elem.find('.team').text().trim();
|
|
load_confirm_modal(team, chal, team_name, chal_name)
|
|
});
|
|
</script>
|
|
{% endblock %}
|