Exemple #1
0
def lang(lang):
    """docstring for lang"""
    if lang not in current_app.config['LANGUAGES']:
        lang = current_app.config['BABEL_DEFAULT_LOCALE']

    session['locale'] = lang
    g.locale = lang

    posts = _get_news(current_user)
    meta = _get_blog_meta()

    page = get_page_by_slug(u'vision-diagnostic')

    canEdit = None
    if page is not None:
        canEdit = isblogger(current_user=g.user)
        process_page(page, render=render)

    return render_template(
        'home/index.html'
        , user=g.user
        , posts=posts
        , meta=meta
        , isblogger=canEdit
        , page=page
    )
Exemple #2
0
def lang(lang):
    """docstring for lang"""
    if lang not in current_app.config['LANGUAGES']:
        lang = current_app.config['BABEL_DEFAULT_LOCALE']

    session['locale'] = lang
    g.locale = lang

    posts = _get_news(current_user)
    meta = _get_blog_meta()

    page = get_page_by_slug(u'vision-diagnostic')

    canEdit = None
    if page is not None:
        canEdit = isblogger(current_user=g.user)
        process_page(page, render=render)

    return render_template(
        'home/index.html'
        , user=g.user
        , posts=posts
        , meta=meta
        , isblogger=canEdit
        , page=page
    )
Exemple #3
0
def show_page_tag(tag, slug):
    page = get_page_by_tag_slug(tag, slug)
    if page is None:
        abort(404)

    canedit = isblogger(current_user=g.user)
    process_page(page, render=render)

    return render_template(
        "pages/page.html"
        , page=page
        , isblogger=canedit
    )
Exemple #4
0
def show_page_tag(tag, slug):
    page = get_page_by_tag_slug(tag, slug)
    if page is None:
        abort(404)

    canedit = isblogger(current_user=g.user)
    process_page(page, render=render)

    return render_template(
        "pages/page.html"
        , page=page
        , isblogger=canedit
    )
Exemple #5
0
def home():
    """docstring for home."""
    posts = _get_news(current_user)
    meta = _get_blog_meta()

    page = get_page_by_slug(u'vision-diagnostic')

    canEdit = None
    if page is not None:
        canEdit = isblogger(current_user=g.user)
        process_page(page, render=render)

    return render_template(
        'home/index.html'
        , user=g.user
        , posts=posts
        , meta=meta
        , isblogger=canEdit
        , page=page
    )
Exemple #6
0
def home():
    """docstring for home."""
    # posts = _get_news(current_user)
    posts = []
    meta = _get_blog_meta()

    page = get_page_by_slug(u'vision-diagnostic')

    canEdit = None
    if page is not None:
        canEdit = isblogger(current_user=g.user)
        process_page(page, render=render)

    return render_template(
        'home/index.html'
        , user=g.user
        , posts=posts
        , meta=meta
        , isblogger=canEdit
        , page=page
    )