Ejemplo n.º 1
0
def view(request):
    request.permissions = get_matching_permissions(get_profile(request.user), Directory.objects.root)

    topstats = gentopstats_root()

    templatevars = {
        "description": pagelayout.get_description(),
        "keywords": [
            "Pootle",
            "translate",
            "translation",
            "localisation",
            "localization",
            "l10n",
            "traduction",
            "traduire",
        ],
        "languagelink": _("Languages"),
        "languages": getlanguages(request),
        "projectlink": _("Projects"),
        "projects": getprojects(request),
        "topstats": topstats,
        "instancetitle": pagelayout.get_title(),
        "translationlegend": {
            "translated": _("Translations are complete"),
            "fuzzy": _("Translations need to be checked (they are marked fuzzy)"),
            "untranslated": _("Untranslated"),
        },
        "permissions": request.permissions,
    }
    visible_langs = [l for l in templatevars["languages"] if l["total"] != 0]
    templatevars["moreprojects"] = len(templatevars["projects"]) > len(visible_langs)

    return render_to_response("index/index.html", templatevars, RequestContext(request))
Ejemplo n.º 2
0
def view(request):
    request.permissions = get_matching_permissions(get_profile(request.user), Directory.objects.root)

    topstats = gentopstats_root()

    templatevars = {
        'description': pagelayout.get_description(),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
            ],
        'languagelink': _('Languages'),
        'languages': getlanguages(request),
        'projectlink': _('Projects'),
        'projects': getprojects(request),
        'projectstypo3typo3core': getprojectstypo3typo3core(request),
        'projectstypo3typo3ext': getprojectstypo3typo3ext(request),
        'topstats': topstats,
        'instancetitle': pagelayout.get_title(),
        'translationlegend': {'translated': _('Translations are complete'),
                              'fuzzy': _('Translations need to be checked (they are marked fuzzy)'),
                              'untranslated': _('Untranslated')},
        'permissions': request.permissions,
        }
    visible_langs = [l for l in templatevars['languages'] if l['total'] != 0]
    templatevars['moreprojects'] = len(templatevars['projects']) >\
                                   len(visible_langs)

    return render_to_response('index/index.html', templatevars, RequestContext(request))
Ejemplo n.º 3
0
def projects_index(request):
    """page listing all projects"""
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)

    if not check_permission('view', request):
        raise PermissionDenied

    topstats = gentopstats_root()

    templatevars = {
        'projects': getprojects(request),
        'topstats': topstats,
        'translationlegend': {
            'translated':
            _('Translations are complete'),
            'fuzzy':
            _('Translations need to be checked '
              '(they are marked fuzzy)'),
            'untranslated':
            _('Untranslated')
        },
    }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 4
0
def view(request, root_dir):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   root_dir)
    can_edit = request.user.is_superuser

    languages = getlanguages(request)
    languages_table_fields = ['language', 'progress', 'activity']
    languages_table = {
        'id': 'index-languages',
        'proportional': False,
        'fields': languages_table_fields,
        'headings': get_table_headings(languages_table_fields),
        'items': languages,
    }

    projects = getprojects(request)
    projects_table_fields = ['project', 'progress', 'activity']
    projects_table = {
        'id': 'index-projects',
        'proportional': False,
        'fields': projects_table_fields,
        'headings': get_table_headings(projects_table_fields),
        'items': projects,
    }

    siteconfig = load_site_config()
    ctx = {
        'description': _(siteconfig.get('DESCRIPTION')),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'topstats': gentopstats_root(),
        'permissions': request.permissions,
        'can_edit': can_edit,
        'languages_table': languages_table,
        'projects_table': projects_table,
        'resource_obj': request.resource_obj,
        'moreprojects': (len(projects) > len(languages))
    }

    if can_edit:
        from pootle_app.forms import GeneralSettingsForm
        ctx.update({
            'form': GeneralSettingsForm(siteconfig),
            'form_action': reverse('pootle-admin-edit-settings'),
        })

    return render_to_response('home/home.html', ctx,
                              RequestContext(request))
