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

add first draft of builder ui

parent b8aa4a0f
{% extends "_base.html" %}
{% block title %}Description{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8">
<h2>My Agent</h2>
<ul class="list-group connectedRules" style="min-height: 20px" id="agent">
</ul>
</div>
<div class="col-md-4">
<h2>Available Rules</h2>
<ul class="list-group connectedRules" style="min-height: 20px" id="ruleset">
<li class="list-group-item">
<h2>Rule 1</h2>
<span style="display: none" class="ruleid">1</span>
</li>
<li class="list-group-item">Rule 2
<span style="display: none" class="ruleid">2</span>
</li>
<li class="list-group-item">Rule 3</li>
<li class="list-group-item">Rule 4</li>
<li class="list-group-item">Rule 5</li>
</ul>
</div>
</div>
<ul class="list-inline pull-right">
<li><a href="#" onclick="buildAgent()" class="btn btn-default">Test</a></li>
<li><a href="#" class="btn btn-primary">Submit</a></li>
</ul>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$( function() {
$( "#agent, #ruleset" ).sortable({
connectWith: ".connectedRules"
}).disableSelection();
} );
function buildAgent() {
var ruleList = [];
$("#agent .list-group-item .ruleid").each(function(x, i) {
ruleList.push(i.innerHTML);
});
console.log(ruleList.join(","));
}
</script>
{% 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