Esempio n. 1
0
def indicators_listing(request, option=None):
    """
    Generate Indicator Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    if option == "csv":
        return generate_indicator_csv(request)
    return generate_indicator_jtable(request, option)
Esempio n. 2
0
def indicators_listing(request, option=None):
    """
    Generate Indicator Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    if option == "csv":
        return generate_indicator_csv(request)
    return generate_indicator_jtable(request, option)
Esempio n. 3
0
def indicators_listing(request, option=None):
    """
    Generate Indicator Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    user = request.user

    if user.has_access_to(IndicatorACL.READ):
        if option == "csv":
            return generate_indicator_csv(request)
        return generate_indicator_jtable(request, option)
    else:
        return render(request, "error.html",
                                  {'error': 'User does not have permission to view Indicator listing.'})
Esempio n. 4
0
def indicators_listing(request, option=None):
    """
    Generate Indicator Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    user = request.user

    if user.has_access_to(IndicatorACL.READ):
        if option == "csv":
            return generate_indicator_csv(request)
        return generate_indicator_jtable(request, option)
    else:
        return render_to_response("error.html", {
            'error':
            'User does not have permission to view Indicator listing.'
        }, RequestContext(request))