Beispiel #1
0
def view_map():

    user_id = session['current_user']
    user_cities = crud.get_user_cities(user_id)

    return render_template('map.html',
                           user_cities=user_cities,
                           user_id=user_id)
Beispiel #2
0
def your_entries():

    user_id = session['current_user']
    user = crud.get_user_by_id(user_id)
    cities = crud.get_user_cities(user_id)
    profile = crud.get_user_profile(user_id)

    entries = crud.get_user_entries_ordered_by_ratings_count(user_id)[::-1]

    return render_template('your_entries.html',
                           entries=entries,
                           user=user,
                           cities=cities,
                           profile=profile)
Beispiel #3
0
def show_user(user_id):
    """Show details on a particular movie."""

    user = crud.get_user_by_id(user_id)
    cities = crud.get_user_cities(user_id)
    entries = crud.get_user_entries_ordered_by_ratings_count(user_id)[::-1]

    profile = crud.get_user_profile(user_id)

    return render_template('user_details.html',
                           user=user,
                           cities=cities,
                           entries=entries,
                           profile=profile)
Beispiel #4
0
def map_json():

    user_id = session['current_user']
    user_cities = crud.get_user_cities(user_id)

    city_list = []

    for city in user_cities:
        city_list.append({
            'user_id': session['current_user'],
            'city_id': city.city_id,
            'city_name': city.city_name,
            'user_lat': city.geo_lat,
            'user_lng': city.geo_lng
        })

    return jsonify(city_list)
Beispiel #5
0
def other_user_map_json(user_id):

    print("user_id:", user_id)

    user_cities = crud.get_user_cities(user_id)

    user_city_list = []

    for city in user_cities:
        user_city_list.append({
            'user_id': session['current_user'],
            'city_id': city.city_id,
            'city_name': city.city_name,
            'user_lat': city.geo_lat,
            'user_lng': city.geo_lng
        })

    return jsonify(user_city_list)