Skip to content

Commit 3c07a2f

Browse files
author
George
committed
slider updates
1 parent 5bfe7d7 commit 3c07a2f

File tree

2 files changed

+65
-13
lines changed

2 files changed

+65
-13
lines changed

idc/settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ def GET_BQ_COHORT_SETTINGS():
473473
ACCOUNT_EMAIL_REQUIRED = True
474474
ACCOUNT_USERNAME_REQUIRED = bool(os.environ.get('ACCOUNT_USERNAME_REQUIRED', 'False') == 'True')
475475
ACCOUNT_EMAIL_VERIFICATION = os.environ.get('ACCOUNT_EMAIL_VERIFICATION', 'mandatory').lower()
476+
477+
ACCOUNT_EMAIL_VERIFICATION = os.environ.get('ACCOUNT_EMAIL_VERIFICATION', 'none').lower()
478+
476479
ACCOUNT_EMAIL_SUBJECT_PREFIX = "[Imaging Data Commons] "
477480
ACCOUNTS_PASSWORD_EXPIRATION = os.environ.get('ACCOUNTS_PASSWORD_EXPIRATION',120) # Max password age in days
478481
ACCOUNTS_PASSWORD_HISTORY = os.environ.get('ACCOUNTS_PASSWORD_HISTORY', 5) # Max password history kept
@@ -514,7 +517,9 @@ def GET_BQ_COHORT_SETTINGS():
514517
# These settings allow use of MailGun as a simple API call
515518
EMAIL_SERVICE_API_URL = os.environ.get('EMAIL_SERVICE_API_URL', '')
516519
EMAIL_SERVICE_API_KEY = os.environ.get('EMAIL_SERVICE_API_KEY', '')
517-
NOTIFICATION_EMAIL_FROM_ADDRESS = os.environ.get('NOTIFICATOON_EMAIL_FROM_ADDRESS', '[email protected]')
520+
#NOTIFICATION_EMAIL_FROM_ADDRESS = os.environ.get('NOTIFICATOON_EMAIL_FROM_ADDRESS', '[email protected]')
521+
522+
NOTIFICATION_EMAIL_FROM_ADDRESS = os.environ.get('NOTIFICATOON_EMAIL_FROM_ADDRESS', 'info@localhost')
518523

519524
#########################
520525
# django-anymail #

