Ejemplo n.º 1
0
def project(request, slug, template='project.html'):
    """Project view."""
    log.debug("Project view.")

    # Validate project
    try:
        p = Project.objects.get(slug=slug, disabled=False,
                                pk__in=Resource.objects.values('project'))
    except Project.DoesNotExist:
        messages.error(request, "Oops, project could not be found.")
        request.session['translate_error'] = {
            'none': None,
        }
        return HttpResponseRedirect(reverse('pontoon.home'))

    locales = p.locales.all().order_by("name")

    data = {
        'locales': get_locales_with_stats(p),
        'project': p,
        'project_locales': json.dumps(
            [i.lower() for i in p.locales.values_list('code', flat=True)]),
    }

    return render(request, template, data)
Ejemplo n.º 2
0
def project(request, slug, template='project.html'):
    """Project view."""
    log.debug("Project view.")

    # Validate project
    try:
        p = Project.objects.get(slug=slug, disabled=False,
                                pk__in=Resource.objects.values('project'))
    except Project.DoesNotExist:
        messages.error(request, "Oops, project could not be found.")
        request.session['translate_error'] = {
            'none': None,
        }
        return HttpResponseRedirect(reverse('pontoon.home'))

    locales = p.locales.all().order_by("name")

    data = {
        'locales': get_locales_with_stats(p),
        'project': p,
        'project_locales': json.dumps(
            [i.lower() for i in p.locales.values_list('code', flat=True)]),
    }

    return render(request, template, data)
Ejemplo n.º 3
0
def locales(request):
    """Localization teams."""

    data = {
        'locales': get_locales_with_stats(),
    }

    return render(request, 'locales.html', data)
Ejemplo n.º 4
0
def locales(request):
    """Localization teams."""

    data = {
        'locales': get_locales_with_stats(),
    }

    return render(request, 'locales.html', data)
Ejemplo n.º 5
0
def locales(request):
    """Localization teams."""

    data = {"locales": get_locales_with_stats()}

    return render(request, "locales.html", data)