//IDEA: Use checklists to show multiple open issues. See OMS card.
//TODO: Rename repo to something without Trello in it (TrellStats, System Status)

function getCard() {
  //Get all cards for the Trello board.
  Trello.get("boards/59166d6e65974e2250d8c1c3/cards", function(cards) {
    var data = [];
    var name = [];
    var desc = [];
    var label = [];
    var cardLink = [];

    //Pull the name, description, and label fields from each card and save in data array.
    for (let i = 0; i < cards.length; i++) {
      name[i] = cards[i].name;
      desc[i] = cards[i].desc;
      label[i] = cards[i].labels[0].name;
      cardLink[i] = cards[i].url;
      data[i] = [name[i], label[i], desc[i], cardLink[i]];
      //console.log(data);
    }
    //console.log(data);

    //Build DataTable on page load from the data array
    $(document).ready(function() {
        $('#example').DataTable( {
          paging: false,
          ordering: true,
          //order by status then name
          orderFixed: [[1, "asc"], [0, "asc"]],
          info: false,
          searching: false,
          data: data,
          columns: [
              { title: "Name" },
              { title: "Status" },
              { title: "Description of Current Status" },
              { title: "More Information", data: function(data, type, row, meta){
                return '<a href=' + data[3] + '>' + 'See More' + '</a>';
              }}
          ]
          //colors the status cell based on status text
          ,"columnDefs": [ {
              "targets": 1,
              "createdCell": function (td, cellData, rowData, row, col) {
                if ( cellData === "Down" ) {
                  $(td).css('background-color', 'pink')
                } else if (cellData === "Non-Critical"){
                  $(td).css('background-color', '#ffffbf')
                } else if (cellData === "Testing"){
                  $(td).css('background-color', '#add8e6')
                } else {
                  $(td).css('background-color', '#e7ffe7')
                }
              }
            }]
        });
    });
  });
};

getCard();

@@ -172,96 +172,448 @@
   //
-Get all cards for the Trello board.%0A  Trello.get(%22boards/59166d6e65974e2250d8c1c3/cards%22
+set the boardID (Option 1) by getting the ID from an api call to retrieve Board ID and add between boards/ and /cards%0A  //const boardID = %22boards/59166d6e65974e2250d8c1c3/cards%22%0A%0A  //set the boardID (Option 2) by taking the link to the board in Trello board settings, use the last part of the link, and add between boards/ and /cards. %0A  const boardID = %22boards/lEGovC5r/cards%22;%0A%0A  //Get all cards for the Trello board.%0A  Trello.get(boardID
 , fu

Add boardID as const and comment on how to set boardID