Example #1
0
def index():
    user = check_auth()
    user_hash = None
    if "PROGRAM_READY" in app.config['STAGES']:
        talks = get_talks_dict()
        extra_talks = []
    else:
        talks, extra_talks = get_talks()
        # bez razeni talks = sorted(talks, key=lambda x: x['title'])

    if user:
        user_hash = user['user_hash']

    stage_template = "index.html"
    if "END" in app.config['STAGES']:
        stage_template = "end.html"

    if "PREVIEW" in app.config['STAGES']:
        stage_template = "preview.html"

    return render_template(
        stage_template,
        user=user,
        menu=menu(),
        times=times,
        entrant_count=get_count(),
        entrants=get_entrants()[:50],
        user_votes=get_user_votes(user_hash),
        novinky=markdown_markup('novinky'),
        sponsors_main=markdown_markup('sponsors_main'),
        sponsors_medial=markdown_markup('sponsors_medial'),
        workshops=markdown_markup('workshopy-program'),
        sponsors=markdown_markup('sponsors'),
        talks=talks, extra_talks=extra_talks,
        talks_dict=get_talks_dict())
Example #2
0
def talks_all():
    user = check_auth()
    user_hash = None

    if stage_is_active(app.config['YEAR'], 'PROGRAM'):
        talks = get_talks_dict()
    else:
        talks = get_talks_by_type()

    if user:
        user_hash = user['user_hash']

    return render_template("talks.html",
                           talks=talks,
                           times=times,
                           user_votes=get_user_votes(user_hash))
Example #3
0
def talk_detail(talk_hash):
    talk = get_talk(talk_hash)
    if not talk:
        abort(404)

    author = get_account(talk['user'])

    user = check_auth()
    user_hash = None

    if user:
        user_hash = user['user_hash']

    return render_template('talk_detail.html',
                           talk=talk,
                           user_votes=get_user_votes(user_hash),
                           author=author)
Example #4
0
def talk_detail(talk_hash):
    talk = get_talk(talk_hash)
    if not talk:
        abort(404)

    author = get_account(talk['user'])

    user = check_auth()
    user_hash = None

    if user:
        user_hash = user['user_hash']

    return render_template(
        'talk_detail.html',
        talk=talk,
        user_votes=get_user_votes(user_hash),
        author=author
    )
Example #5
0
def talks_all():
    user = check_auth()
    user_hash = None

    if stage_is_active(app.config['YEAR'], 'PROGRAM'):
        talks = get_talks_dict()
        extra_talks = []
    else:
        talks, extra_talks = get_talks()

    if user:
        user_hash = user['user_hash']

    return render_template(
        "talks.html",
        talks=talks,
        times=times,
        user_votes=get_user_votes(user_hash),
        extra_talks=extra_talks
    )