Changeset 622 in tmcsimulator for branches/LCSv2/views


Ignore:
Timestamp:
08/21/2020 12:19:51 PM (6 years ago)
Author:
jdalbey
Message:

LCS implement closed lane checkboxes

Location:
branches/LCSv2/views/default
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/LCSv2/views/default/list.html

    r619 r622  
    1313        <th>Route &amp; Dir /<br>Type of Closure</th> 
    1414        <th>Start Date<br>End Date<br>Est. Delay</th> 
    15         <th>Facility</th> 
     15        <th>Facility/Lanes</th> 
    1616        <th>Limits</th> 
    1717        <th>Work<br>Description</th> 
     
    2727<!-- Format date from YYYYMMDD into MMDDYYY --> 
    2828<td align="center">{{=hwy.startdate}}<BR><HR>{{=hwy.enddate}}<BR><HR>{{=hwy.estdelay}}</td> 
    29 {{=TD(hwy.facility)}} 
     29<td align='center">{{=hwy.facility}}<HR>{{=hwy.closedlanes}}</td> 
    3030<td align="center">{{=hwy.startlocation}}<BR><HR>{{=hwy.endlocation}}</td> 
    3131{{=TD(hwy.worktype)}} 
  • branches/LCSv2/views/default/list.html.bak

    r619 r622  
    11{{extend 'layout.html'}} 
    2 <h1>List of Current Log Entries</h1> 
    3 <p> 
     2<div id="pageTitle" class="header"> 
     3    List of Current Log Entries 
     4</div> 
     5<p style="text-align: center;"> 
    46    This page is just an exploration.  It won't appear in the final application.  We won't build our pages in this manner, either.  
    57</p> 
    6     <table border="1" cellpadding="5"> 
     8    <table border="1" cellpadding="5" style="margin: 0% 20% 0% 20%;"> 
    79        <tr> 
    810        <th></th> 
     
    2426<td align="center">{{=hwy.route}}&nbsp;{{=hwy.direction}}<BR><HR>{{=hwy.closuretype}}</td> 
    2527<!-- Format date from YYYYMMDD into MMDDYYY --> 
    26 <td align="center">{{=hwy.startdate[4:8]}}{{=hwy.startdate[0:4]}}<BR><HR>{{=hwy.enddate[4:8]}}{{=hwy.enddate[0:4]}}<BR><HR>{{=hwy.estdelay}}</td> 
     28<td align="center">{{=hwy.startdate}}<BR><HR>{{=hwy.enddate}}<BR><HR>{{=hwy.estdelay}}</td> 
    2729{{=TD(hwy.facility)}} 
    2830<td align="center">{{=hwy.startlocation}}<BR><HR>{{=hwy.endlocation}}</td> 
  • branches/LCSv2/views/default/submit.html

    r621 r622  
    6767</script> 
    6868<script> 
     69/*  Dynamically generate lane closed checkboxes. 
     70  When user choses "Lane" as the closure type AND "Mainline" as the Facility,  
     71  then display checkboxes for which lanes to close. 
     72*/ 
     73function closuretypechanged()  
     74{ 
     75  // Define table of routes and number of lanes for current Scenario 
     76  const lanedict = {  "5": 5,  "73": 3,  "405": 4,  "55" : 4 }; 
     77  // get references to UI elements 
     78  var rte = document.getElementById("routecombo"); 
     79  var currentRoute = rte.options[rte.selectedIndex].text; 
     80  var boxes = document.getElementById("boxes") 
     81  boxes.textContent = ''; 
     82  var e = document.getElementById("closuretype"); 
     83  var currentType = e.options[e.selectedIndex].text; 
     84  var facility = document.getElementById("facilitycombo"); 
     85  var currentFacility = facility.options[facility.selectedIndex].text; 
     86  var x = document.getElementById("lanechooser") 
     87  // See if the desired choices are selected 
     88  if (currentType == "Lane" && currentFacility=="Mainline") 
     89  { 
     90     // Validate that a route has been chosen 
     91     if (currentRoute == "") 
     92     { 
     93        alert("Must select a route before choosing lanes to close.") 
     94        e.selectedIndex = 0 
     95        return; 
     96      } 
     97      x.style.display = "block"  // make boxes visible 
     98      var boxlimit = 4;  // default number of checkboxes for unused routes 
     99      // Get the total number of lanes from the lookup table 
     100      if (currentRoute in lanedict) 
     101      { 
     102          boxlimit =  lanedict[currentRoute] 
     103          // assign limit to hidden field 
     104          document.getElementById("lanecount").value = boxlimit.toString() 
     105      } 
     106      // Create a new checkbox for the desired number of total lanes 
     107      for (boxno = 1; boxno<=boxlimit; boxno++) 
     108      { 
     109      var check = document.createElement('input') 
     110      check.type = 'checkbox'; 
     111      check.name = "lanes" 
     112      check.id = "lane"+boxno 
     113      check.value = boxno.toString() 
     114      boxes.appendChild(check); 
     115      var label = document.createElement('label') 
     116      label.htmlFor = "lane"+boxno; 
     117        label.appendChild(document.createTextNode(boxno.toString())); 
     118      boxes.appendChild(label) 
     119      } 
     120    } 
     121  else // hide the checkboxes 
     122    { 
     123        x.style.display = "none"; 
     124    } 
     125  
     126 } 
     127</script> 
     128<script> 
    69129// Handle a user click on a radio button for "existing incident" 
    70130function radioclicked() 
  • branches/LCSv2/views/default/submit.html.bak

    r621 r622  
    6767</script> 
    6868<script> 
     69/*  Dynamically generate lane closed checkboxes. 
     70  When user choses "Lane" as the closure type AND "Mainline" as the Facility,  
     71  then display checkboxes for which lanes to close. 
     72*/ 
     73function closuretypechanged()  
     74{ 
     75  // Define table of routes and number of lanes for current Scenario 
     76  const lanedict = {  "5": 5,  "73": 3,  "405": 4,  "55" : 4 }; 
     77  // get references to UI elements 
     78  var rte = document.getElementById("routecombo"); 
     79  var currentRoute = rte.options[rte.selectedIndex].text; 
     80  var boxes = document.getElementById("boxes") 
     81  boxes.textContent = ''; 
     82  var e = document.getElementById("closuretype"); 
     83  var currentType = e.options[e.selectedIndex].text; 
     84  var facility = document.getElementById("facilitycombo"); 
     85  var currentFacility = facility.options[facility.selectedIndex].text; 
     86  var x = document.getElementById("lanechooser") 
     87  // See if the desired choices are selected 
     88  if (currentType == "Lane" && currentFacility=="Mainline") 
     89  { 
     90     // Validate that a route has been chosen 
     91     if (currentRoute == "") 
     92     { 
     93        alert("Must select a route before choosing lanes to close.") 
     94        e.selectedIndex = 0 
     95        return; 
     96      } 
     97      x.style.display = "block"  // make boxes visible 
     98      var boxlimit = 4;  // default number of checkboxes for unused routes 
     99      // Get the total number of lanes from the lookup table 
     100      if (currentRoute in lanedict) 
     101      { 
     102          boxlimit =  lanedict[currentRoute] 
     103      } 
     104      // assign limit to hidden field 
     105      document.getElementById("lanecount").value = boxlimit.toString() 
     106      // Create a new checkbox for the desired number of total lanes 
     107      for (boxno = 1; boxno<=boxlimit; boxno++) 
     108      { 
     109      var check = document.createElement('input') 
     110      check.type = 'checkbox'; 
     111      check.name = "lanes" 
     112      check.id = "lane"+boxno 
     113      check.value = "#"+boxno.toString() 
     114      boxes.appendChild(check); 
     115      var label = document.createElement('label') 
     116      label.htmlFor = "lane"+boxno; 
     117        label.appendChild(document.createTextNode(boxno.toString())); 
     118      boxes.appendChild(label) 
     119      } 
     120    } 
     121  else // hide the checkboxes 
     122    { 
     123        x.style.display = "none"; 
     124    } 
     125  
     126 } 
     127</script> 
     128<script> 
     129// Handle a user click on a radio button for "existing incident" 
    69130function radioclicked() 
    70131{ 
Note: See TracChangeset for help on using the changeset viewer.