Exemplo n.º 1
0
Arquivo: views.py Projeto: vsbca/crits
def email_detail(request, email_id):
    """
    Generate the Email detail page.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param email_id: The ObjectId of the email to get details for.
    :type email_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    template = 'email_detail.html'
    user = request.user
    if not user.has_access_to(EmailACL.READ):
        return render_to_response('error.html',
                                  {'error':'User does not have permission to view email.'},
                                  RequestContext(request))
    if request.method == "GET" and request.is_ajax():
        return get_email_formatted(email_id,
                                   user.username,
                                   request.GET.get("format", "json"))
    (new_template, args) = get_email_detail(email_id, user)
    if new_template:
        template = new_template
    return render_to_response(template,
                              args,
                              RequestContext(request))
Exemplo n.º 2
0
def email_detail(request, email_id):
    """
    Generate the Email detail page.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param email_id: The ObjectId of the email to get details for.
    :type email_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    template = "email_detail.html"
    analyst = request.user.username
    if request.method == "GET" and request.is_ajax():
        return get_email_formatted(email_id, analyst, request.GET.get("format", "json"))
    (new_template, args) = get_email_detail(email_id, analyst)
    if new_template:
        template = new_template
    return render_to_response(template, args, RequestContext(request))
Exemplo n.º 3
0
def email_detail(request, email_id):
    """
    Generate the Email detail page.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param email_id: The Message_id of the email to get details for.
    :type email_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    template = 'email_detail.html'
    analyst = request.user.username
    if request.method == "GET" and request.is_ajax():
        return get_email_formatted(email_id, analyst,
                                   request.GET.get("format", "json"))
    (new_template, args) = get_email_detail(email_id, analyst)
    if new_template:
        template = new_template
    return render_to_response(template, args, RequestContext(request))