Ejemplo n.º 5
0
def view(request, root_dir):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   root_dir)
    can_edit = request.user.is_superuser

    languages = getlanguages(request)
    languages_table_fields = ['language', 'progress', 'activity']
    languages_table = {
        'id': 'index-languages',
        'proportional': False,
        'fields': languages_table_fields,
        'headings': get_table_headings(languages_table_fields),
        'items': languages,
    }

    projects = getprojects(request)
    projects_table_fields = ['project', 'progress', 'activity']
    projects_table = {
        'id': 'index-projects',
        'proportional': False,
        'fields': projects_table_fields,
        'headings': get_table_headings(projects_table_fields),
        'items': projects,
    }

    templatevars = {
        'description': _(settings.DESCRIPTION),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'topstats': gentopstats_root(),
        'permissions': request.permissions,
        'can_edit': can_edit,
        'languages_table': languages_table,
        'projects_table': projects_table,
        'resource_obj': request.resource_obj,
    }
    templatevars['moreprojects'] = (len(projects) > len(languages))

    if can_edit:
        from pootle_misc.siteconfig import load_site_config
        from pootle_app.forms import GeneralSettingsForm
        siteconfig = load_site_config()
        setting_form = GeneralSettingsForm(siteconfig)
        templatevars['form'] = setting_form

    return render_to_response('index/index.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 6
0
def view(request):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)
    can_edit = request.user.is_superuser

    topstats = gentopstats_root()
    languages = getlanguages(request)

    templatevars = {
        'description':
        _(settings.DESCRIPTION),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'languages':
        languages,
        'projects':
        getprojects(request),
        'topstats':
        topstats,
        'translationlegend': {
            'translated':
            _('Translations are complete'),
            'fuzzy':
            _("Translations need to be checked "
              "(they are marked fuzzy)"),
            'untranslated':
            _('Untranslated')
        },
        'permissions':
        request.permissions,
        'can_edit':
        can_edit,
    }
    visible_langs = [l for l in languages if l['stats']['total']['words'] != 0]
    templatevars['moreprojects'] = (len(templatevars['projects']) >
                                    len(visible_langs))

    if can_edit:
        from pootle_misc.siteconfig import load_site_config
        from pootle_app.forms import GeneralSettingsForm
        siteconfig = load_site_config()
        setting_form = GeneralSettingsForm(siteconfig)
        templatevars['form'] = setting_form

    return render_to_response('index/index.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 7
0
def projects_index(request, root):
    """page listing all projects"""
    table_fields = ['project', 'progress', 'activity']

    templatevars = {
        'table': {
            'id': 'projects',
            'proportional': False,
            'fields': table_fields,
            'headings': get_table_headings(table_fields),
            'items': getprojects(request),
        },
        'topstats': gentopstats_root(),
    }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 8
0
def view(request):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)

    topstats = gentopstats_root()

    templatevars = {
        'description':
        pagelayout.get_description(),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'languagelink':
        _('Languages'),
        'languages':
        getlanguages(request),
        'projectlink':
        _('Projects'),
        'projects':
        getprojects(request),
        'topstats':
        topstats,
        'instancetitle':
        pagelayout.get_title(),
        'translationlegend': {
            'translated': _('Translations are complete'),
            'fuzzy':
            _('Translations need to be checked (they are marked fuzzy)'),
            'untranslated': _('Untranslated')
        },
        'permissions':
        request.permissions,
    }
    visible_langs = [l for l in templatevars['languages'] if l['total'] != 0]
    templatevars['moreprojects'] = len(templatevars['projects']) >\
                                   len(visible_langs)

    return render_to_response('index/index.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 9
0
def projects_index(request, *args):  #HACKISH: @get_path_obj needs *args here.
    """page listing all projects"""
    table_fields = ['project', 'progress', 'activity']

    templatevars = {
        'table': {
            'id': 'projects',
            'proportional': False,
            'fields': table_fields,
            'headings': get_table_headings(table_fields),
            'items': getprojects(request),
        },
        'topstats': gentopstats_root(),
    }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 10
0
def projects_index(request):
    """page listing all projects"""
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)

    if not check_permission('view', request):
        raise PermissionDenied

    topstats = gentopstats_root()

    templatevars = {
        'projects': getprojects(request),
        'topstats': topstats,
        }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 11
0
def projects_index(request):
    """page listing all projects"""
    request.permissions = get_matching_permissions(get_profile(request.user), Directory.objects.root)
    if not check_permission('view', request):
        raise PermissionDenied

    topstats = gentopstats_root()

    templatevars = {
        'projectlink': _('Projects'),
        'projects': getprojects(request),
        'topstats': topstats,
        'instancetitle': pagelayout.get_title(),
        'translationlegend': {'translated': _('Translations are complete'),
                              'fuzzy': _('Translations need to be checked (they are marked fuzzy)'),
                              'untranslated': _('Untranslated')},
        }
    return render_to_response('project/projects.html', templatevars, RequestContext(request))
Ejemplo n.º 12
0
def projects_index(request, root):
    """page listing all projects"""
    from pootle_app.views.index.index import getprojects

    fields = ["project", "progress", "activity"]

    ctx = {
        "table": {
            "id": "projects",
            "proportional": False,
            "fields": fields,
            "headings": get_table_headings(fields),
            "items": getprojects(request),
        },
        "topstats": gentopstats_root(),
    }

    return render(request, "projects/list.html", ctx)
