mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-01-31 20:04:28 +01:00
Bugfixes from plugin testing (#522)
This commit is contained in:
@@ -1,101 +1,99 @@
|
||||
<div class="col-md-12">
|
||||
<form method="POST" action="{{ script_root }}/admin/chal/new" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="name">Name
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="The name of your challenge"></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="name" placeholder="Enter challenge name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="category">Category
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="The category of your challenge"></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="category" placeholder="Enter challenge category">
|
||||
</div>
|
||||
<form method="POST" action="{{ script_root }}/admin/chal/new" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="name">Name
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="The name of your challenge"></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="name" placeholder="Enter challenge name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="category">Category
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="The category of your challenge"></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="category" placeholder="Enter challenge category">
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist" id="new-desc-edit">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#new-desc-write" aria-controls="home" role="tab" data-toggle="tab">Write</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#new-desc-preview" aria-controls="home" role="tab" data-toggle="tab">Preview</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-tabs" role="tablist" id="new-desc-edit">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#new-desc-write" aria-controls="home" role="tab" data-toggle="tab">Write</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#new-desc-preview" aria-controls="home" role="tab" data-toggle="tab">Preview</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="new-desc-write">
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="control-label">Message:
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="Use this to give a brief introduction to your challenge. The description supports HTML and Markdown."></i>
|
||||
</label>
|
||||
<textarea id="new-desc-editor" class="form-control" name="description" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane content" id="new-desc-preview" style="height:234px; overflow-y: scroll;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="new-desc-write">
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="control-label">Message:
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="Use this to give a brief introduction to your challenge. The description supports HTML and Markdown."></i>
|
||||
</label>
|
||||
<textarea id="new-desc-editor" class="form-control" name="description" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane content" id="new-desc-preview" style="height:234px; overflow-y: scroll;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="value">Value
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="This is how many points are rewarded for solving this challenge."></i>
|
||||
</label>
|
||||
<input type="number" class="form-control" name="value" placeholder="Enter value" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="value">Value
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="This is how many points are rewarded for solving this challenge."></i>
|
||||
</label>
|
||||
<input type="number" class="form-control" name="value" placeholder="Enter value" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Flag
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="This is the flag or solution for your challenge. You can choose whether your flag is a static string or a regular expression."></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="key" placeholder="Enter flag">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Flag
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="This is the flag or solution for your challenge. You can choose whether your flag is a static string or a regular expression."></i>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="key" placeholder="Enter flag">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="custom-select" name="key_type[0]">
|
||||
<option value="static">Static</option>
|
||||
<option value="regex">Regex</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="custom-select" name="key_type[0]">
|
||||
<option value="static">Static</option>
|
||||
<option value="regex">Regex</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<div class="checkbox">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" name="hidden" type="checkbox">
|
||||
Hide challenge on creation
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<div class="checkbox">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" name="hidden" type="checkbox">
|
||||
Hide challenge on creation
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<div class="checkbox">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="solve-attempts-checkbox">
|
||||
Limit amount of solve attempts
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<div class="checkbox">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="solve-attempts-checkbox">
|
||||
Limit amount of solve attempts
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div id="solve-attempts-input" style="display: none;">
|
||||
<label for="max_attempts">Maximum Attempts
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="How many attempts should a user have for this challenge? For unlimited attempts, use the value 0"></i>
|
||||
</label>
|
||||
<input class="form-control" id='max_attempts' name='max_attempts' type='number' placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div id="solve-attempts-input" style="display: none;">
|
||||
<label for="max_attempts">Maximum Attempts
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="How many attempts should a user have for this challenge? For unlimited attempts, use the value 0"></i>
|
||||
</label>
|
||||
<input class="form-control" id='max_attempts' name='max_attempts' type='number' placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Upload Challenge Files
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="Challenges files are provided to users for download alongside your challenge description"></i>
|
||||
</label>
|
||||
<input class="form-control-file" type="file" name="files[]" multiple="multiple">
|
||||
<sub class="help-block">Attach multiple files using Control+Click or Cmd+Click.</sub>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Upload Challenge Files
|
||||
<i class="fa fa-question-circle text-muted" data-toggle="tooltip" data-placement="right" title="Challenges files are provided to users for download alongside your challenge description"></i>
|
||||
</label>
|
||||
<input class="form-control-file" type="file" name="files[]" multiple="multiple">
|
||||
<sub class="help-block">Attach multiple files using Control+Click or Cmd+Click.</sub>
|
||||
</div>
|
||||
|
||||
<input type="hidden" value="{{ nonce }}" name="nonce" id="nonce">
|
||||
<input type="hidden" value="standard" name="chaltype" id="chaltype">
|
||||
<input type="hidden" value="{{ nonce }}" name="nonce" id="nonce">
|
||||
<input type="hidden" value="standard" name="chaltype" id="chaltype">
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary float-right create-challenge-submit" type="submit">Create</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary float-right create-challenge-submit" type="submit">Create</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<table id="keysboard" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center"><b>Type</b></td>
|
||||
<td class="text-center"><b>Key</b></td>
|
||||
<td class="text-center"><b>Settings</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key in keys %}
|
||||
<tr name="{{key.id}}">
|
||||
<td class="key-type">{{key.type_name}}</td>
|
||||
<td class="key-value">{{key.key}}</td>
|
||||
<td class="text-center"><span>
|
||||
<i role="button" class="fa fa-pencil-square-o" onclick="javascript:load_edit_key_modal({{key.id}}, '{{key.type_name}}')"></i>
|
||||
<i role="button" class="fa fa-times" onclick="javascript:deletekey({{key.id}})"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center"><b>Type</b></td>
|
||||
<td class="text-center"><b>Key</b></td>
|
||||
<td class="text-center"><b>Settings</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key in keys %}
|
||||
<tr name="{{key.id}}">
|
||||
<td class="key-type text-center">{{key.type_name}}</td>
|
||||
<td class="key-value"><pre>{{key.key}}</pre></td>
|
||||
<td class="text-center"><span>
|
||||
<i role="button" class="fa fa-pencil-square-o" onclick="javascript:load_edit_key_modal({{key.id}}, '{{key.type_name}}')"></i>
|
||||
<i role="button" class="fa fa-times" onclick="javascript:deletekey({{key.id}})"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
File diff suppressed because one or more lines are too long
@@ -64,17 +64,17 @@
|
||||
{% if request.script_root %}
|
||||
{% set route = '/' + request.script_root + '/' + menu.route %}
|
||||
{% else %}
|
||||
{% set route = '/' + menu.route %}
|
||||
{% set route = menu.route %}
|
||||
{% endif %}
|
||||
<li class="nav-item"><a class="nav-link" href="{{ route }}">{{ menu.title }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
{% if plugins %}
|
||||
<li>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Plugins <span class="caret"></span></a>
|
||||
<li class="nav-item dropdown">
|
||||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Plugins <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for plugin in plugins %}
|
||||
<li class="nav-item"><a class="nav-link" href="{{ request.script_root }}{{ plugin.route }}">{{ plugin.name }}</a></li>
|
||||
<a class="dropdown-item" href="{{ request.script_root }}{{ plugin.route }}">{{ plugin.name }}</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
<div id="update-keys" class="modal fade" tabindex="-1" chal-id="">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<div class="container">
|
||||
@@ -16,14 +16,18 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row text-center">
|
||||
<div class="col-md-12">
|
||||
<button id="create-key" class="btn btn-primary d-inline-block">New Flag</button>
|
||||
<form method="POST" action="{{ request.script_root }}/admin/keys">
|
||||
<input name='nonce' type='hidden' value="{{ nonce }}">
|
||||
<input id="keys-chal" name='chal' type='hidden'>
|
||||
<div id="current-keys" class="row"></div>
|
||||
</form>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<button id="create-key" class="btn btn-primary d-inline-block text-center">New Flag</button>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<form method="POST" action="{{ request.script_root }}/admin/keys">
|
||||
<input name='nonce' type='hidden' value="{{ nonce }}">
|
||||
<input id="keys-chal" name='chal' type='hidden'>
|
||||
<div id="current-keys" class="row"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.challenge-button {
|
||||
box-shadow: 3px 3px 3px grey;
|
||||
}
|
||||
|
||||
.solved-challenge {
|
||||
background-color: #37d63e !important;
|
||||
opacity: 0.4;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user