Exemplo n.º 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
    )
Exemplo n.º 2
0
def get_exhibition_info():
    exhibition_info = ExhibitionInfo.get_master_db()
    form = ExhibitionInfoForm(obj=exhibition_info)
    if request.method == 'POST' and form.validate_on_submit():
        form.populate_obj(exhibition_info)
        exhibition_info.put()
        return redirect(url_for('exhibition.admin.index'))
    return render_template(
        'exhibition/admin/index.html',
        exhibition_info=exhibition_info,
        form=form
    )
Exemplo n.º 3
0
def index():
    exhibition_info = ExhibitionInfo.get_master_db()
    if not exhibition_info.is_public:
        return redirect('main_page.index')
    employees = Employee.query(Employee.is_exhibition == True)
    return render_template(
        'exhibition/index.html',
        html_class='services_page',
        exhibition_info=exhibition_info,
        employees=employees,
        active_element='exhibition'
    )
Exemplo n.º 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,
    )