Ejemplo n.º 1
0
def platform_admin_list_complaints():
    page = get_page_from_request()
    if page is None:
        abort(404,
              "Invalid page argument ({}).".format(request.args.get('page')))

    response = complaint_api_client.get_all_complaints(page=page)

    prev_page = None
    if response['links'].get('prev'):
        prev_page = generate_previous_dict(
            'main.platform_admin_list_complaints', None, page)
    next_page = None
    if response['links'].get('next'):
        next_page = generate_next_dict('main.platform_admin_list_complaints',
                                       None, page)

    return render_template(
        'views/platform-admin/complaints.html',
        complaints=response['complaints'],
        page_title='All Complaints',
        page=page,
        prev_page=prev_page,
        next_page=next_page,
    )
Ejemplo n.º 2
0
def platform_admin_list_complaints():
    page = get_page_from_request()
    if page is None:
        abort(404, "Invalid page argument ({}).".format(request.args.get("page")))

    response = complaint_api_client.get_all_complaints(page=page)

    prev_page = None
    if response["links"].get("prev"):
        prev_page = generate_previous_dict("main.platform_admin_list_complaints", None, page)
    next_page = None
    if response["links"].get("next"):
        next_page = generate_next_dict("main.platform_admin_list_complaints", None, page)

    return render_template(
        "views/platform-admin/complaints.html",
        complaints=response["complaints"],
        page_title="All Complaints",
        page=page,
        prev_page=prev_page,
        next_page=next_page,
    )