<commit_before>window.onload = async function onLoad() {
  getEventDetails();
  const eventHost = await getEventHost();
  const loginStatus = await getLoginStatus();
  populateVolunteeringOpportunitiesUI(eventHost, loginStatus);
  showCreateOpportunityLink(eventHost, loginStatus);
  setSignupAction();
};

/**
 * Adds the volunteering opportunities to the event card and the dropdown
 * in the signup form.
 * @param {string} eventHost email of the host of the event
 * @param {Object} loginStatus status of
 *      current user
 */
async function populateVolunteeringOpportunitiesUI(eventHost, loginStatus) {
  const eventId = getEventId();

  const response = await fetch(`/event-volunteering-data?event-id=${eventId}`);
  const opportunities = await response.json();
  showVolunteeringOpportunities(opportunities, eventHost, loginStatus);
  populateOpportunitiesDropdown(opportunities);
}

/**
 * Should the volunteering opportunities of the event card and if the
 * eventHost is the current user, add the edit link for each opportunity.
 * @param {Object} opportunities
 * @param {string} eventHost email of the host of the event
 * @param {Object} loginStatus status of current user
 */
async function showVolunteeringOpportunities(
    opportunities, eventHost, loginStatus) {
  for (const key in opportunities) {
    if (opportunities.hasOwnProperty(key)) {
      const volunteers =<commit_msg>Fix event-details to pass in correct events<commit_after>$(async function() {
  getEventDetails();
  const eventHost = await getEventHost();
  const loginStatus = await getLoginStatus();
  populateVolunteeringOpportunitiesUI(eventHost, loginStatus);
  showCreateOpportunityLink(eventHost, loginStatus);
  setSignupAction();
});

/**
 * Adds the volunteering opportunities to the event card and the dropdown
 * in the signup form.
 * @param {string} eventHost email of the host of the event
 * @param {Object} loginStatus status of
 *      current user
 */
async function populateVolunteeringOpportunitiesUI(eventHost, loginStatus) {
  const eventId = getEventId();

  const response = await fetch(`/event-volunteering-data?event-id=${eventId}`);
  const opportunities = await response.json();
  showVolunteeringOpportunities(opportunities, eventHost, loginStatus);
  populateOpportunitiesDropdown(opportunities);
}

/**
 * Should the volunteering opportunities of the event card and if the
 * eventHost is the current user, add the edit link for each opportunity.
 * @param {Object} opportunities
 * @param {string} eventHost email of the host of the event
 * @param {Object} loginStatus status of current user
 */
async function showVolunteeringOpportunities(
    opportunities, eventHost, loginStatus) {
  for (const key in opportunities) {
    if (opportunities.hasOwnProperty(key)) {
      const volunteers =
{'fraction_non_alphanumeric': 0.08742004264392324, 'fraction_numerical': 0.0, 'mean_word_length': 5.200440528634362, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1873242', 'n_tokens_mistral': 755, 'n_tokens_neox': 754, 'n_words': 258}