Marthee commited on
Commit
1f2e03d
·
verified ·
1 Parent(s): 422ab2a

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +17 -40
templates/proposed-GUI.html CHANGED
@@ -59,8 +59,6 @@
59
  <div id="menuOptions">
60
  <li onclick="openTab(event, 'home')" >Measure Plans </li>
61
  <li><a href="{{ url_for('searchDocument') }}">Search in Documents</a></li>
62
- <li><a href="{{ url_for('TableDetection') }}">Table Detection</a></li>
63
-
64
  </div>
65
  </div>
66
 
@@ -151,7 +149,7 @@
151
 
152
  <div id ="relvDocdiv">
153
  <label id="relvDocLabel">Other Relevant Documents</label>
154
- <input type="search" onkeyup=filterFunction(this.id) id="relevantSearchInput">
155
  <br>
156
  <div id="relvdiv" style="position: relative; max-height: 300px;">
157
  <div id="relvselectid" class="scrollable-container" hidden></div>
@@ -1862,7 +1860,6 @@ function getSelectValues(select) {
1862
 
1863
  //Retrieves list of projects
1864
  var doorSchedulePDF;
1865
- let selectedValues = []; // global
1866
  function getproj(){
1867
  getALLMCTNAMES();
1868
 
@@ -1958,37 +1955,26 @@ let selectedValues = []; // global
1958
  // Action foconst nameSet = new Set(); // To track unique names
1959
 
1960
  // Action for when the checkbox is clicked
1961
-
1962
  function handleCheckboxChange(event) {
1963
- if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
1964
  // Uncheck all checkboxes before checking the current one
 
1965
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1966
- if (checkbox !== event.target) {
1967
- checkbox.checked = false;
1968
- }
1969
  });
1970
- }
1971
 
1972
  // Check the current checkbox
1973
- const selectedCheckboxes = Array.from(document.querySelectorAll('input[name="measureCheckbox"]:checked'));
1974
- selectedValues = selectedCheckboxes.map(cb => cb.value);
1975
- measSelect.value = selectedValues.join(', ');
1976
-
1977
-
1978
- console.log("Selected projects:", selectedValues);
1979
-
1980
- // Save the latest selected checkbox PDF name (if only one selected)
1981
- pdfname = selectedValues.length === 1 ? selectedValues[0] : selectedValues.join(', ');
1982
 
 
 
 
 
1983
 
1984
  // Highlight the selected item
1985
- document.querySelectorAll(".measure-item").forEach(item => {
1986
- const checkbox = item.querySelector('input[name="measureCheckbox"]');
1987
- item.style.backgroundColor = checkbox.checked ? '#d3f8d3' : '';
1988
- });
1989
- console.log("Selected projects:", selectedValues);
1990
-
1991
-
1992
 
1993
 
1994
 
@@ -2004,12 +1990,11 @@ let selectedValues = []; // global
2004
  canvasimg='';
2005
  ry=[[]];
2006
  levelcheckbox.checked=false;
2007
-
2008
  measSelect.style.boxShadow='none';
2009
 
2010
  console.log(projsec.value)
2011
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
2012
- pdfname = selectedValue;
2013
  document.getElementById("all").style.display = "block";
2014
 
2015
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
@@ -2258,7 +2243,7 @@ let selectedValues = []; // global
2258
  div.appendChild(label);
2259
  measSelect.appendChild(div);
2260
 
2261
- // Handle duplicates
2262
  // if (nameSet.has(name)) {
2263
  // label.style.color = "red";
2264
  // document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error';
