{% extends "base.html" %}

{% block stylesheets %}
	<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/challenge-board.css">
{% endblock %}

{% block content %}

<div class="jumbotron">
	<div class="container">
		<h1>Challenges</h1>
	</div>
</div>

{% if infos %}
	<div class="container">
		<div id='errors' class="row">
			<div class="col-md-12">
				{% for info in infos %}
					<h1 class="text-center">{{ info }}</h1>
				{% endfor %}
			</div>
		</div>
	</div>
{% endif %}

{% if errors %}
<div class="container">
	<div id='errors' class="row">
		<div class="col-md-12">
{% for error in errors %}
			<h1 class="text-center">{{ error }}</h1>
{% endfor %}
		</div>
	</div>
</div>
{% endif %}

{% if admin or not errors %}
<div class="container">
	<div id='challenges-board'>
		<div class="text-center">
			<i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw spinner"></i>
		</div>
	</div>
</div>

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

<div class="modal fade" id="chal-window" tabindex="-1" role="dialog">
</div>
{% endif %}
{% endblock %}

{% block scripts %}
	<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/utils.js"></script>
	<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/multi-modal.js"></script>
	{% if admin or not errors %}
	<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/chalboard.js"></script>
	{% endif %}
	<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/style.js"></script>
{% endblock %}
