Commit cfb7ef9f authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers 🐦

cleanup code for bootstrap 4

parent 3e60fec4
Pipeline #1120 passed with stages
in 30 seconds
......@@ -16,13 +16,20 @@
</head>
<body>
<div class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/index.html">Fireworks</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" >
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<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="description.html">Competition</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="builder.html">Builder</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 mt-4">
......@@ -30,7 +37,7 @@
{% endblock %}
</div>
<footer class="container">
<footer class="container text-center">
<hr />
<p>Competition is run by <a href="http://www.webpigeon.me.uk">Joseph Walton-Rivers</a> and <a href="http://pacmanvghosts.co.uk">Piers Williams</a></p>
</footer>
......
function fetchRankingsAndShow(trackID=""){
function fetchRankingsAndShow(trackID="", tableid=null){
$.getJSON("http://competitions.pacmanvghosts.co.uk/api/track/"+trackID, function(run){
var rankingData = run["submission_set"];
var tableBody = $("#" + run["pk"] + " tbody");
if (tableid == null){
tableid = "#" + run["pk"];
}
var tableBody = $(tableid + " tbody");
rankingData.sort(function(a, b){
// check if either have submitted text submissions
......@@ -34,10 +38,9 @@ function fetchRankingsAndShow(trackID=""){
$.each(rankingData, function(index, item){
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>';
rowData += '<tr><td>' + (index + 1) + '</td><td>' + item.owner + '</td><td>' + item.name + '</td><td>' + value.toFixed(3) + '</td></tr>';
});
tableBody.append(rowData);
});
}
$(document).ready(function(){fetchRankingsAndShow(7);});
{% extends "_base.html" %}
{% block title %}Description{% endblock %}
{% block title %}Agent Builder{% endblock %}
{% block head_extra %}
<script src="https://use.fontawesome.com/a1c76a49d8.js"></script>
......@@ -22,10 +22,21 @@
<div class="col-md-6">
<h2>My Agent</h2>
<ul class="list-inline pull-right">
<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 class="list-inline-item"><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="#" 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 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">
......@@ -33,7 +44,11 @@
<div class="form-group">
<label class="sr-only" for="resetFilter">Filter ruleset</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-filter fa-fw" aria-hidden="true"></i></div>
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fa fa-filter fa-fw" aria-hidden="true"></i>
</div>
</div>
<input class="form-control" id="rulesetFilter" placeholder="type here to filter rules...">
</div>
</div>
......@@ -44,10 +59,10 @@
<ul class="list-group connectedRules empty" id="agent">
<li class="list-group-item message"><div class="text-muted">Drag rules here to build your agent</div></li>
</ul>
<div id="graph"></div>
<div id="graph" class="my-3"></div>
<table class="table table-striped" id="resultsTable">
<thead>
<thead class="thead-dark">
<tr>
<th></th>
<th>Current Agent</th>
......@@ -90,28 +105,28 @@
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="docModal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Help Documentation</h4>
</div>
<div class="modal-body">
<p id="docText" style="display: none"> Loading Help Text ... </p>
<div class="embed-responsive embed-responsive-16by9">
<iframe style="zoom:0.60" class="embed-responsive-item" frameborder="0" src="http://iggi.fosslab.uk/hanabi/apidocs/" id="docFrame"></iframe>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Help Documentation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<p id="docText" style="display: none"> Loading Help Text ... </p>
<div class="embed-responsive embed-responsive-16by9">
<iframe style="zoom:0.60" class="embed-responsive-item" frameborder="0" src="http://iggi.fosslab.uk/hanabi/apidocs/" id="docFrame"></iframe>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" tabindex="-1" role="dialog" id="saveModal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Save Model</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<p> Below is the text form of your agent. </p>
......@@ -123,30 +138,30 @@
{% 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 type="text/javascript">
var testPending = false;
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="assets/js/loadAndDisplayRules.js"></script>
<script type="text/javascript">
var testPending = false;
$( function() {
$( "#agent, #ruleset" ).sortable({
connectWith: ".connectedRules",
items: "li:not(.message)",
receive: function(event, ui) {
$('li.message', this).hide();
$( function() {
$( "#agent, #ruleset" ).sortable({
connectWith: ".connectedRules",
items: "li:not(.message)",
receive: function(event, ui) {
$('li.message', this).hide();
if($('li:not(.message)', ui.sender).length == 0){
$('li.message', ui.sender).show();
$(ui.sender).addClass('empty');
console.log($(ui.sender));
} else {
$('li.message', ui.sender).hide();
$(this).removeClass('empty');
}
}
}).disableSelection();
if($('li:not(.message)', ui.sender).length == 0){
$('li.message', ui.sender).show();
$(ui.sender).addClass('empty');
console.log($(ui.sender));
} else {
$('li.message', ui.sender).hide();
$(this).removeClass('empty');
}
}
}).disableSelection();
} );
</script>
} );
</script>
{% endblock %}
......@@ -5,24 +5,40 @@
{% block script_extra %}
<script src="assets/js/rankings.js" type="text/javascript"></script>
<script type="text/javascript">
//$(document).ready(function(){fetchRankingsAndShow(7);});
$(document).ready(
function(){
fetchRankingsAndShow(7, "#rankings");
}
);
</script>
{% endblock %}
{% block content %}
<h1>Rankings</h1>
<table class="table table-striped" id="7">
<thead>
<th>Rank</th>
<th>User</th>
<th>Agent</th>
<th>Score</th>
</thead>
<tbody>
</tbody>
</table>
<p class="pull-right"><a class="btn btn-primary" href="http://comp.fossgalaxy.com">View the competitons on Comet</a></p>
<div class="row">
<div class="col">
<h2>Current Results</h2>
<table class="table table-striped" id="rankings">
<thead class="thead-dark">
<th>Rank</th>
<th>User</th>
<th>Agent</th>
<th>Score</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<p class="float-right"><a class="btn btn-primary" href="http://comp.fossgalaxy.com">View the competitons on Comet</a></p>
<h2>Past Results</h2>
<ul>
<li>IGGI Symposium hack winner: CharlieBot (17.1725)</li>
</ul>
{% 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