Пример #1
0
def handleContact():
    if request.method == 'POST':
        status = sendMessageFromContactPage(request.form)
        return render_template('contact.html',
                               data=getDataForRoute('contact', None, None,
                                                    status))

    return render_template('contact.html', data=getDataForRoute('contact'))
Пример #2
0
def showAdminIndexPage():
    if request.method == 'POST':
        status = loginAdmin(request.form)
        if status == 'success':
            session['admin'] = True
            return redirect(url_for('showAdminMainPage'))

        return render_template('admin.html',
                               data=getDataForRoute('admin', None, None,
                                                    status))

    if 'admin' in session:
        return redirect(url_for('showAdminMainPage'))

    return render_template('admin.html',
                           data=getDataForRoute('admin', None, None))
Пример #3
0
def showAdminMainPage():
    if not 'admin' in session:
        return redirect(url_for('showAdminIndexPage'))

    data = getDataForRoute('admin', None, None)
    data['page'] = 'main'

    return render_template('admin.html', data=data)
Пример #4
0
def showCookPostPage(category, post):
    data = getDataForRoute('cookPost', category, post)
    if data is None:
        return redirect(url_for('showCookCategoryPage', category=category))

    return render_template('cook.html', data=data)
Пример #5
0
def showCookPage():
    return render_template('cook.html', data=getDataForRoute('cook'))
Пример #6
0
def showBlogPost(category, post):
    data = getDataForRoute('blogPost', category, post)
    if data is None:
        return redirect(url_for('showBlogCategoryPage', category=category))

    return render_template('blog.html', data=data)
Пример #7
0
def showBlogPage():
    return render_template('blog.html', data=getDataForRoute('blog'))
Пример #8
0
def showServicesPage():
    if request.method == 'POST':
        applyForTreninings(request.form)

    return render_template('services.html', data=getDataForRoute('services'))
Пример #9
0
def showGalleryPage():
    return render_template('gallery.html', data=getDataForRoute('gallery'))
Пример #10
0
def showIndexPage():
    return render_template('home.html', data=getDataForRoute('index'))