ColdCore/templates/base.html

64 lines
3.2 KiB
HTML

<html>
<head>
<title>{{ config.ctf_name }} :: {% block title %}Home{% endblock %}</title>
{% if config.cdn %}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/css/materialize.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.css" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
{% else %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='materialize.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='icons.css') }}" />
{% endif %}
{% block head %}{% endblock %}
</head>
<body>
<div class="navbar-fixed">
<nav class="blue darken-3">
<div class="container">
<div class="nav-wrapper">
<ul class="left">
{% if config.competition_is_running %}
{% if logged_in %}
<li><a href="{{ url_for('challenges') }}">Challenges</a></li>
{% endif %}
<li><a href="{{ url_for('scoreboard') }}">Scoreboard</a></li>
{% endif %}
</ul>
<a href="#" class="center brand-logo">{{ config.ctf_name }}</a>
<ul class="right">
{% if logged_in %}
<li><a href="{{ url_for('logout') }}">Logout</a></li>
<li><a href="{{ url_for('dashboard') }}">{{ team.name }}</a></li>
{% endif %}
{% if not logged_in %}
<li><a href="{{ url_for('register') }}">Register</a></li>
<li><a href="{{ url_for('login') }}">Login</a></li>
{% endif %}
</ul>
</div>
</div>
</nav>
</div>
<div class="container">
{% block content %}{% endblock %}
</div>
{% if config.cdn %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.js"></script>
<script>$("abbr.time").timeago();</script>
{% else %}
<script src="{{ url_for('static', filename='jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename='materialize.min.js') }}"></script>
{% endif %}
<script id="toasts" type="text/javascript">
{% for message in get_flashed_messages() %}
Materialize.toast({{ message | tojson }}, 4000);
{% endfor %}
</script>
{% block postscript %}
{% endblock %}
</body>
</html>