src/static/js/admin-registration.js
// Create a row in the unapproved users table
Create a row in the unapproved users table
Create a row in the unapproved users table
function createUserRow(user) {
  const userID = newElement("td").text(user.userID);
  const firstname = newElement("td").text(user.firstname);
  const lastname = newElement("td").text(user.lastname);
  const email = newElement("td").text(user.email);
  const status = newElement("td").text(user.status);
  const joinTime = newElement("td").text(
    new Date(parseInt(user.joinTime) * 1000).toLocaleString()
  );
  const approveButton = newElement("button")
    .addClass("btn btn-light")
    .attr({
      type: "button",
    })
    .html('<i class="fas fa-check"></i>')
    .click(() => {
      approveUser(user.userID, true, "");
    });
  const denyButton = newElement("button")
    .addClass("btn btn-light")
    .attr({
      type: "button",
    })
    .html('<i class="fas fa-times"></i>')
    .click(() => {
      currentUserID = user.userID;
      $("#denialReasonModal").modal("show");
    });
  const approve = newElement("td")
    .addClass("nowrap")
    .append(approveButton, denyButton);
  const row = newElement("tr").append(
    userID,
    firstname,
    lastname,
    email,
    status,
    joinTime,
    approve
  );
  return row;
}
function createUserRow ( user ) { const userID = newElement ( "td" ) . text ( user . userID ) ; const firstname = newElement ( "td" ) . text ( user . firstname ) ; const lastname = newElement ( "td" ) . text ( user . lastname ) ; const email = newElement ( "td" ) . text ( user . email ) ; const status = newElement ( "td" ) . text ( user . status ) ; const joinTime = newElement ( "td" ) . text ( new Date ( parseInt ( user . joinTime ) * 1000 ) . toLocaleString ( ) ) ; const approveButton = newElement ( "button" ) . addClass ( "btn btn-light" ) . attr ( { type : "button" , } ) . html ( '<i class="fas fa-check"></i>' ) . click ( ( ) => { approveUser ( user . userID , true , "" ) ; } ) ; const denyButton = newElement ( "button" ) . addClass ( "btn btn-light" ) . attr ( { type : "button" , } ) . html ( '<i class="fas fa-times"></i>' ) . click ( ( ) => { currentUserID = user . userID ; $ ( "#denialReasonModal" ) . modal ( "show" ) ; } ) ; const approve = newElement ( "td" ) . addClass ( "nowrap" ) . append ( approveButton , denyButton ) ; const row = newElement ( "tr" ) . append ( userID , firstname , lastname , email , status , joinTime , approve ) ; return row ; }
Create a row in the unapproved users table
Create a row in the unapproved users table