Bootstrap v4 (#558)

* Updating to Bootstrap v4
* Update jQuery to 3.3.1
* Update FontAwesome to 5.0.4 and fix icon click handlers in Safari
* Closes #555, #556
selenium-screenshot-testing
Kevin Chung 2018-01-22 06:11:52 -05:00 committed by GitHub
parent accb561e27
commit 98fbad40a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 141 additions and 105 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Font Awesome Free 5.0.1 by @fontawesome - http://fontawesome.com
* Font Awesome Free 5.0.4 by @fontawesome - http://fontawesome.com
* License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
svg:not(:root).svg-inline--fa {
@ -79,7 +79,7 @@ svg:not(:root).svg-inline--fa {
height: 1em;
position: relative;
text-align: center;
vertical-align: -12.5%;
vertical-align: -.125em;
width: 1em; }
.fa-layers svg.svg-inline--fa {
-webkit-transform-origin: center center;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<link rel="shortcut icon" href="{{ request.script_root }}/themes/core/static/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="{{ request.script_root }}/themes/core/static/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="{{ request.script_root }}/themes/admin/static/css/vendor/bootstrap.min.css">
<link rel="stylesheet" href="{{ request.script_root }}/themes/admin/static/css/vendor/fa-svg-with-js.css" />
<link rel="stylesheet" href="{{ request.script_root }}/themes/admin/static/css/vendor/fa-svg-with-js.css">
<link rel="stylesheet" href='{{ request.script_root }}/themes/admin/static/css/vendor/font.css'>
<link rel="stylesheet" href="{{ request.script_root }}/themes/admin/static/css/jumbotron.css">
<link rel="stylesheet" href="{{ request.script_root }}/themes/admin/static/css/sticky-footer.css">
@ -16,7 +16,6 @@
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/moment.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/moment-timezone-with-data.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/nunjucks.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/fontawesome-all.min.js"></script>
<script type="text/javascript">
var script_root = "{{ request.script_root }}";
</script>
@ -115,6 +114,7 @@
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/jquery.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/marked.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/bootstrap.bundle.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/vendor/fontawesome-all.min.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/main.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/utils.js"></script>
<script src="{{ request.script_root }}/themes/admin/static/js/ezq.js"></script>

View File

@ -13,38 +13,20 @@
{% include "admin/modals/hints/hints.html" %}
{% include "admin/modals/keys/keys.html" %}
<div class="modal fade" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
<input type="hidden" value="{{ nonce }}" id="nonce">
<input type="hidden" value="{{ nonce }}" id="nonce">
<div id="create-challenge" class="modal fade" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3>New Challenge</h3>
</div>
</div>
</div>
</div>
<div id="update-modals-entry-div">
</div>
{# Div used to inject update modal #}
<div id="update-modals-entry-div">
</div>
<div class="jumbotron">
<div class="container">
<h1>Challenges
<a class="no-decoration" href="{{ request.script_root }}/admin/chal/new">
<i class="btn-fa fas fa-plus-circle" role="button" data-toggle="tooltip" title="Create Challenge"></i>
<span role="button" data-toggle="tooltip" title="Create Challenge">
<i class="btn-fa fas fa-plus-circle"></i>
</span>
</a>
</h1>
</div>
@ -81,29 +63,46 @@
{% endif %}
</td>
<td>
<i class="btn-fa fas fa-pencil-alt edit-challenge" aria-hidden="true" data-toggle="tooltip"
data-placement="top" chal-id="{{ challenge.id }}"
title="Edit {{ challenge.name }}"></i>
<span class="edit-challenge" data-toggle="tooltip"
data-placement="top" chal-id="{{ challenge.id }}"
title="Edit {{ challenge.name }}">
<i class="btn-fa fas fa-pencil-alt" aria-hidden="true"></i>
</span>
<i class="btn-fa fas fa-file-alt preview-challenge" aria-hidden="true" data-toggle="tooltip"
data-placement="top" chal-id="{{ challenge.id }}"
title="Preview {{ challenge.name }}"></i>
<span class="preview-challenge" data-toggle="tooltip"
data-placement="top" chal-id="{{ challenge.id }}"
title="Preview {{ challenge.name }}">
<i class="btn-fa fas fa-file-alt" aria-hidden="true"></i>
</span>
<span>&nbsp; &nbsp;</span>
<i class="btn-fa fas fa-flag edit-keys" aria-hidden="true" data-toggle="tooltip" data-placement="top"
title="Edit {{ challenge.name }} flags" chal-id="{{ challenge.id }}"></i>
<i class="btn-fa fas fa-download edit-files" aria-hidden="true" data-toggle="tooltip"
data-placement="top" title="Edit {{ challenge.name }} files" chal-id="{{ challenge.id }}"></i>
<i class="btn-fa fas fa-tags edit-tags" aria-hidden="true" data-toggle="tooltip" data-placement="top"
title="Edit {{ challenge.name }} tags" chal-id="{{ challenge.id }}"></i>
<i class="btn-fa fas fa-question-circle edit-hints" aria-hidden="true" data-toggle="tooltip"
data-placement="top" title="Edit {{ challenge.name }} hints" chal-id="{{ challenge.id }}"></i>
<span class="edit-keys" data-toggle="tooltip" data-placement="top"
title="Edit {{ challenge.name }} flags" chal-id="{{ challenge.id }}">
<i class="btn-fa fas fa-flag" aria-hidden="true"></i>
</span>
<span class="edit-files" data-toggle="tooltip"
data-placement="top" title="Edit {{ challenge.name }} files"
chal-id="{{ challenge.id }}">
<i class="btn-fa fas fa-download edit-files" aria-hidden="true"></i>
</span>
<span class="edit-tags" data-toggle="tooltip" data-placement="top"
title="Edit {{ challenge.name }} tags" chal-id="{{ challenge.id }}">
<i class="btn-fa fas fa-tags" aria-hidden="true"></i>
</span>
<span class="edit-hints" data-toggle="tooltip"
data-placement="top" title="Edit {{ challenge.name }} hints"
chal-id="{{ challenge.id }}">
<i class="btn-fa fas fa-question-circle" aria-hidden="true"></i>
</span>
<span>&nbsp; &nbsp;</span>
<i class="btn-fa fas fa-times delete-challenge" aria-hidden="true" data-toggle="tooltip"
data-placement="top" title="Delete {{ challenge.name }}" chal-id="{{ challenge.id }}"></i>
<span class="delete-challenge" data-toggle="tooltip"
data-placement="top" title="Delete {{ challenge.name }}"
chal-id="{{ challenge.id }}">
<i class="btn-fa fas fa-times" aria-hidden="true"></i>
</span>
</td>
</tr>
{% endfor %}

View File

@ -45,7 +45,12 @@
<script>document.write( moment({{ solve.date|unix_time_millis }}).local().format('MMMM Do, h:mm:ss A'))</script>
</small>
</td>
<td class="text-center"><i class="fas fa-times"></i></td>
<td class="text-center">
<span class="delete-correct-submission" data-toggle="tooltip"
data-placement="top" title="Delete solve #{{ solve.id }}">
<i class="fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
</tbody>
@ -74,7 +79,7 @@
var nonce = "{{ nonce }}";
$(document).ready(function () {
$('.fa-times').click(function () {
$('.delete-correct-submission').click(function () {
var elem = $(this).parent().parent();
var chal = elem.find('.chal').attr('id');
var chal_name = elem.find('.chal').text().trim();

View File

@ -344,15 +344,13 @@
$(document).ready(function () {
$('#media-insert').click(function (e) {
var tag = $('#media-icon').children()[0].nodeName.toLowerCase();
console.log(tag);
var link = $('#media-link').val();
var fname = $('#media-filename').text();
if (tag == 'img') {
var entry = '![{0}]({1})'.format(fname, link);
} else if (tag == 'i') {
} else {
var entry = '[{0}]({1})'.format(fname, link);
}
insert_at_cursor(editor, entry);
});

View File

@ -8,7 +8,9 @@
<div class="container">
<h1>Pages
<a class="no-decoration" href="{{ request.script_root }}/admin/pages?operation=create">
<i class="btn-fa fas fa-plus-circle create-page" role="button" data-toggle="tooltip" title="Create Page"></i>
<span class="create-page" role="button" data-toggle="tooltip" title="Create Page">
<i class="btn-fa fas fa-plus-circle"></i>
</span>
</a>
</h1>
</div>
@ -52,8 +54,15 @@
{% endif %}
</td>
<td class="text-center">
<a class="no-decoration" href="{{ request.script_root }}/admin/pages?id={{ page.id }}"><i class="btn-fa fas fa-edit"></i></a>
<i class="btn-fa fas fa-times" page-id="{{ page.id }}" page-route="{{ page.route }}" page-title="{{ page.title }}"></i>
<span class="edit-page" data-toggle="tooltip" data-placement="top"
title="Edit {{ page.route }}">
<a class="no-decoration" href="{{ request.script_root }}/admin/pages?id={{ page.id }}"><i class="btn-fa fas fa-edit"></i></a>
</span>
<span class="delete-page" page-id="{{ page.id }}" page-route="{{ page.route }}"
page-title="{{ page.title }}" data-toggle="tooltip" data-placement="top"
title="Delete {{ page.route }}">
<i class="btn-fa fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
@ -70,7 +79,7 @@
var nonce = "{{ nonce }}";
$(document).ready(function () {
$('.fa-times').click(function () {
$('.delete-page').click(function () {
var elem = $(this);
var name = elem.attr("page-route");
var page_id = elem.attr("page-id");

View File

@ -129,7 +129,12 @@
<td class="text-center solve-time">
<script>document.write(moment({{ solve.date|unix_time_millis }}).local().format('MMMM Do, h:mm:ss A'))</script>
</td>
<td class="text-center"><i class="fas fa-times"></i></td>
<td class="text-center">
<span class="delete-item" data-toggle="tooltip"
data-placement="top" title="Delete solve #{{ solve.id }}">
<i class="fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
</tbody>
@ -159,7 +164,12 @@
<td class="text-center solve-time">
<script>document.write(moment({{ wrong_key.date|unix_time_millis }}).local().format('MMMM Do, h:mm:ss A'))</script>
</td>
<td class="text-center"><i class="fas fa-times"></i></td>
<td class="text-center">
<span class="delete-item" data-toggle="tooltip"
data-placement="top" title="Delete fail #{{ wrong_key.id }}">
<i class="fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
</tbody>
@ -196,7 +206,12 @@
<td class="text-center">{{ award.category }}</td>
<td class="text-center">{{ award.icon }}</td>
<td class="text-center"><i class="fas fa-times"></i></td>
<td class="text-center">
<span class="delete-item" data-toggle="tooltip"
data-placement="top" title="Delete award #{{ award.id }}">
<i class="fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
</tbody>
@ -229,7 +244,12 @@
<td class="text-center chal" id="{{ chal.id }}">{{ chal.name }}</td>
<td class="text-center">{{ chal.category }}</td>
<td class="text-center">{{ chal.value }}</td>
<td class="text-center"><i class="fas fa-check mark-correct"></i></td>
<td class="text-center">
<span class="mark-correct" data-toggle="tooltip"
data-placement="top" title="Mark {{ chal.name }} correct for {{ team.name }}">
<i class="fas fa-check"></i>
</span>
</td>
</tr>
{% endfor %}
</tbody>
@ -275,7 +295,7 @@
var nonce = "{{ nonce }}";
$(document).ready(function () {
$('.fa-times').click(function () {
$('.delete-item').click(function () {
var elem = $(this).parent().parent();
var type = elem.attr('class');
var chal_name = elem.find('.chal').text().trim();

View File

@ -6,7 +6,11 @@
{% block content %}
<div class="jumbotron">
<div class="container">
<h1>Teams <i class="btn-fa fas fa-plus-circle create-team" role="button" data-toggle="tooltip" title="Create Team"></i></h1>
<h1>Teams
<span class="create-team" role="button" data-toggle="tooltip" title="Create Team">
<i class="btn-fa fas fa-plus-circle"></i>
</span>
</h1>
</div>
</div>
@ -175,11 +179,20 @@
</div>
</td>
<td class="text-center"><span>
<i class="btn-fa fas fa-edit" data-toggle="tooltip" data-placement="top" title="Modify {{ team.name }}"></i>
<span class="edit-team" data-toggle="tooltip" data-placement="top"
title="Modify {{ team.name }}">
<i class="btn-fa fas fa-edit"></i>
</span>
{% if can_send_mail() %}
<i class="btn-fa fas fa-envelope" data-toggle="tooltip" data-placement="top" title="Email {{ team.name }}"></i>
<span class="email-team" data-toggle="tooltip" data-placement="top"
title="Email {{ team.name }}">
<i class="btn-fa fas fa-envelope"></i>
</span>
{% endif %}
<i class="btn-fa fas fa-times" data-toggle="tooltip" data-placement="top" title="Delete {{ team.name }}"></i>
<span class="delete-team" data-toggle="tooltip" data-placement="top"
title="Delete {{ team.name }}">
<i class="btn-fa fas fa-times"></i>
</span>
</span>
</td>
</tr>
@ -307,7 +320,7 @@ $(document).ready(function () {
});
});
$('.fa-edit').click(function () {
$('.edit-team').click(function () {
var elem = $(this).parent().parent().parent();
var id = elem.find('.team-id').attr('value') || '';
var name = elem.find('.team-name').attr('value') || '';
@ -323,7 +336,7 @@ $(document).ready(function () {
load_update_modal('new', '', '', '', '', '');
});
$('.fa-times').click(function () {
$('.delete-team').click(function () {
var elem = $(this).parent().parent().parent();
var team_id = elem.find('.team-id').text().trim();
var name = elem.find('.team-name').text().trim();
@ -348,7 +361,7 @@ $(document).ready(function () {
});
$('.fa-envelope').click(function () {
$('.email-team').click(function () {
var elem = $(this).parent().parent().parent();
var id = elem.find('.team-id').text().trim();
load_email_modal(id);

View File

@ -49,7 +49,10 @@
</small>
</td>
<td class="text-center">
<i class="fas fa-times"></i>
<span class="delete-incorrect-submission" data-toggle="tooltip"
data-placement="top" title="Delete fail #{{ wrong_key.id }}">
<i class="fas fa-times"></i>
</span>
</td>
</tr>
{% endfor %}
@ -79,7 +82,7 @@
var nonce = "{{ nonce }}";
$(document).ready(function () {
$('.fa-times').click(function () {
$('.delete-incorrect-submission').click(function () {
var elem = $(this).parent().parent();
var chal = elem.find('.chal').attr('id');
var chal_name = elem.find('.chal').text().trim();

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Font Awesome Free 5.0.1 by @fontawesome - http://fontawesome.com
* Font Awesome Free 5.0.4 by @fontawesome - http://fontawesome.com
* License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
svg:not(:root).svg-inline--fa {
@ -79,7 +79,7 @@ svg:not(:root).svg-inline--fa {
height: 1em;
position: relative;
text-align: center;
vertical-align: -12.5%;
vertical-align: -.125em;
width: 1em; }
.fa-layers svg.svg-inline--fa {
-webkit-transform-origin: center center;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<link rel="shortcut icon" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/vendor/bootstrap.min.css">
<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/vendor/fa-svg-with-js.css" />
<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/vendor/fa-svg-with-js.css">
<link href='{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/vendor/font.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/jumbotron.css">
<link rel="stylesheet" href="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/css/sticky-footer.css">
@ -25,7 +25,6 @@
{% endfor %}
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/moment.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/nunjucks.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/fontawesome-all.min.js"></script>
<script type="text/javascript">
var script_root = "{{ request.script_root }}";
</script>
@ -124,6 +123,7 @@
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/jquery.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/marked.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/bootstrap.bundle.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/vendor/fontawesome-all.min.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/style.js"></script>
<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/ezq.js"></script>
{% block scripts %}