Example #1
0
def project_translations(request, project_slug):
    project = get_object_or_404(request.user.projects.live(), slug=project_slug)
    form = TranslationForm(data=request.POST or None, parent=project)

    if request.method == "POST" and form.is_valid():
        form.save()
        project_dashboard = reverse("projects_translations", args=[project.slug])
        return HttpResponseRedirect(project_dashboard)

    lang_projects = project.translations.all()

    return render_to_response(
        "projects/project_translations.html",
        {"form": form, "project": project, "lang_projects": lang_projects},
        context_instance=RequestContext(request),
    )
Example #2
0
def project_translations(request, project_slug):
    project = get_object_or_404(Project.objects.for_admin_user(request.user),
                                slug=project_slug)
    form = TranslationForm(data=request.POST or None, parent=project)

    if request.method == 'POST' and form.is_valid():
        form.save()
        project_dashboard = reverse('projects_translations',
                                    args=[project.slug])
        return HttpResponseRedirect(project_dashboard)

    lang_projects = project.translations.all()

    return render_to_response(
        'projects/project_translations.html',
        {'form': form, 'project': project, 'lang_projects': lang_projects},
        context_instance=RequestContext(request)
    )
Example #3
0
def project_translations(request, project_slug):
    project = get_object_or_404(request.user.projects.live(),
                                slug=project_slug)
    form = TranslationForm(data=request.POST or None, parent=project)

    if request.method == 'POST' and form.is_valid():
        form.save()
        project_dashboard = reverse('projects_translations',
                                    args=[project.slug])
        return HttpResponseRedirect(project_dashboard)

    lang_projects = project.translations.all()

    return render_to_response(
        'projects/project_translations.html',
        {'form': form, 'project': project, 'lang_projects': lang_projects},
        context_instance=RequestContext(request)
    )