Browse Source

Assigning colors to different form states

Andrej Studen 1 year ago
parent
commit
95634096da

+ 5 - 0
views/approvedPortal.html

@@ -6,6 +6,11 @@ height:120px;
 
 .gold{ background-color: gold; }
 .red{ background-color: red; }
+.green { background-color: #ecffdc;}
+.blue { background-color: #b6d0e2; }
+.brown { background-color: #eaddca; }
+.orange { background-color: #ffe5b4; }
+
 
 .large{
 	font-size: 30px;

+ 5 - 0
views/completedPortal.html

@@ -6,6 +6,11 @@ height:120px;
 
 .gold{ background-color: gold; }
 .red{ background-color: red; }
+.green { background-color: #ecffdc;}
+.blue { background-color: #b6d0e2; }
+.brown { background-color: #eaddca; }
+.orange { background-color: #ffe5b4; }
+
 
 .large{
 	font-size: 30px;

+ 4 - 0
views/formPortal.html

@@ -6,6 +6,10 @@ height:120px;
 
 .gold{ background-color: gold; }
 .red{ background-color: red; }
+.green { background-color: #ecffdc;}
+.blue { background-color: #b6d0e2; }
+.brown { background-color: #eaddca; }
+.orange { background-color: #ffe5b4; }
 
 .large{
 	font-size: 30px;

+ 5 - 0
views/reviewPortal.html

@@ -6,6 +6,11 @@ height:120px;
 
 .gold{ background-color: gold; }
 .red{ background-color: red; }
+.green { background-color: #ecffdc;}
+.blue { background-color: #b6d0e2; }
+.brown { background-color: #eaddca; }
+.orange { background-color: #ffe5b4; }
+
 
 .large{
 	font-size: 30px;

+ 3 - 0
web/crfTecant/crfVisit.js

@@ -2810,6 +2810,8 @@ function(){
 	queryArray.push(runQuery.makeQuery(targetObject,'config','crfMonitors','crfMonitorsData',[]));
 	//crfSponsors
 	queryArray.push(runQuery.makeQuery(targetObject,'config','crfSponsors','crfSponsorsData',[]));
+	//crfManagers
+	queryArray.push(runQuery.makeQuery(targetObject,'config','crfManagers','crfManagersData',[]));
 
    //study static data
    queryArray.push(
@@ -2942,6 +2944,7 @@ function(){
 	config.formConfig.crfEditors=config.formConfig.crfEditorsData.rows;
 	config.formConfig.crfMonitors=config.formConfig.crfMonitorsData.rows;
 	config.formConfig.crfSponsors=config.formConfig.crfSponsorsData.rows;
+	config.formConfig.crfManagers=config.formConfig.crfManagersData.rows;
 
 	config.formConfig.userRows=config.formConfig.userData.rows;
 	let uRows=config.formConfig.userRows;

+ 23 - 2
web/crfTecant/formPortal.js

@@ -338,6 +338,18 @@ function(){
    filter.userId=currentUser.UserId;
    filter.sites=currentSites;
 
+
+   //make a formStatus map
+   let formStatusMap=new Object();
+   this.print(fName+' formStatusMap: '+config.formConfig.formStatusg.rows.length);
+   for (let i=0;i<config.formConfig.formStatusg.rows.length;i++){
+      let fs=config.formConfig.formStatusg.rows[i];
+      let s=fs['Key'];
+      formStatusMap[s]=fs;
+      this.print(fName+' formStatusMap adding '+s);
+   }
+   this.print(fName+' formStatusMap '+Object.keys(formStatusMap).length+'/'+config.formConfig.formStatusg.rows.length);
+
    //browse through forms
 	for (let i=0;i<dataForms.length;i++){
 
@@ -376,7 +388,15 @@ function(){
 			//
 
 			let fbox=config.document.createElement("div");
-			fbox.classList.add("box","gold");
+         let color='gold';
+         this.print(fName+' status '+entry.FormStatus+' obj '+formStatusMap[entry.FormStatus]);
+         if (formStatusMap[entry.FormStatus]){
+            let c=formStatusMap[entry.FormStatus]['color'];
+            if (c) color=c;
+            this.print(fName+' status '+entry.FormStatus+' color '+c);
+         }
+
+			fbox.classList.add("box",color); 
 
 			let fp=config.document.createElement("p");
 			let id=entry.entryId;
@@ -468,8 +488,9 @@ function(){
 
 	}		  
    if (config.role=='crfManager')
+      this.print('Skipping form generator');
       //need formGenerator.js
-      formGenerator.addFormGenerator(this);
+      //formGenerator.addFormGenerator(this);
 
 }