Exemplo n.º 1
0
def showRestaurants():
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()

    # Fetch restaurants
    restaurants = db.getAllRestaurants()

    # Render template
    return render_template('restaurants.html',
                           filesPath=filesHandler.getFilesFolder(),
                           restaurants=list(restaurants),
                           username=user['name'],
                           user_id=user['id'],
                           user_picture=user['picture'])
Exemplo n.º 2
0
def showRestaurants():
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()
    
    # Fetch restaurants
    restaurants = db.getAllRestaurants()
    
    # Render template
    return render_template(
        'restaurants.html',
        filesPath = filesHandler.getFilesFolder(),
        restaurants = list(restaurants), 
        username = user['name'], 
        user_id = user['id'], 
        user_picture = user['picture']
    )
Exemplo n.º 3
0
def showmenu(restaurant_id):
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()

    # Fetches the context restaurant
    restaurant = db.getRestaurant(restaurant_id)

    # Fetches all items from the context restaurant
    items = db.getAllRestaurantMenuItems(restaurant)

    # Fetches all courses type, and respective menu items
    courses = db.getAllRestItemsByCourses(restaurant)

    # Render template
    return render_template('menu.html',
                           filesPath=filesHandler.getFilesFolder(),
                           restaurant=restaurant,
                           items=list(items),
                           courses=courses,
                           user_id=user['id'],
                           username=user['name'],
                           user_picture=user['picture'])
Exemplo n.º 4
0
def showmenu(restaurant_id):
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()

    # Fetches the context restaurant
    restaurant = db.getRestaurant( restaurant_id )
    
    # Fetches all items from the context restaurant
    items = db.getAllRestaurantMenuItems( restaurant )

    # Fetches all courses type, and respective menu items
    courses = db.getAllRestItemsByCourses( restaurant )

    # Render template
    return render_template(
        'menu.html',
        filesPath = filesHandler.getFilesFolder(),
        restaurant = restaurant,
        items = list(items), 
        courses = courses, 
        user_id = user['id'], 
        username = user['name'],
        user_picture = user['picture'] 
    )