コード例 #1
0
def render_user_profile(user_id):
    with app.app_context():
        user, error = user_service.get_by_id(user_id)
        if error:
            return error.description

        return render_template('user_page/user_profile.html', user=user)
コード例 #2
0
def render_all_companies():
    with app.app_context():
        companies, error = company_service.get_all_companies()
        if error:
            return jsonify(error.jsonify())
        return render_template('companies_page/companies.html',
                               companies=companies)
コード例 #3
0
def render_user_subscriptions(user_email):
    with app.app_context():
        if user_email is None:
            return ""

        user, error = user_service.get_by_email(user_email)
        if error:
            return error.description

        if user is None:
            return "User %s does not exists" % (user_email)

        user_subscription, error = user_subscriptions_service.get_subscriptions_for_user(
            user.id)
        if error:
            return error.description

        user_subscription.companies = []
        for company_id in user_subscription.company_ids:
            company, error = company_service.get_by_id(company_id)
            user_subscription.companies.append(company)

        return render_template(
            'admin/user_management_page/user_subscriptions.html',
            user_subscription=user_subscription)
コード例 #4
0
def render_company_edit_form(company_name):
    with app.app_context():
        company, error = company_service.get_by_name(company_name)
        if error:
            return jsonify(error.jsonify())
        return render_template('companies_page/company_edit_form.html',
                               company=company)
コード例 #5
0
def render_user_article_actions(user_email):
    with app.app_context():
        if user_email is None:
            return ""

        user, error = user_service.get_by_email(user_email)
        if error:
            return error.description

        return render_template(
            'admin/user_management_page/user_article_actions.html', user=user)
コード例 #6
0
def render_user_subscription(user_id):
    with app.app_context():
        user_subscription, error = user_subscriptions_service.get_subscriptions_for_user(
            user_id)
        if error:
            return error.description

        user_subscription.companies = []
        for company_id in user_subscription.company_ids:
            company, error = company_service.get_by_id(company_id)
            user_subscription.companies.append(company)

        return render_template(
            'user_subscriptions_page/user_subscriptions.html',
            user_subscription=user_subscription)
コード例 #7
0
def render_user_profile_edit_form(user_email):
    with app.app_context():
        if user_email is None:
            return ""

        user, error = user_service.get_by_email(user_email)
        if error:
            return error.description

        if user is None:
            return "User %s does not exists" % (user_email)

        return render_template(
            'admin/user_management_page/user_profile_edit_form.html',
            user=user,
            roles=User.valid_roles)
コード例 #8
0
def render_user_unsubscribed_companies(user_id):
    with app.app_context():
        user_subscription, error = user_subscriptions_service.get_subscriptions_for_user(
            user_id)
        if error:
            return error.description

        companies, error = company_service.get_all_active_companies()
        if error:
            return error.description

        unsubscribed_companies = [
            company for company in companies
            if company.id not in set(user_subscription.company_ids)
        ]

        return render_template(
            'user_subscriptions_page/user_unsubscribed_companies.html',
            unsubscribed_companies=unsubscribed_companies)
コード例 #9
0
def render_pre_body():
    with app.app_context():
        return render_template('common/pre_body.html')
コード例 #10
0
def render_top_menu(is_authenticated):
    with app.app_context():
        return render_template('menus/top_menu.html',
                               is_authenticated=is_authenticated)
コード例 #11
0
ファイル: index_page.py プロジェクト: arpitbbhayani/mito
def render_main_content():
    with app.app_context():
        return render_template('index_page/main_content.html')
コード例 #12
0
ファイル: index_page.py プロジェクト: arpitbbhayani/mito
def render_layout():
    with app.app_context():
        return render_template('index_page/layout.html')
コード例 #13
0
ファイル: article_page.py プロジェクト: arpitbbhayani/mito
def render_article(article):
    with app.app_context():
        return render_template('article_page/article.html', article=article)
コード例 #14
0
ファイル: article_page.py プロジェクト: arpitbbhayani/mito
def render_action_buttons():
    with app.app_context():
        return render_template('article_page/article_actions.html')
コード例 #15
0
ファイル: dashboard_page.py プロジェクト: arpitbbhayani/mito
def render_layout():
    with app.app_context():
        return render_template('dashboard_page/layout.html')
コード例 #16
0
def render_company_add_form():
    with app.app_context():
        return render_template('companies_page/company_add_form.html')
コード例 #17
0
def render_user_search_bar():
    with app.app_context():
        return render_template('admin/user_management_page/user_search.html')
コード例 #18
0
def render_companies_action_buttons():
    with app.app_context():
        return render_template('companies_page/companies_actions.html')
コード例 #19
0
def render_layout():
    with app.app_context():
        return render_template('admin/user_management_page/layout.html')
コード例 #20
0
def render_articles_home_layout():
    with app.app_context():
        return render_template('articles_page/home_layout.html')
コード例 #21
0
def render_articles(user_id, bucket_name):
    articles, error = user_bucket_service.get_articles_from_bucket(
        user_id, bucket_name)
    with app.app_context():
        return render_template('articles_page/articles.html',
                               articles=articles)
コード例 #22
0
def render_layout():
    with app.app_context():
        return render_template('user_subscriptions_page/layout.html')
コード例 #23
0
def render_user_action_buttons():
    with app.app_context():
        return render_template('user_page/user_actions.html')
コード例 #24
0
def render_layout_company_edit():
    with app.app_context():
        return render_template('companies_page/company_edit_form_layout.html')
コード例 #25
0
ファイル: dashboard_page.py プロジェクト: arpitbbhayani/mito
def render_pending_articles():
    with app.app_context():
        return render_template('articles_page/articles.html')
コード例 #26
0
def render_layout():
    with app.app_context():
        return render_template('companies_page/layout.html')