easyctf-2017/web/pages/admin/problems.html

90 lines
3 KiB
HTML
Raw Normal View History

2016-01-07 08:01:18 +00:00
<div class="page-header">
<h1>Problem Editor</h1>
</div>
2016-01-05 02:12:50 +00:00
2016-01-07 08:40:19 +00:00
<style>
.ace_editor {
width: 100%;
height: 200px;
}
2016-03-10 04:33:34 +00:00
.epiceditor-edit-mode {
border: 1px solid #999 !important;
}
2016-01-07 08:40:19 +00:00
</style>
2016-03-12 07:34:26 +00:00
<div class="row">
<div class="tabbable">
<ul class="nav nav-pills nav-stacked col-md-3">
<li class="active"><a data-target="#new" data-toggle="tab">New</a></li>
<li ng-repeat="problem in problems"><a data-target="#problem_{{ problem['pid'] }}" data-toggle="tab">{{ problem["title"] }} ({{ problem["value"] }} points)</a></li>
</ul>
<div class="tab-content col-md-9">
<div class="tab-pane active" id="new">
2016-01-07 08:01:18 +00:00
<div class="panel panel-default">
2016-03-12 07:34:26 +00:00
<div class="panel-heading">
<h4 class="panel-title">New Problem</h4>
2016-01-07 08:01:18 +00:00
</div>
2016-03-12 07:34:26 +00:00
<div class="panel-body">
<div id="add-status"></div>
<form class="form-horizontal" onsubmit="create_problem(); return false;" id="new_problem_form">
<input class="form-control" name="name" placeholder="Name" required/>
<br>
<textarea class="form-control" name="description" placeholder="Description" required autocomplete="off"/>
<br>
<input class="form-control" name="category" placeholder="Category" required autocomplete="off"/>
<br>
<input class="form-control" name="hint" placeholder="Hint" required/>
<br>
<input class="form-control" name="value" type="number" placeholder="Problem Value" required autocomplete="off"/>
<br>
<input class="form-control" name="flag" placeholder="Flag" required/>
<br>
<div id="new_grader"></div>
<br>
<input type="submit" id="create-problem" class="btn btn-success" value="Create"/>
</form>
2016-01-07 08:01:18 +00:00
</div>
</div>
</div>
2016-03-12 07:34:26 +00:00
<div class="tab-pane" ng-repeat="problem in problems" id="problem_{{ problem['pid'] }}">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">{{ problem["title"] }}</h4>
</div>
<div class="panel-body">
</div>
2016-03-10 04:33:34 +00:00
</div>
</div>
</div>
2016-01-07 08:01:18 +00:00
</div>
</div>
2016-01-07 00:47:27 +00:00
2016-01-07 08:01:18 +00:00
<script type="text/javascript">
2016-03-10 04:33:34 +00:00
$(document).ready(function() {
$(".selectpicker").selectpicker();
2016-03-10 04:33:34 +00:00
var config = {
toolbar: [
{ name: "basicstyles", items: [ "Bold", "Italic", "Underline" ] },
{ name: "links", items: [ "Link" ] },
{ name: "paragraph", items: [ "NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote" ] },
{ name: "tools", items: [ "Maximize" ] },
{ name: "document", items: [ "Source" ] },
]
};
var editor = new EpicEditor({
container: "new_grader",
2016-03-10 04:33:34 +00:00
theme: {
base: "https://cdnjs.cloudflare.com/ajax/libs/epiceditor/0.2.2/themes/base/epiceditor.css",
preview: "https://cdnjs.cloudflare.com/ajax/libs/epiceditor/0.2.2/themes/preview/github.css",
editor: "https://cdnjs.cloudflare.com/ajax/libs/epiceditor/0.2.2/themes/editor/epic-light.css"
},
button: {
bar: "show"
}
}).load();
var new_grader = ace.edit("new_grader");
new_grader.setTheme("ace/theme/tomorrow");
new_grader.getSession().setMode("ace/mode/python");
2016-01-07 08:01:18 +00:00
});
</script>