ColdCore/templates/base.html

169 lines
8.5 KiB
HTML
Raw Normal View History

2015-11-08 06:10:26 +00:00
<html>
<head>
2016-03-06 00:44:19 +00:00
<title>{{ config.ctf_name }} &ndash; {% block title %}Home{% endblock %}</title>
2015-11-08 06:10:26 +00:00
{% if config.cdn %}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/css/materialize.min.css" />
2015-11-08 19:04:02 +00:00
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.css" />
2015-11-08 06:10:26 +00:00
<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') }}" />
2016-07-11 00:01:00 +00:00
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/flag-icon.min.css') }}" />
2015-11-10 04:41:07 +00:00
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vis.min.css') }}" />
2015-11-08 06:10:26 +00:00
{% endif %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename=config.custom_stylesheet) }}" />
2016-04-16 18:34:48 +00:00
<script>
function dismissNotification(id) {
api.makeCall("/dismiss/" + id + ".json", {_csrf_token: "{{ csrf_token() }}"}, function() {
$("#notification" + id).slideUp();
});
}
</script>
2016-03-06 00:59:20 +00:00
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
2015-11-08 06:10:26 +00:00
{% block head %}{% endblock %}
</head>
2016-03-06 00:59:30 +00:00
<body class="competition-page">
2016-07-10 16:55:12 +00:00
<header>
2016-07-11 21:28:55 +00:00
<nav class="top-nav blue nav-fixed">
2016-07-10 16:55:12 +00:00
<div class="nav-wrapper">
2016-07-10 17:25:03 +00:00
<div><a href="#" data-activates="nav-mobile" class="button-collapse top-nav full"><i class="material-icons">menu</i></a></div>
2016-07-10 20:58:04 +00:00
<img class="top-logo" src={{ url_for('static', filename='img/logo.png') }}></img>
2016-07-10 16:55:12 +00:00
<ul class="right hide-on-med-and-down">
2016-07-10 17:07:34 +00:00
{% if logged_in %}
<li><a href="{{ url_for('users.logout') }}">Logout</a></li>
<li><a href="{{ url_for('users.dashboard') }}">{{ user.username }}</a></li>
2016-07-10 17:07:34 +00:00
{% endif %}
{% if not logged_in %}
{% if config.registration %}
<li><a href="{{ url_for('users.register') }}">Register</a></li>
2016-07-10 17:07:34 +00:00
{% endif %}
<li><a href="{{ url_for('users.login') }}">Login</a></li>
2016-07-10 17:07:34 +00:00
{% endif %}
2016-07-10 16:55:12 +00:00
</ul>
2015-11-08 06:10:26 +00:00
</div>
2016-07-10 16:55:12 +00:00
2016-07-12 22:45:43 +00:00
</nav>
<ul id="nav-mobile" class="side-nav fixed">
2016-07-10 17:00:07 +00:00
2016-08-28 01:32:21 +00:00
{% if config.competition_has_started() or session.admin %}
2016-07-12 22:45:43 +00:00
{% if logged_in %}
<li><a href="{{ url_for('challenges.index') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons blue-text">flag</i></div>
<div class="side-text">Challenges</div>
</a></li>
{% endif %}
<li><a href="{{ url_for('scoreboard.index') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons red-text">timeline</i></div>
<div class="side-text">Scoreboard</div>
</a></li>
2016-08-12 11:41:49 +00:00
<li><a href="{{ url_for('shell.index') }}">
<div class="side-icon"><i class="material-icons purple-text">computer</i></div>
<div class="side-text">Shell</div>
2016-07-12 22:45:43 +00:00
</a></li>
2016-07-16 15:55:14 +00:00
{% endif %}
2016-07-16 15:56:25 +00:00
{% if logged_in %}
<li><a href="https://chat.icec.tf/" target="_blank">
2016-07-16 15:56:25 +00:00
<div class="side-icon"><i class="material-icons green-text">chat</i></div>
<div class="side-text">Chat</div>
</a></li>
<li><a href="{{ url_for('tickets.index') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons amber-text">report_problem</i></div>
<div class="side-text">Tickets</div>
</a></li>
{% endif %}
2016-07-15 22:09:56 +00:00
2016-07-12 22:45:43 +00:00
<div class="divider" /></div>
{% if logged_in %}
2016-07-12 14:24:19 +00:00
<li><a href="{{ url_for('teams.dashboard') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons indigo-text">track_changes</i></div>
<div class="side-text">My Team</div>
</a></li>
<li><a href="{{ url_for('users.dashboard') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons teal-text">account_circle</i></div>
<div class="side-text">{{ user.username }}</div>
</a></li>
<li><a href="{{ url_for('users.logout') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons red-text">block</i></div>
<div class="side-text">Logout</div>
</a></li>
{% endif %}
{% if not logged_in %}
{% if config.registration %}
<li><a href="{{ url_for('users.register') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons indigo-text">person_add</i></div>
<div class="side-text">Register</div>
</a></li>
{% endif %}
<li><a href="{{ url_for('users.login') }}">
2016-07-12 22:45:43 +00:00
<div class="side-icon"><i class="material-icons amber-text">lock</i></div>
<div class="side-text">Login</div>
</a></li>
{% endif %}
</ul>
2016-07-10 16:55:12 +00:00
</header>
2016-07-10 17:02:20 +00:00
<div class="cont">
2015-12-17 12:57:35 +00:00
{% if session.admin %}
<div class="card red darken-3">
<div class="card-content white-text">
<span class="card-title">You are an admin.</span>
Please note that team restrictions do not currently apply.
</div>
</div>
{% endif %}
{% for notification in notifications %}
<div class="card yellow darken-2" id="notification{{ notification.id }}" onclick="dismissNotification({{ notification.id }});" style="cursor: hand;">
<div class="card-content">
{{ notification.notification | safe }} (Click to dismiss)
</div>
</div>
{% endfor %}
</div>
2016-07-10 17:02:20 +00:00
<div class="cont">
2015-11-08 06:10:26 +00:00
{% 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>
2015-11-08 07:49:20 +00:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.min.js"></script>
2015-11-08 19:04:02 +00:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.js"></script>
2015-11-08 06:10:26 +00:00
{% else %}
<script src="{{ url_for('static', filename='jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename='materialize.min.js') }}"></script>
2015-11-10 04:41:07 +00:00
<script src="{{ url_for('static', filename='timeago.min.js') }}"></script>
<script src="{{ url_for('static', filename='vis.min.js') }}"></script>
2015-11-08 06:10:26 +00:00
{% endif %}
2016-07-10 16:15:33 +00:00
<script src="{{ url_for('static', filename='js/api.js') }}"></script>
2016-07-11 00:04:30 +00:00
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
<script>
2016-03-06 00:52:29 +00:00
$(function() {
$("abbr.time[title='1970-01-01 00:00:00']").attr("title", "").removeClass("time").html("None");
$("abbr.time").timeago();
2016-03-06 00:52:29 +00:00
$('.button-collapse').sideNav();
});
</script>
2015-11-08 06:10:26 +00:00
<script id="toasts" type="text/javascript">
{% for message in get_flashed_messages() %}
Materialize.toast({{ message | tojson }}, 4000);
{% endfor %}
</script>
2015-11-08 19:04:02 +00:00
{% block postscript %}
{% endblock %}
{% if config.production %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-64770282-2', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
2015-11-08 06:10:26 +00:00
</body>
</html>