Exemplo n.º 1
0
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.locale == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse('dashboards.contributors'))
    data = {'overview_rows': partial(overview_rows, request.locale)}
    return render_readouts(request, L10N_READOUTS, 'localization.html',
                           extra_data=data)
Exemplo n.º 2
0
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.locale == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse('dashboards.contributors'))
    data = {'overview_rows': partial(overview_rows, request.locale)}
    return render_readouts(request, L10N_READOUTS, 'localization.html',
                           extra_data=data)
Exemplo n.º 3
0
def contributors(request):
    """Render aggregate data about the articles in the default locale."""
    product = _get_product(request)

    return render_readouts(request,
                           CONTRIBUTOR_READOUTS,
                           'contributors.html',
                           locale=settings.WIKI_DEFAULT_LANGUAGE,
                           product=product)
Exemplo n.º 4
0
def contributors(request):
    """Render aggregate data about the articles in the default locale."""
    product = _get_product(request)

    return render_readouts(
        request,
        CONTRIBUTOR_READOUTS,
        'contributors.html',
        locale=settings.WIKI_DEFAULT_LANGUAGE,
        product=product)
Exemplo n.º 5
0
 def render(self):
     """Locale dashboard for a group."""
     locale = self._params.strip()
     data = {}
     if locale == settings.WIKI_DEFAULT_LANGUAGE:
         readouts = GROUP_CONTRIBUTOR_READOUTS
     else:
         readouts = GROUP_L10N_READOUTS
         data['overview_rows'] = partial(overview_rows, locale)
     data['announcements'] = Announcement.get_for_group_id(self._id)
     data['active_tab'] = self._id
     return render_readouts(self._request, readouts, 'group_locale.html',
                            extra_data=data, locale=locale)
Exemplo n.º 6
0
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.locale == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse('dashboards.contributors'))
    locales = Locale.objects.filter(locale=request.locale)
    if locales:
        permission = user_can_announce(request.user, locales[0])
    else:
        permission = False

    data = {
      'overview_rows': overview_rows(request.locale),
      'user_can_announce': permission
    }
    return render_readouts(request, L10N_READOUTS, 'localization.html',
                           extra_data=data)
Exemplo n.º 7
0
 def render(self):
     """Locale dashboard for a group."""
     locale = self._params.strip()
     data = {}
     if locale == settings.WIKI_DEFAULT_LANGUAGE:
         readouts = GROUP_CONTRIBUTOR_READOUTS
     else:
         readouts = GROUP_L10N_READOUTS
         data['overview_rows'] = partial(overview_rows, locale)
     data['announcements'] = Announcement.get_for_group_id(self._id)
     data['active_tab'] = self._id
     return render_readouts(self._request,
                            readouts,
                            'group_locale.html',
                            extra_data=data,
                            locale=locale)
Exemplo n.º 8
0
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.LANGUAGE_CODE == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse('dashboards.contributors'))
    locales = Locale.objects.filter(locale=request.LANGUAGE_CODE)
    if locales:
        permission = user_can_announce(request.user, locales[0])
    else:
        permission = False

    product = _get_product(request)

    data = {
        'overview_rows': overview_rows(request.LANGUAGE_CODE, product=product),
        'user_can_announce': permission
    }
    return render_readouts(request,
                           L10N_READOUTS,
                           'localization.html',
                           extra_data=data,
                           product=product)
Exemplo n.º 9
0
def contributors(request):
    """Render aggregate data about the articles in the default locale."""
    return render_readouts(request, CONTRIBUTOR_READOUTS, "contributors.html", locale=settings.WIKI_DEFAULT_LANGUAGE)