static/js/image_search.js

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ require([
9898

9999
window.setSlider = function (slideDiv, reset, strt, end, isInt, updateNow) {
100100
//var slideDiv = divName + "_slide";
101+
var max = $('#' + slideDiv).slider("option", "max");
102+
101103
var divName = slideDiv.replace("_slide","");
102104

103105
if (reset) {
@@ -131,7 +133,7 @@ require([
131133
nm.push(filterCats[ind].id);
132134
}
133135
nm.push(divName);
134-
filtAtt = nm.join('.')+ '_btw';
136+
filtAtt = nm.join('.')+ '_rng';
135137
if (reset) {
136138
if ( (window.filterObj.hasOwnProperty(filtAtt)) && (window.filterObj[filtAtt].hasOwnProperty('rng')) ) {
137139
delete window.filterObj[filtAtt]['rng'];
@@ -144,7 +146,7 @@ require([
144146
if (isInt) {
145147
attVal = [parseInt(strt), parseInt(end)];
146148
// edge effect
147-
attVal = [parseInt(strt), parseInt(end) - 1];
149+
attVal = [parseInt(strt), parseInt(end) ];
148150
} else {
149151
attVal = [parseFloat(strt), parseFloat(end)];
150152
}
@@ -153,6 +155,12 @@ require([
153155
window.filterObj[filtAtt] = new Object();
154156
}
155157
window.filterObj[filtAtt]['rng'] = attVal;
158+
if (end<max){
159+
window.filterObj[filtAtt]['type']='lte';
160+
}
161+
else{
162+
window.filterObj[filtAtt]['type']='btw';
163+
}
156164
}
157165

158166

@@ -185,7 +193,7 @@ require([
185193
}
186194
}
187195
}
188-
else if (curKey.endsWith('_btw')) {
196+
else if (curKey.endsWith('_rng')) {
189197
var realKey=curKey.substring(0, curKey.length-4).split('.').pop();
190198
var disp = $('#'+realKey+'_heading').children()[0].innerText;
191199
if (curKey.startsWith('tcga_clinical')){
@@ -195,7 +203,7 @@ require([
195203

196204
var fStr='';
197205
if ('rng' in filterObj[curKey]){
198-
fStr += filterObj[curKey]['rng'][0].toString()+'-'+(filterObj[curKey]['rng'][1] + 1).toString();
206+
fStr += filterObj[curKey]['rng'][0].toString()+'-'+(filterObj[curKey]['rng'][1] ).toString();
199207
}
200208
if (('rng' in filterObj[curKey]) && ('none' in filterObj[curKey])){
201209
fStr+=', ';
@@ -283,7 +291,7 @@ require([
283291
}
284292
}
285293
else{
286-
if (curKey.endsWith('_btw')) {
294+
if (curKey.endsWith('_rng')) {
287295
var realKey=curKey.substring(0, curKey.length-4).split('.').pop();
288296
var disp = $('#'+realKey+'_heading').children()[0].innerText;
289297
var fStr='';
@@ -429,7 +437,7 @@ require([
429437

430438
window.addNone = function(elem, parStr, updateNow)
431439
{
432-
var id = parStr+$(elem).parent()[0].id+"_btw";
440+
var id = parStr+$(elem).parent()[0].id+"_rng";
433441

434442
if (elem.checked){
435443
if (!(id in window.filterObj)) {
@@ -506,6 +514,37 @@ require([
506514

507515
}
508516

517+
var setFromSlider = function(divName, filtName, min, max){
518+
var slideName = divName + '_slide';
519+
var inpName = divName + '_input';
520+
$('#' + slideName).addClass('used');
521+
var val = $('#' + inpName)[0].value;
522+
var valArr = val.split('-');
523+
var attVal = [];
524+
if (isInt) {
525+
attVal = [parseInt(valArr[0]), parseInt(valArr[1]) ];
526+
} else {
527+
attVal = [parseFloat(valArr[0]), parseFloat(valArr[1])];
528+
}
529+
530+
if (!( filtName in window.filterObj )) {
531+
window.filterObj[filtName] = new Object();
532+
}
533+
window.filterObj[filtName]['rng'] = attVal;
534+
if (valArr[1]<max){
535+
window.filterObj[filtName]['type']='_lte'
536+
}
537+
else{
538+
window.filterObj[filtName]['type']='_bte'
539+
}
540+
541+
if (filtName.startsWith('tcga_clinical')) {
542+
checkTcga();
543+
}
544+
mkFiltText();
545+
updateFacetsData(true);
546+
547+
}
509548

510549
var mkSlider = function (divName, min, max, step, isInt, wNone, parStr, attr_id, attr_name) {
511550

@@ -550,7 +589,8 @@ require([
550589
nm.push(filterCats[ind].id);
551590
}
552591
nm.push(divName);
553-
var filtName = nm.join('.') + '_btw';
592+
var filtName = nm.join('.') + '_rng';
593+
//var filtName = nm;
554594

555595
$('#' + divName).append('<div id="' + slideName + '"></div> <input id="' + inpName + '" type="text" value="' + strtInp + '" style="display:none"> <button class="reset"" style="display:block;margin-top:18px" onclick=\'setSlider("' + slideName + '",true,0,0,' + String(isInt) + ', true)\'>Clear Slider</button>');
556596
$('#'+slideName).append(labelMin);
@@ -578,12 +618,19 @@ require([
578618
},
579619

580620
stop: function (event, ui) {
621+
//setFromSlider(divName, filtName, min, max);
622+
$('#' + slideName).addClass('used');
623+
var val = $('#' + inpName)[0].value;
624+
var valArr = val.split('-');
625+
626+
window.setSlider(slideName, false, valArr[0], valArr[1], isInt, true);
627+
/*
581628
$('#' + slideName).addClass('used');
582629
var val = $('#' + inpName)[0].value;
583630
var valArr = val.split('-');
584631
var attVal = [];
585632
if (isInt) {
586-
attVal = [parseInt(valArr[0]), parseInt(valArr[1]) - 1];
633+
attVal = [parseInt(valArr[0]), parseInt(valArr[1]) ];
587634
} else {
588635
attVal = [parseFloat(valArr[0]), parseFloat(valArr[1])];
589636
}
@@ -598,7 +645,7 @@ require([
598645
}
599646
mkFiltText();
600647
updateFacetsData(true);
601-
648+
*/
602649
}
603650
}).find('.ui-slider-range').append(tooltipL).append(tooltipR);
604651

@@ -1372,7 +1419,7 @@ require([
13721419
else{
13731420
nmA = ckey.split('.');
13741421
nm=nmA[nmA.length-1];
1375-
if (nm.endsWith('_btw')){
1422+
if (nm.endsWith('_rng')){
13761423

13771424
if ( ('rng' in window.filterObj[ckey]) && ('none' in window.filterObj[ckey]) ){
13781425
filtObj[nm] = [window.filterObj[ckey]['rng'],'None']
@@ -1382,7 +1429,7 @@ require([
13821429
filtObj[nm] = window.filterObj[ckey]['rng']
13831430
}
13841431
else if ('none' in window.filterObj[ckey]){
1385-
noneKey=nm.replace('_btw','');
1432+
noneKey=nm.replace('_rng','');
13861433
filtObj[noneKey]=['None'];
13871434
}
13881435

@@ -2463,7 +2510,7 @@ require([
24632510
//var min = Math.ceil($(this).data('attr-min') * 1000)/1000;
24642511
//var min = Math.floor($(this).data('attr-min'));
24652512
var min = 0;
2466-
var max = Math.floor($(this).data('attr-max'));
2513+
var max = Math.ceil($(this).data('attr-max'));
24672514
/* if (this.id.startsWith('Glycolysis') ){
24682515
min = 0;
24692516
max = 300;

0 commit comments

Comments
 (0)