Skip to content

Commit

Permalink
Merge pull request #124 from sei-vsarvepalli/version-2.1.5
Browse files Browse the repository at this point in the history
VINCE upgrade to 2.1.5
Also resolved #125
  • Loading branch information
sei-vsarvepalli authored Sep 21, 2023
2 parents 795fa89 + cf41520 commit b71081b
Show file tree
Hide file tree
Showing 17 changed files with 450 additions and 186 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# VINCE Changelog

Version 2.1.5 2023-09-21

* Enhanced operation of VINCEComm case discussion section, moving focus to editable div when the user chooses to edit a post
* Added dropdown menu to VINCETrack quicksearch bar, optimizing search by enabling swifter specification of advanced search settings
* Replaced certain switch-paddle checkboxes on VINCE forms with tswitch UI to make them easier to use
* Fixed bug that generated duplicates in the list of vendors on certain VINCEComm case pages


Version 2.1.4 2023-08-30

* Automated annual update to VINCE copyright date in footer
Expand Down
2 changes: 1 addition & 1 deletion bigvince/settings_.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
ROOT_DIR = environ.Path(__file__) - 3

# any change that requires database migrations is a minor release
VERSION = "2.1.4"
VERSION = "2.1.5"

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ chardet==5.0.0
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.4
cryptography==41.0.3
cryptography==41.0.4
cvelib==1.1.0
Deprecated==1.2.13
dictdiffer==0.9.0
Expand Down
70 changes: 66 additions & 4 deletions vince/static/vince/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -396,20 +396,25 @@ p {
}

.quicksearch [type='search']:focus{
background-color: rgba(0, 0, 0, 0.3);
/* background-color: rgba(0, 0, 0, 0.3); */
border-left: none;
border-bottom: none;
border-top:none;
box-shadow: none;
}

.quicksearch .button {
background-color: rgba(0, 0, 0, 0.2);
/* background-color: rgba(0, 0, 0, 0.2); */
margin-bottom: 0;
margin-left: -1px;
border-radius: 0 0 0 0;
}

.searchbar-element-wrapper {
display:table-cell;
vertical-align:middle;
}

.filter-by-dropdown {
display: inline-block;
position: relative;
Expand Down Expand Up @@ -1040,8 +1045,7 @@ body.login {
border-radius: .25rem;
}


.input-group>.form-control:not(:last-child), .input-group>.custom-select:not(:last-child) {
.input-group>.form-control:not(:last-child), .input-group>.custom-select:not(:last-child), .input-group > .searchbar-element-wrapper:not(:last-child) > .form-control {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
Expand Down Expand Up @@ -3038,6 +3042,64 @@ tr.equal td {
font-size: 12px;
}

.tswitch {
position: absolute;
display: inline-block;
width: 60px;
height: 34px;
}

.tswitch input {
opacity: 0;
width: 0;
height: 0;
}
.tslider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}

.tslider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}

input:focus + .tslider {
box-shadow: 0 0 1px #2196F3;
}

input:checked + .tslider {
background-color: #2196F3;
}

input:checked + .tslider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}

/* Rounded tsliders */
.tslider.round {
border-radius: 34px;
}
.tslider.round:before {
border-radius: 50%;
}


/*------ vinny-specific ---*/
.case-list {
Expand Down
54 changes: 30 additions & 24 deletions vince/static/vince/js/allsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,43 @@ function searchAll(e) {
if (e) {
e.preventDefault();
}

$("#id_page").val("1");

var url = $("#searchall").attr("action");
var facet = $(".search-menu .menu li .menu-active").text();
var q = $("#id_searchbar").val();

if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?q=' + $("#id_searchbar").val() + "&facet=" + facet;
window.history.pushState({path:newurl},'',newurl);
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?q=' + $("#id_searchbar").val() + "&facet=" + facet;
window.history.pushState({path:newurl},'',newurl);
}

var data = $('#searchall').serialize() + "&facet=" + facet;

lockunlock(true,'div.mainbody,div.vtmainbody','#searchresults');

window.txhr = $.ajax({
url: url,
type: "GET",
data: data,
success: function(data) {
lockunlock(false);
$("#searchresults").html(data);
},
error: function() {
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
console.log(arguments);
alert("Search failed or canceled! See console log for details.");
},
complete: function() {
/* Just safety net */
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
window.txhr = null;
}
});
success: function(data) {
if (q == $("#id_searchbar").val() && facet == $(".search-menu .menu li .menu-active").text()) {
lockunlock(false);
$("#searchresults").html(data);
}
},
error: function() {
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
console.log(arguments);
alert("Search failed or canceled! See console log for details.");
},
complete: function() {
/* Just safety net */
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
window.txhr = null;
}
});
}

