Skip to content

Design fixes to footer, tags input, and filters snippet #6751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions dojo/static/dojo/css/dojo.css
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,19 @@ input#simple_search {
width: 100%;
}

.dojo-modals-wrapper {
display: none;
flex-direction: column;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
}

.footer {
background-color: #F8F8F8;
border-top: 1px solid #dcdcdc;
Expand Down Expand Up @@ -1020,18 +1033,30 @@ div.custom-search-form {
#page-wrapper {
margin: 75px 0 0 0;
}

#footer-wrapper {
margin: 75px 0 0 0;
}
}

@media (min-width: 359px) {
#page-wrapper {
margin: 100px 0 0 0;
}

#footer-wrapper {
margin: 100px 0 0 0;
}
}

@media (min-width: 600px) {
#page-wrapper {
margin: 50px 0 0 0;
}

#footer-wrapper {
margin: 50px 0 0 0;
}
}

@media (min-width: 768px) {
Expand All @@ -1043,6 +1068,11 @@ div.custom-search-form {
margin: 0 0 0 175px;
}

#footer-wrapper {
margin: 0 0 0 175px;
border-left: 1px solid #e7e7e7;
}

li#minimize-menu-li {
display: inline-block;
visibility: visible;
Expand Down Expand Up @@ -1085,6 +1115,11 @@ div.custom-search-form {

body.min #page-wrapper {
margin: 0 0 0 50px;
border-left: 1px solid #e7e7e7;
}

body.min #footer-wrapper {
margin: 0 0 0 50px;
}

body.min div.navbar-default.sidebar {
Expand Down Expand Up @@ -1130,6 +1165,31 @@ div.custom-search-form {
margin-right: 25px;
}

.dojo-filter-set.form-inline .filter-form-group {
display: flex;
flex-wrap: wrap;
flex-basis: auto;
flex-grow: 4;
align-content: stretch;
margin-bottom: 10px;
vertical-align: middle;
margin-right: 25px;
}

.dojo-filter-set.form-inline .filter-form-input {
margin-right: 25px;
margin-bottom: 10px;
}

.dojo-filter-set.form-inline .filter-form-control {
width: auto!important;
vertical-align: middle;
}

.dojo-filter-set.form-inline .form-control {
height: auto!important;
}

.report-filter-set {
padding-left: 10px;
}
Expand Down
12 changes: 12 additions & 0 deletions dojo/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,16 @@ <h3 class="no-margin-top" style="padding-bottom: 5px;">
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->

<!-- .dojo-modals-wrapper -->
<div id="dojo-modals-wrapper" class="dojo-modals-wrapper">
{% block modals %}
{% endblock %}
</div>
<!-- /.dojo-modals-wrapper -->

<!-- #footer-wrapper -->
<div id="footer-wrapper">
{% block footer %}
<footer class="footer">
<div class="container">
Expand Down Expand Up @@ -1035,6 +1045,8 @@ <h3 class="no-margin-top" style="padding-bottom: 5px;">
<p id="disable_count" class="hidden">{{ 'DISABLE_ALERT_COUNTER'|setting_enabled }}</p>
</footer>
{% endblock %}
</div>
<!-- /#footer-wrapper -->
</div>

<!-- /#wrapper -->
Expand Down
3 changes: 1 addition & 2 deletions dojo/templates/dojo/ad_hoc_findings.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ <h4> Github </h4>
$ = django.jQuery;
$(function () {
$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids') {
if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids' && !$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
Expand Down
43 changes: 21 additions & 22 deletions dojo/templates/dojo/add_findings.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,28 @@ <h4> JIRA </h4>
{% endif %}
});

$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}
$("textarea").each(function (index, elem) {
if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids') {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
}
});
if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids' && !$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
}
});

$("#add_finding").submit(function () {
var isFormValid = true;
Expand Down
86 changes: 44 additions & 42 deletions dojo/templates/dojo/add_group.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,62 @@
{% load display_tags %}
{% load static %}
{% block add_css %}

<link rel="stylesheet" href="{% static "easymde/dist/easymde.min.css" %}">
<link rel="stylesheet" href="{% static "easymde/dist/easymde.min.css" %}">
{% endblock %}
{% block add_styles %}
.editor-toolbar, .editor-statusbar, .editor-preview-side, .CodeMirror {
width: 70% !important;
}
.chosen-container.chosen-container-multi {
width: 70% !important;
}
.editor-toolbar, .editor-statusbar, .editor-preview-side, .CodeMirror {
width: 70% !important;
}

.chosen-container.chosen-container-multi {
width: 70% !important;
}
{% endblock %}
{% block content %}

{% block content %}
<form class="form-horizontal" method="post">{% csrf_token %}
<fieldset>
<legend>Default Information</legend>
{% include "dojo/form_fields.html" with form=form %}
</fieldset>
<fieldset>
<legend>Global Role</legend>
{% include "dojo/form_fields.html" with form=global_role_form %}
</fieldset>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input class="btn btn-primary" type="submit" name="add_group" value="Submit"/>
<fieldset>
<legend>Default Information</legend>
{% include "dojo/form_fields.html" with form=form %}
</fieldset>
<fieldset>
<legend>Global Role</legend>
{% include "dojo/form_fields.html" with form=global_role_form %}
</fieldset>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input class="btn btn-primary" type="submit" name="add_group" value="Submit"/>
</div>
</div>
</div>
</form>
{% endblock %}

{% block postscript %}
<script type="application/javascript" src="{% static "easymde/dist/easymde.min.js" %}"></script>
<script type="application/javascript">
$(function () {
$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}
$(function () {
$("textarea").each(function (index, elem) {
if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
if(!$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
}
});
});
});
</script>
{% endblock %}
4 changes: 2 additions & 2 deletions dojo/templates/dojo/add_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ <h3> {{ name }} {{ template }}</h3>

$(function () {
$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

if (elem.name != 'vulnerability_ids') {
if (elem.name != 'vulnerability_ids' && !$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
Expand All @@ -88,6 +87,7 @@ <h3> {{ name }} {{ template }}</h3>
mde.render();
}
});

// add req id to input field which enables input length check
$("input").each(function (index, elem) {

Expand Down
3 changes: 1 addition & 2 deletions dojo/templates/dojo/apply_finding_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ <h3> Apply template to a Finding</h3>

$(function () {
$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

if (elem.name != 'vulnerability_ids') {
if (elem.name != 'vulnerability_ids' && !$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
Expand Down
3 changes: 1 addition & 2 deletions dojo/templates/dojo/edit_finding.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,12 @@ <h4> GitHub </h4>
});

$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids') {
if (elem.name != 'endpoints_to_add' && elem.name != 'vulnerability_ids' && !$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
Expand Down
29 changes: 15 additions & 14 deletions dojo/templates/dojo/edit_presets.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,26 @@
<script type="application/javascript">
$(function () {
$("textarea").each(function (index, elem) {

if (elem.hasAttribute("required")) {
elem.removeAttribute("required");
elem.id = "req"
}

var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
if(!$(elem).hasClass('select2-search__field')) {
var mde = new EasyMDE({
spellChecker: false,
element: elem,
autofocus: false,
forceSync: true,
toolbar: ["bold", "italic", "heading", "|",
"quote", "unordered-list", "ordered-list", "|",
"link", "image", "|",
"table", "horizontal-rule", "code", "|",
"guide"
]
});
mde.render();
}
});

});
Expand Down
Loading