Ejemplo n.º 13
0
def view(request, root_dir):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   root_dir)
    languages = getlanguages(request)
    languages_table_fields = ['language', 'progress', 'activity']
    languages_table = {
        'id': 'index-languages',
        'proportional': False,
        'fields': languages_table_fields,
        'headings': get_table_headings(languages_table_fields),
        'items': languages,
    }

    projects = getprojects(request)
    projects_table_fields = ['project', 'progress', 'activity']
    projects_table = {
        'id': 'index-projects',
        'proportional': False,
        'fields': projects_table_fields,
        'headings': get_table_headings(projects_table_fields),
        'items': projects,
    }

    siteconfig = load_site_config()
    ctx = {
        'description': _(siteconfig.get('DESCRIPTION')),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'topstats': gentopstats_root(),
        'permissions': request.permissions,
        'languages_table': languages_table,
        'projects_table': projects_table,
        'resource_obj': request.resource_obj,
        'moreprojects': (len(projects) > len(languages))
    }
    return render_to_response('home/home.html', ctx, RequestContext(request))
Ejemplo n.º 14
0
def view(request):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)
    can_edit = request.user.is_superuser

    topstats = gentopstats_root()
    languages = getlanguages(request)

    templatevars = {
        'description': _(settings.DESCRIPTION),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
            ],
        'languages': languages,
        'projects': getprojects(request),
        'topstats': topstats,
        'translationlegend': {'translated': _('Translations are complete'),
                              'fuzzy': _("Translations need to be checked "
                                         "(they are marked fuzzy)"),
                              'untranslated': _('Untranslated')},
        'permissions': request.permissions,
        'can_edit': can_edit,
        }
    visible_langs = [l for l in languages if l['stats']['total']['words'] != 0]
    templatevars['moreprojects'] = (len(templatevars['projects']) >
                                    len(visible_langs))

    if can_edit:
        from pootle_misc.siteconfig import load_site_config
        from pootle_app.forms import GeneralSettingsForm
        siteconfig = load_site_config()
        setting_form = GeneralSettingsForm(siteconfig)
        templatevars['form'] = setting_form

    return render_to_response('index/index.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 15
0
def projects_index(request):
    """page listing all projects"""
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)
    if not check_permission('view', request):
        raise PermissionDenied

    table_fields = ['project', 'progress', 'activity']

    templatevars = {
        'table': {
            'id': 'projects',
            'proportional': False,
            'fields': table_fields,
            'headings': get_table_headings(table_fields),
            'items': getprojects(request),
        },
        'topstats': gentopstats_root(),
    }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 16
0
def projects_index(request):
    """page listing all projects"""
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   Directory.objects.root)
    if not check_permission('view', request):
        raise PermissionDenied

    table_fields = ['project', 'progress', 'activity']
    table = {
        'id': 'projects',
        'proportional': False,
        'fields': table_fields,
        'headings': get_table_headings(table_fields),
        'items': getprojects(request),
    }

    templatevars = {
        'table': table,
        'topstats': gentopstats_root(),
    }

    return render_to_response('project/projects.html', templatevars,
                              RequestContext(request))
Ejemplo n.º 17
0
def view(request, root_dir):
    request.permissions = get_matching_permissions(get_profile(request.user),
                                                   root_dir)
    can_edit = request.user.is_superuser

    languages = getlanguages(request)
    languages_table_fields = ['language', 'progress', 'activity']
    languages_table = {
        'id': 'index-languages',
        'proportional': False,
        'fields': languages_table_fields,
        'headings': get_table_headings(languages_table_fields),
        'items': filter(lambda x: x['stats']['total']['words'] != 0,
                        languages),
    }

    projects = getprojects(request)
    projects_table_fields = ['project', 'progress', 'activity']
    projects_table = {
        'id': 'index-projects',
        'proportional': False,
        'fields': projects_table_fields,
        'headings': get_table_headings(projects_table_fields),
        'items': projects,
    }

    templatevars = {
        'description':
        _(settings.DESCRIPTION),
        'keywords': [
            'Pootle',
            'translate',
            'translation',
            'localisation',
            'localization',
            'l10n',
            'traduction',
            'traduire',
        ],
        'topstats':
        gentopstats_root(),
        'permissions':
        request.permissions,
        'can_edit':
        can_edit,
        'languages_table':
        languages_table,
        'projects_table':
        projects_table,
    }
    visible_langs = [l for l in languages if l['stats']['total']['words'] != 0]
    templatevars['moreprojects'] = (len(projects) > len(visible_langs))

    if can_edit:
        from pootle_misc.siteconfig import load_site_config
        from pootle_app.forms import GeneralSettingsForm
        siteconfig = load_site_config()
        setting_form = GeneralSettingsForm(siteconfig)
        templatevars['form'] = setting_form

    return render_to_response('index/index.html', templatevars,
                              RequestContext(request))