$(document).ready(function() {
Expand All @@ -99,11 +105,13 @@ $(document).ready(function() {
searchAll();

$(".search-menu .menu li").on("click", "a", function(event) {
$( ".search-menu .menu li" ).each(function( index ) {
$(this).children().removeClass("menu-active");
});
$(this).toggleClass("menu-active");
searchAll(event);

$( ".search-menu .menu li" ).each(function( index ) {
$(this).children().removeClass("menu-active");
});

$(this).toggleClass("menu-active");
searchAll(event);

});
/* var search = document.getElementById("id_searchbar");
Expand All @@ -123,6 +131,4 @@ $(document).ready(function() {
}
}



});
53 changes: 37 additions & 16 deletions vince/static/vince/js/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,38 @@ function nextResults(page) {

}

var txhr = null;
let txhr = null;

function searchContacts() {
var url = $("#searchform").attr("action");
let url = $("#searchform").attr("action");
$("#loader").replaceWith("<div class='loading_gif'></div>");
$("#id_page").val("1");
var facet = $(".search-menu .menu li .menu-active").text();

let q = $("#search_vector").val()
let facet = $(".search-menu .menu li .menu-active").text();

if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?q=' + $("#search_vector").val() + "&facet=" + facet;
let newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?q=' + $("#search_vector").val() + "&facet=" + facet;
window.history.pushState({path:newurl},'',newurl);
}
var data = $('#searchform').serialize() + "&facet=" + facet;
let data = $('#searchform').serialize() + "&facet=" + facet;
if(window.txhr && 'abort' in window.txhr) {
txhr.abort();
}
lockunlock(true,'div.mainbody,div.vtmainbody','#searchresults');
txhr = $.ajax({
url: url,
type: "GET",
data: data,
success: function(data) {
$("#searchresults").html(data);
$(document).foundation();
txhr = null;
},
error: function() {
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
url: url,
type: "GET",
data: data,
success: function(data) {
if (q == $("#search_vector").val() && facet == $(".search-menu .menu li .menu-active").text()) {
$("#searchresults").html(data);
$(document).foundation();
txhr = null;
}
},
error: function() {
lockunlock(false,'div.mainbody,div.vtmainbody','#searchresults');
console.log(arguments);
alert("Search failed or canceled! See console log for details.");
},
Expand All @@ -102,14 +107,30 @@ $(document).ready(function() {
nextResults(page);
});

let params = new URL(window.location.href).searchParams;
let facetsoughtviaurl = params.get('facet')

if (facetsoughtviaurl) {
$(".search-menu .menu li a").each(function() {
if (facetsoughtviaurl == $(this).text()) {
$(this).addClass("menu-active");
} else {
$(this).removeClass("menu-active");
}
});
if ($(".menu-active").length == 0) {
$(".default-active").addClass("menu-active")
}
}

searchContacts();

$(".search-menu .menu li").on("click", "a", function(event) {
$( ".search-menu .menu li" ).each(function( index ) {
$(this).children().removeClass("menu-active");
});
$(this).toggleClass("menu-active");
event.preventDefault();
event.preventDefault();
searchContacts();

});
Expand Down
5 changes: 3 additions & 2 deletions vince/static/vince/js/vince.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,16 @@ function finish_modal(hm) {

function checkemail(vemails) {
let emails = vemails.split(",");
let remail = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
/* Increase email domain length to RFC limit of 63 */
let remail = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,63})?$/;
for(let i = 0; i < emails.length; i++) {
if(!remail.test(emails[i])) {
alert("Email entry " + emails[i] + " is invalid! \n" + "Enter valid email address before submitting.");
return false;
}
}
return true;
}
}

$(function () {

Expand Down
9 changes: 4 additions & 5 deletions vince/templates/vince/editvendorstatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ <h2>Case <a href="{{ case.get_absolute_url }}"> {{ case.get_vuid }}</a> {{ vendo
<div class="large-8 columns">-->
{% if field.name == "share" %}
<div class="switch small">
{% render_field form.share class="switch-input" %}
<label class="switch-paddle" for="{{ form.share.auto_id }}">
<span class="show-for-sr">Share?</span>
<span class="switch-active" aria-hidden="true">Yes</span>
<span class="switch-inactive" aria-hidden="true">No</span>
<label class="tswitch" for="{{ form.share.auto_id }}">
<span class="show-for-sr">Share?</span>
{% render_field form.share class="switch-input" %}
<span class="tslider round"></span>
</label>
</div>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion vince/templates/vince/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>Search</h2>
<li><a href="#" {% if facet == 'Cases' %}class="menu-active"{% endif %}>Cases</a></li>
<li><a href="#" {% if facet == 'Contacts' %}class="menu-active"{% endif %}>Contacts</a></li>
<li><a href="#" {% if facet == 'Vuls' %}class="menu-active"{% endif %}>Vuls</a></li>
<li><a href="#" {% if facet == 'Vince' %}class="menu-active"{% endif %}>Vince</a></li>
<li><a href="#" {% if facet == 'Vince' %}class="menu-active"{% endif %}>Users</a></li>
</ul>
</div>
<form id="searchall" method="GET" action="{% url 'vince:results' %}">
Expand Down
7 changes: 4 additions & 3 deletions vince/templates/vince/searchcontacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ <h2>Contacts</h2>
<div class="large-12 medium-12 small-12 columns">
<div class="search-menu">
<ul class="menu simple">
<li><a href="#" class="menu-active">All</a></li>
<li><a href="#">Contacts</a></li>
<li><a href="#" class="menu-active default-active">Contacts</a></li>
<li><a href="#">Vendors</a></li>
<li><a href="#">Users</a></li>
<li><a href="#">Groups</a></li>
<li><a href="#">VINCE</a></li>

</ul>
</div>

Expand Down
Loading

0 comments on commit b71081b

Please sign in to comment.