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)
def locales(request): """Localization teams.""" data = { 'locales': get_locales_with_stats(), } return render(request, 'locales.html', data)
def locales(request): """Localization teams.""" data = {"locales": get_locales_with_stats()} return render(request, "locales.html", data)