Commit 3e60fec4 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers 🐦

fix up the javascript

parent aee0fa0d
Pipeline #1119 passed with stages
in 1 minute and 21 seconds
......@@ -6,29 +6,26 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %} :: Fireworks Competition</title>
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<link href="assets/css/main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
{% block head_extra %}
{% endblock %}
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li><a href="domain.html">Domain Description</a></li>
<li><a href="description.html">Description</a></li>
<li><a href="rankings.html">Rankings</a></li>
<li><a href="https://comp.fossgalaxy.com" target="_blank">Submit now</a></li>
<div class="navbar navbar-expand-lg navbar-dark bg-dark">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>
<li class="nav-item"><a class="nav-link" href="domain.html">Domain Description</a></li>
<li class="nav-item"><a class="nav-link" href="description.html">Description</a></li>
<li class="nav-item"><a class="nav-link" href="rankings.html">Rankings</a></li>
<li class="nav-item"><a class="nav-link" href="https://comp.fossgalaxy.com" target="_blank">Submit now</a></li>
</ul>
</div>
</div>
<div id="wrapper" class="container">
<div id="wrapper" class="container mt-4">
{% block content %}
{% endblock %}
</div>
......@@ -40,13 +37,19 @@
<!-- Latest compiled and minified JavaScript -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- jquery et al -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
</script>
{% block script_extra %}
{% endblock %}
</body>
</html>
body { padding-top: 70px; }
.agentSide h2{
float:left;
......
......@@ -3,21 +3,27 @@ function fetchRankingsAndShow(trackID=""){
var rankingData = run["submission_set"];
var tableBody = $("#" + run["pk"] + " tbody");
rankingData.sort(function(a, b){
// check if either have submitted text submissions
var a_upload = a["current_upload"] == null ? a["current_text"] : a["current_upload"];
var b_upload = b["current_upload"] == null ? b["current_text"] : b["current_upload"];
// Compare two parts of the submission set
if(a["current_upload"] == null){
if(a_upload == null){
return 1;
}
if(b["current_upload"] == null){
if(b_upload == null){
return -1;
}
// Both have a upload - check if either has a BF
if(a["current_upload"]["status"] == "BF"){
if(a_upload['status'] == "BF"){
return 1;
}
if(b["current_upload"]["status"] == "BF"){
if(b_upload["status"] == "BF"){
return -1;
}
......@@ -26,7 +32,7 @@ function fetchRankingsAndShow(trackID=""){
var rowData = '';
$.each(rankingData, function(index, item){
var value = (item.current_upload == null) ? "No Submission" : item.ranking;
var value = (item.current_upload == null && item.current_text == null) ? "No Submission" : item.ranking;
if(item.current_upload != null && item.current_upload.status == "BF") value = "Build Failed";
rowData += '<tr><td>' + (index + 1) + '</td><td>' + item.owner + '</td><td>' + item.name + '</td><td>' + value + '</td></tr>';
});
......
......@@ -22,10 +22,10 @@
<div class="col-md-6">
<h2>My Agent</h2>
<ul class="list-inline pull-right">
<li><a href="#" id="testBtn" onclick="buildAgent()" class="btn btn-default"><i class="fa fa-spinner fa-spin fa-fw" style="display: none" aria-hidden="true"></i>Evaluate</a></li>
<li><a href="#" id="testBtn" onclick="buildAgentFixed()" class="btn btn-default"><i class="fa fa-spinner fa-spin fa-fw" style="display: none" aria-hidden="true"></i>Benchmark</a></li>
<li class="list-inline-item"><a href="#" id="testBtn" onclick="buildAgent()" class="btn btn-primary"><i class="fa fa-spinner fa-spin fa-fw" style="display: none" aria-hidden="true"></i>Evaluate</a></li>
<li class="list-inline-item"><a href="#" id="testBtn" onclick="buildAgentFixed()" class="btn btn-primary"><i class="fa fa-spinner fa-spin fa-fw" style="display: none" aria-hidden="true"></i>Benchmark</a></li>
<!--<li><a href="#" class="btn btn-primary">Submit</a></li>-->
<li><a href="#" class="btn btn-success" id="saveBtn" data-toggle="modal" data-target="#saveModal">Save Model</a></li>
<li class="list-inline-item"><a href="#" class="btn btn-success" id="saveBtn" data-toggle="modal" data-target="#saveModal">Save Model</a></li>
</ul>
</div>
<div class="col-md-6">
......@@ -120,9 +120,11 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
{% endblock %}
{% block script_extra %}
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="assets/js/loadAndDisplayRules.js"></script>
<script src="assets/js/loadAndDisplayRules.js"></script>
<script type="text/javascript">
var testPending = false;
......@@ -146,5 +148,5 @@
} );
</script>
{% endblock %}
......@@ -3,7 +3,7 @@
{% block content %}
<div class="row">
<div class="col-md-8">
<img class="img-resposive img-rounded" src="assets/img/hanabi-ui.png" style="width: 750px" alt="#" >
<img class="img-fluid img-rounded" src="assets/img/hanabi-ui.png" style="width: 750px" alt="#" >
</div>
<div class="col-md-4">
<h1>Fireworks Agent Competition</h1>
......@@ -16,25 +16,33 @@
<hr />
<div class="well text-center">
Submissions are open now.
<div class="card text-center bg-light my-4">
<div class="card-body">
<p class="card-text">Submissions are open now.</p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<h2>Fireworks Framework</h2>
<p>You can find the source code for the game engine and documentation on our git server. </p>
<a class="btn btn-default" href="http://iggi.fosslab.uk/hanabi/apidocs/index.html">View javadoc</a>
<div class="card-deck">
<div class="card">
<div class="card-body">
<h2 class="card-title">Fireworks Framework</h2>
<p class="card-text">You can find the source code for the game engine and documentation on our git server. </p>
<a class="btn btn-info" href="http://iggi.fosslab.uk/hanabi/apidocs/index.html">View javadoc</a>
</div>
</div>
<div class="col-md-4">
<h2>Sample Agents</h2>
<p>A range of sample controllers have been provided as part of the starter package. Download it now to get started.</p>
<a class="btn btn-default" href="assets/starter.zip">View sample controllers</a>
<div class="card">
<div class="card-body">
<h2 class="card-title">Sample Agents</h2>
<p class="card-text">A range of sample controllers have been provided as part of the starter package. Download it now to get started.</p>
<a class="btn btn-info" href="assets/starter.zip">View sample controllers</a>
</div>
</div>
<div class="col-md-4">
<h2>Submit your Entry</h2>
<p>You should submit your entry as a maven project via our submission server. Once submitted, the agent will be entered into the rankings automaticlly.</p>
<a class="btn btn-default" href="https://comp.fossgalaxy.com/competitions/t/7">Sign up</a>
<div class="card">
<div class="card-body">
<h2 class="card-title">Submit your Entry</h2>
<p class="card-text">You should submit your agent via our submission server. Once submitted, it will be entered into the rankings automaticlly.</p>
<a class="btn btn-primary" href="https://comp.fossgalaxy.com/competitions/t/7">Sign up</a>
</div>
</div>
</div>
......
......@@ -2,7 +2,7 @@
{% block title %}Current Rankings{% endblock %}
{% block head_extra %}
{% block script_extra %}
<script src="assets/js/rankings.js" type="text/javascript"></script>
<script type="text/javascript">
//$(document).ready(function(){fetchRankingsAndShow(7);});
......@@ -22,7 +22,7 @@
</tbody>
</table>
<p class="pull-right"><a class="btn btn-default" href="http://comp.fossgalaxy.com">View the competitons on Comet</a></p>
<p class="pull-right"><a class="btn btn-primary" href="http://comp.fossgalaxy.com">View the competitons on Comet</a></p>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment