Starting DO integration

selenium-screenshot-testing
CodeKevin 2015-01-24 00:48:41 -05:00
parent fb5e525775
commit 7642aeb1e5
6 changed files with 21 additions and 9 deletions

1
.gitignore vendored
View File

@ -55,3 +55,4 @@ target/
*.db
*.log
.idea/

View File

@ -111,6 +111,11 @@ def init_admin(app):
return render_template('admin/pages.html', routes=pages)
@app.route('/admin/hosts', methods=['GET'])
@admins_only
def admin_hosts():
return render_template('admin/hosts.html')
@app.route('/admin/chals', methods=['POST', 'GET'])
@admins_only
def admin_chals():
@ -358,7 +363,7 @@ def init_admin(app):
solve_count=solve_count,
challenge_count=challenge_count,
most_solved=most_solved_chal,
least_solved = least_solved_chal
least_solved=least_solved_chal
)

View File

@ -8,3 +8,4 @@ passlib==1.6.2
py-bcrypt==0.4
six==1.8.0
itsdangerous
dop

View File

@ -135,7 +135,7 @@ function loadchals(){
};
for (var i = 0; i <= challenges['game'].length - 1; i++) {
$('#' + challenges['game'][i].category.replace(/ /g,"-")).append($('<button value="' + challenges['game'][i].id + '">' + challenges['game'][i].value + '</button>'));
$('#' + challenges['game'][i].category.replace(/ /g,"-")).append($('<button class="radius" value="' + challenges['game'][i].id + '">' + challenges['game'][i].value + '</button>'));
};
$('#challenges button').click(function (e) {
@ -145,7 +145,7 @@ function loadchals(){
loadfiles(this.value);
});
$('tr').append('<button class="create-challenge"><i class="fa fa-plus"></i></button>');
$('tr').append('<button class="radius create-challenge"><i class="fa fa-plus"></i></button>');
$('.create-challenge').click(function (e) {
$('#new-chal-category').val($($(this).siblings()[0]).text().trim())

View File

@ -121,7 +121,7 @@
<div>
<table id='challenges'>
</table>
<button style="width:100%;" class="create-category">New Category</button>
<button style="width:100%;" class="radius create-category">New Category</button>
</div>
</div>
{% endblock %}

View File

@ -7,6 +7,11 @@
<form method="POST">
<input name='nonce' type='hidden' value="{{ nonce }}">
<div class="row">
<label for="start">Digital Ocean API Key:</label>
<input id='do_api_key' name='do_api_key' type='text' placeholder="Digital Ocean API Key" {% if do_api_key is defined and do_api_key != None %}value="{{ do_api_key }}"{% endif %}>
</div>
<div class="row">
<label for="start">Start Date:</label>
<input id='start' name='start' type='text' placeholder="Start Date (UTC timestamp)" {% if start is defined and start != None %}value="{{ start }}"{% endif %}>