{% extends "admin/base.html" %}

{% block stylesheets %}
{% endblock %}

{% block content %}
	<div class="jumbotron">
		<div class="container">
			<h1>Reset</h1>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-6 offset-md-3">
				<form method="POST" id="reset-ctf-form">
					<div class="alert alert-danger" role="alert">
						<p>
							Resetting your CTFd instance allows you to bulk delete data to prepare it for other events,
							other classes, or to otherwise get it to a clean state.
						</p>

						<p>
							Resetting your CTFd instance will delete the selected data <strong>PERMANENTLY</strong>.
						</p>

						<p>
							Think carefully before resetting because no automated backups are made and all selected data will be lost.
						</p>

						<span>
							<strong>
								Create backups of all data you need by <a href="{{ url_for('admin.config', _anchor='backup') }}">creating a CTFd Export</a>
							</strong>
						</span>
					</div>

					<hr>

					<div class="form-group pb-2">
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="checkbox" name="accounts"> Accounts
							</label>
						</div>
						<span class="text-muted">
							Deletes all user and team accounts and their associated information<br>
							<small>(Users, Teams, Submissions, Tracking)</small>
						</span>
					</div>

					<div class="form-group pb-2">
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="checkbox" name="submissions"> Submissions
							</label>
						</div>
						<span class="text-muted">
							Deletes all records that accounts gained points or took an action<br>
							<small>(Submissions, Awards, Unlocks, Tracking)</small>
						</span>
					</div>

					<div class="form-group pb-2">
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="checkbox" name="challenges"> Challenges
							</label>
						</div>
						<span class="text-muted">
							Deletes all challenges and associated data<br>
							<small>(Challenges, Flags, Hints, Tags, Challenge Files)</small>
						</span>
					</div>

					<div class="form-group pb-2">
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="checkbox" name="pages"> Pages
							</label>
						</div>
						<span class="text-muted">
							Deletes all pages and their associated files<br>
							<small>(Pages, Page Files)</small>
						</span>
					</div>

					<div class="form-group pb-2">
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="checkbox" name="notifications"> Notifications
							</label>
						</div>
						<span class="text-muted">
							Deletes all notifications<br>
							<small>(Notifications)</small>
						</span>
					</div>

					<br>

					<input id="nonce" type="hidden" name="nonce" value="{{ nonce }}">

					<button class="btn btn-warning btn-lg btn-block">
						Reset CTF
					</button>
				</form>
			</div>
		</div>
	</div>
{% endblock %}

{% block scripts %}
{% endblock %}

{% block entrypoint %}
	<script defer src="{{ url_for('views.themes', theme='admin', path='js/pages/reset.js') }}"></script>
{% endblock %}
