Exemple #1
0
def index():
    about = About.get_master_db()
    about_info = about.short_info

    galleries = Gallery.query(Gallery.is_public==True).order(-Gallery.created)
    images = []
    for gallery in galleries:
        for img in gallery.images:
            if len(images) >= 4:
                break
            images.append(img)

    excursions = ExcursionType.query(ExcursionType.is_public == True).count()
    hotels = Region.query(Region.is_public == True).count()
    exhibition_info = ExhibitionInfo.get_master_db().is_public
    investments = InvestmentInfo.get_master_db().is_public
    tenancy = TenancyInfo.get_master_db().is_public
    coach = CoachInfo.get_master_db().is_public
    soc_widgets = SocWidget.query(SocWidget.is_public == True)

    return render_template(
        'main_page/index.html',
        html_class='main_page',
        about=about_info,
        gallery=images,
        hotels=hotels,
        exhibition_info=exhibition_info,
        excursions=excursions,
        investments=investments,
        tenancy=tenancy,
        coach=coach,
        soc_widgets=soc_widgets
    )
Exemple #2
0
def index():
    coach_info = CoachInfo.get_master_db()
    form = CoachInfoForm(obj=coach_info)
    if request.method == 'POST' and form.validate_on_submit():
        form.populate_obj(coach_info)
        coach_info.put()
        return redirect(url_for('coach.admin.index'))
    return render_template(
        'coach/admin/index.html',
        form=form
    )
Exemple #3
0
def index():
    coach_info = CoachInfo.get_master_db()
    coaches = Coach.query(Coach.is_public == True).order(-Coach.order_id)
    employees = Employee.query(Employee.is_investment == True)
    return render_template(
        'coach/index.html',
        html_class='services_page',
        coach_info=coach_info,
        coaches=coaches,
        employees=employees,
        active_element='coach'
    )
Exemple #4
0
def get_services_side(active_element=None):
    excursions = ExcursionType.query(ExcursionType.is_public == True).order(ExcursionType.order_id)

    regions = Region.query(Region.is_public == True).order(Region.order_id)

    exhibition = ExhibitionInfo.get_master_db()
    exhibition = exhibition.description and exhibition.is_public

    investments = InvestmentInfo.get_master_db().is_public or TenancyInfo.get_master_db().is_public
    coach = CoachInfo.get_master_db().is_public

    return render_template(
        "j_env/services_side.html",
        excursions=excursions,
        regions=regions,
        exhibition=exhibition,
        investments=investments,
        coach=coach,
        active_element=active_element,
    )