def custom_static_html(route): if route == 'index' and get_config('ctf_theme') == 'aeolus': return render_template('index.html') page = get_page(route) if page is None: abort(404) else: if page.auth_required and authed() is False: return redirect(url_for('auth.login', next=request.path)) return render_template('page.html', content=markdown(page.content))
def static_html(route): """ Route in charge of routing users to Pages. :param route: :return: """ page = get_page(route) if page is None: abort(404) else: if page.auth_required and authed() is False: return redirect(url_for("auth.login", next=request.full_path)) return render_template("page.html", content=page.html, title=page.title)
def static_html(route): """ Route in charge of routing users to Pages. :param route: :return: """ page = get_page(route) if page is None: abort(404) else: if page.auth_required and authed() is False: return redirect(url_for('auth.login', next=request.path)) return render_template('page.html', content=markdown(page.content))
def static_html(route): """ Route in charge of routing users to Pages. :param route: :return: """ page = get_page(route) if page is None: if (ctftime() or current_user.is_admin() or (ctf_ended() and view_after_ctf())): filename = safe_join(app.root_path, "static", route) if os.path.isfile(filename): return send_file(filename) abort(404) else: if page.auth_required and authed() is False: return redirect(url_for("auth.login", next=request.full_path)) return render_template("page.html", content=markdown(page.content))
def static_html(route): """ Route in charge of routing users to Pages. :param route: :return: """ page = get_page(route) if page is None: abort(404) else: if route == 'index': try: highscore = str(get_standings()[0][3]).rjust(6, '0') except: highscore = '000000' return render_template('index.html', highscore=highscore) elif page.auth_required and authed() is False: return redirect(url_for('auth.login', next=request.full_path)) return render_template("page.html", content=markdown(page.content))