def howitworks_list(language_suffix): save_lang(language_suffix) return render_template('not_ready.html', language_suffix=language_suffix, location_suffix=get_loc(), countdown_time='May 1, 2015 15:03:25', debug=app.debug)
def events_g_list(language_suffix): save_lang(language_suffix) return render_template('not_ready.html', language_suffix = language_suffix, location_suffix = get_loc(), countdown_time = 'May 3, 2015 15:03:25', debug=app.debug) events = Event.query.all() return render_template('g_events.html', language_suffix = language_suffix, location_suffix = get_loc(), rand=random.randint(1,1000000), events=events, debug=app.debug)
def cameramen_g_list(language_suffix): save_lang(language_suffix) return render_template('not_ready.html', language_suffix=language_suffix, location_suffix=get_loc(), countdown_time='May 7, 2015 15:03:25', debug=app.debug) cameramen = Cameraman.query.all() return render_template('g_cameramen.html', language_suffix=language_suffix, location_suffix=get_loc(), rand=random.randint(1, 1000000), cameramen=cameramen, debug=app.debug)
def riders_g_list(language_suffix): save_lang(language_suffix) return render_template('not_ready.html', language_suffix=language_suffix, location_suffix=get_loc(), countdown_time='May 14, 2015 15:03:25', debug=app.debug) riders = Rider.query.all() return render_template('g_riders.html', language_suffix=language_suffix, location_suffix=get_loc(), rand=random.randint(1, 1000000), riders=riders, debug=app.debug)
def news_g_list(language_suffix): save_lang(language_suffix) return render_template('not_ready.html', language_suffix=language_suffix, location_suffix=get_loc(), countdown_time='May 11, 2015 15:03:25', debug=app.debug) news = News.query.all() return render_template('g_news.html', language_suffix=language_suffix, location_suffix=get_loc(), rand=random.randint(1, 1000000), news=news, debug=app.debug)
def resorts_g_list(language_suffix): save_lang(language_suffix) cbr = {} resorts = db.session.query(Resort).all() #get_loc_id() location = db.session.query(Location).filter(Location.suffix==get_loc()).first() for resort in resorts: share_text = resort.share_text.replace('_url_', get_site_url()+url_for('resorts_g_list', language_suffix=language_suffix)+'#id'+str(resort.id)) share_text = share_text.encode('utf-8') share_text = urllib.quote(share_text) cbr[resort.id] = { 'ID' : resort.id, 'NAME' : resort.name, 'PHONE' : resort.phone, 'ADDRESS' : resort.address, 'URL_SITE' : resort.url_site, 'URL_IG' : resort.url_ig, 'URL_VK' : resort.url_vk, 'URL_FB' : resort.url_fb, 'URL_IMG': resort.url_img, 'LA' : resort.la, 'LO' : resort.lo, 'OWM_ID' : resort.owm_id, 'DESCRIPTION' : resort.description, 'SHARE_TEXT' : share_text, 'CAMERAS' : [] } webcameras = db.session.query(Resort, Webcamera).join(Webcamera).all() for camera in webcameras: cbr[camera.Resort.id]['CAMERAS'].append({ 'ID' : camera.Webcamera.id, 'NAME' : camera.Webcamera.name, 'IMG_LINK' : camera.Webcamera.img_link, 'IFRAME_LINK' : camera.Webcamera.iframe_link, 'IMG_NA' : camera.Webcamera.img_na, 'LOAD_FROM_IFRAME' : camera.Webcamera.load_from_iframe }) return render_template('g_resorts.html', language_suffix = language_suffix, location_suffix = get_loc(), resorts = cbr, location_header = 'All resorts', location_subheader = 'List of all resorts', rand=random.randint(1,1000000), debug=app.debug)
def camps_g_list(language_suffix): save_curr('camps_g_list') save_lang(language_suffix) camps = Camp.query.all() return render_template('g_camps.html', language_suffix=language_suffix, location_suffix=get_loc(), rand=random.randint(1, 1000000), camps=camps, debug=app.debug)
def locations_g_list(language_suffix): save_lang(language_suffix) locations = db.session.query(Location).all() for loc in locations: loc.url = '/'+get_lang()+'/'+loc.suffix+'/' return render_template('g_locations.html', language_suffix = language_suffix, location_suffix = get_loc(), debug = app.debug, locations = locations )
def resorts_page(language_suffix, location_suffix, id): save_lang(language_suffix) save_loc(location_suffix) resort = db.session.query(Resort).filter(Resort.id==id).first() location = db.session.query(Location).filter(Location.suffix==get_loc()).first() share_text = resort.share_text.replace('_url_', get_site_url()+url_for('resorts_s_page', language_suffix=language_suffix, location_suffix=location_suffix, id=resort.id)) share_text = share_text.encode('utf-8') share_text = urllib.quote(share_text) resort_obj = { 'ID' : resort.id, 'NAME' : resort.name, 'PHONE' : resort.phone, 'ADDRESS' : resort.address, 'URL_SITE' : resort.url_site, 'URL_IG' : resort.url_ig, 'URL_VK' : resort.url_vk, 'URL_FB' : resort.url_fb, 'URL_IMG': resort.url_img, 'LA' : resort.la, 'LO' : resort.lo, 'OWM_ID' : resort.owm_id, 'DESCRIPTION' : resort.description, 'SHARE_TEXT' : share_text, 'HOW_TO_GET' : resort.how_to_get, 'CAMERAS' : [] } webcameras = db.session.query(Resort, Webcamera).join(Webcamera).filter(Resort.id==id).all() for camera in webcameras: resort_obj['CAMERAS'].append({ 'ID' : camera.Webcamera.id, 'NAME' : camera.Webcamera.name, 'IMG_LINK' : camera.Webcamera.img_link, 'IFRAME_LINK' : camera.Webcamera.iframe_link, 'IMG_NA' : camera.Webcamera.img_na, 'LOAD_FROM_IFRAME' : camera.Webcamera.load_from_iframe }) return render_template('p_resort.html', language_suffix = language_suffix, location_suffix = location_suffix, resort = resort_obj, rand=random.randint(1,1000000), debug=app.debug)