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'))
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))
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)
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)
def showCookPage(): return render_template('cook.html', data=getDataForRoute('cook'))
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)
def showBlogPage(): return render_template('blog.html', data=getDataForRoute('blog'))
def showServicesPage(): if request.method == 'POST': applyForTreninings(request.form) return render_template('services.html', data=getDataForRoute('services'))
def showGalleryPage(): return render_template('gallery.html', data=getDataForRoute('gallery'))
def showIndexPage(): return render_template('home.html', data=getDataForRoute('index'))