@@ -2645,6 +2630,7 @@ function startDropdownUpdates() {
2645
 
2646
 
2647
  function getData(form) {
 
2648
  document.getElementById("loading").hidden = false;
2649
 
2650
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
@@ -2666,10 +2652,8 @@ function getData(form) {
2666
  formvalues=Object.fromEntries(formData);
2667
 
2668
  console.log(formData,formvalues)
2669
-
2670
  // iterate through entries...
2671
  tomeasureproj=formvalues['measureCheckbox']; //proj name
2672
- //console.log('el data el fe form values:::',tomeasureproj)
2673
 
2674
 
2675
  if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
@@ -2730,14 +2714,8 @@ function getData(form) {
2730
  }
2731
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2732
  {
2733
- console.log('el data el 7ayt3amalaha push:::',selectedValues)
2734
- answers.push(selectedValues, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2735
- formData.append('answers',JSON.stringify(answers))
2736
- console.log('el data el fe answers:::',answers)
2737
- for (let pair of formData.entries()) {
2738
- console.log(`${pair[0]}: ${pair[1]}`);
2739
- }
2740
-
2741
  }
2742
  }
2743
 
@@ -4173,7 +4151,6 @@ dialog_container.style.display = "block";
4173
  }
4174
  };
4175
 
4176
-
4177
  function handleKey(event, id) {
4178
  const ignoredKeys = [
4179
  'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
 
59
  <div id="menuOptions">
60
  <li onclick="openTab(event, 'home')" >Measure Plans </li>
61
  <li><a href="{{ url_for('searchDocument') }}">Search in Documents</a></li>
 
 
62
  </div>
63
  </div>
64
 
 
149
 
150
  <div id ="relvDocdiv">
151
  <label id="relvDocLabel">Other Relevant Documents</label>
152
+ <input type="search" onkeydown="handleKey(event, this.id)" id="relevantSearchInput">
153
  <br>
154
  <div id="relvdiv" style="position: relative; max-height: 300px;">
155
  <div id="relvselectid" class="scrollable-container" hidden></div>
 
1860
 
1861
  //Retrieves list of projects
1862
  var doorSchedulePDF;
 
1863
  function getproj(){
1864
  getALLMCTNAMES();
1865
 
 
1955
  // Action foconst nameSet = new Set(); // To track unique names
1956
 
1957
  // Action for when the checkbox is clicked
 
1958
  function handleCheckboxChange(event) {
 
1959
  // Uncheck all checkboxes before checking the current one
1960
+
1961
  document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
1962
+ checkbox.checked = false;
 
 
1963
  });
 
1964
 
1965
  // Check the current checkbox
1966
+ event.target.checked = true;
 
 
 
 
 
 
 
 
1967
 
1968
+ // Action when checkbox is clicked (e.g., log the selected project)
1969
+ let selectedValue = event.target.value;
1970
+ measSelect.value=selectedValue;
1971
+ console.log("Selected project:", selectedValue);
1972
 
1973
  // Highlight the selected item
1974
+ document.querySelectorAll(".measure-item").forEach(item => {
1975
+ item.style.backgroundColor = ''; // Reset background color for all items
1976
+ });
1977
+ event.target.closest(".measure-item").style.backgroundColor = '#d3f8d3'; // Highlight the selected item
 
 
 
1978
 
1979
 
1980
 
 
1990
  canvasimg='';
1991
  ry=[[]];
1992
  levelcheckbox.checked=false;
1993
+ pdfname=selectedValue;
1994
  measSelect.style.boxShadow='none';
1995
 
1996
  console.log(projsec.value)
1997
  if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) {
 
1998
  document.getElementById("all").style.display = "block";
1999
 
2000
  pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
 
2243
  div.appendChild(label);
2244
  measSelect.appendChild(div);
2245
 
2246
+ // // Handle duplicates
2247
  // if (nameSet.has(name)) {
2248
  // label.style.color = "red";
2249
  // document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error';
 
2630
 
2631
 
2632
  function getData(form) {
2633
+
2634
  document.getElementById("loading").hidden = false;
2635
 
2636
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
 
2652
  formvalues=Object.fromEntries(formData);
2653
 
2654
  console.log(formData,formvalues)
 
2655
  // iterate through entries...
2656
  tomeasureproj=formvalues['measureCheckbox']; //proj name
 
2657
 
2658
 
2659
  if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
 
2714
  }
2715
  else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') )
2716
  {
2717
+ answers.push(tomeasureproj, 0,[] , 0,0,pdfpath , doorSchedulePDF,groupedValues);
2718
+ formData.append('answers',JSON.stringify(answers))
 
 
 
 
 
 
2719
  }
2720
  }
2721
 
 
4151
  }
4152
  };
4153
 
 
4154
  function handleKey(event, id) {
4155
  const ignoredKeys = [
4156
  'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',