fillRestaurantHTML(restaurant = this.restaurant) {
    const name = document.getElementById('restaurant-name');
    name.innerHTML = restaurant.name;

    const address = document.getElementById('restaurant-address');
    address.innerHTML = restaurant.address;

    const image = document.getElementById('restaurant-img');
    image.className = 'restaurant-img'
    image.alt = `${restaurant.name} Restaurant`;
    image.src = DBHelper.imageUrlForRestaurant(restaurant, 'src');
    image.srcset = DBHelper.imageUrlForRestaurant(restaurant, 'srcset');
    image.sizes = '(max-width: 684px) 100vw, 50vw';

    const cuisine = document.getElementById('restaurant-cuisine');
    cuisine.innerHTML = restaurant.cuisine_type;

    document.getElementById('review-form').setAttribute('name', restaurant.id);

    // fill operating hours
    if (restaurant.operating_hours) {
      this.fillRestaurantHoursHTML();
    }
    // fill reviews
    this.fillReviewsHTML();
  }
/**
   * Create restaurant HTML and add it to the webpage
   */
Create restaurant HTML and add it to the webpage
Create restaurant HTML and add it to the webpage
fillRestaurantHTML(restaurant = this.restaurant) {
    const name = document.getElementById('restaurant-name');
    name.innerHTML = restaurant.name;
    const address = document.getElementById('restaurant-address');
    address.innerHTML = restaurant.address;
    const image = document.getElementById('restaurant-img');
    image.className = 'restaurant-img'
    image.alt = `${restaurant.name} Restaurant`;
    image.src = DBHelper.imageUrlForRestaurant(restaurant, 'src');
    image.srcset = DBHelper.imageUrlForRestaurant(restaurant, 'srcset');
    image.sizes = '(max-width: 684px) 100vw, 50vw';
    const cuisine = document.getElementById('restaurant-cuisine');
    cuisine.innerHTML = restaurant.cuisine_type;
    document.getElementById('review-form').setAttribute('name', restaurant.id);
    if (restaurant.operating_hours) {
      this.fillRestaurantHoursHTML();
    }
    this.fillReviewsHTML();
  }
fillRestaurantHTML ( restaurant = this . restaurant ) { const name = document . getElementById ( 'restaurant-name' ) ; name . innerHTML = restaurant . name ; const address = document . getElementById ( 'restaurant-address' ) ; address . innerHTML = restaurant . address ; const image = document . getElementById ( 'restaurant-img' ) ; image . className = 'restaurant-img' image . alt = ` ${ restaurant . name } ` ; image . src = DBHelper . imageUrlForRestaurant ( restaurant , 'src' ) ; image . srcset = DBHelper . imageUrlForRestaurant ( restaurant , 'srcset' ) ; image . sizes = '(max-width: 684px) 100vw, 50vw' ; const cuisine = document . getElementById ( 'restaurant-cuisine' ) ; cuisine . innerHTML = restaurant . cuisine_type ; document . getElementById ( 'review-form' ) . setAttribute ( 'name' , restaurant . id ) ; if ( restaurant . operating_hours ) { this . fillRestaurantHoursHTML ( ) ; } this . fillReviewsHTML ( ) ; }
Create restaurant HTML and add it to the webpage
Create restaurant HTML and add it to the webpage
// fill operating hours // fill reviews