コード例 #1
0
    def test_filter_by_category(self):
        d = document(save=True, category=CATEGORIES[1][0])
        revision(document=d, save=True)

        eq_(1, len(kb_overview_rows()))
        eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0])))
        eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
コード例 #2
0
    def test_filter_by_category(self):
        d = document(save=True, category=CATEGORIES[1][0])
        revision(document=d, save=True)

        eq_(1, len(kb_overview_rows()))
        eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0])))
        eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
コード例 #3
0
    def test_unapproved_articles(self):
        eq_(0, len(kb_overview_rows()))

        d = document(save=True)
        revision(document=d, save=True)

        eq_(1, len(kb_overview_rows()))
コード例 #4
0
    def test_unapproved_articles(self):
        eq_(0, len(kb_overview_rows()))

        d = document(save=True)
        revision(document=d, save=True)

        eq_(1, len(kb_overview_rows()))
コード例 #5
0
    def test_ready_for_l10n(self):
        d = document(save=True)
        r = revision(document=d, save=True)
        d.current_revision = r
        d.save()

        data = kb_overview_rows()
        eq_(1, len(data))
        eq_(False, data[0]['ready_for_l10n'])

        revision(document=d, is_approved=True, is_ready_for_localization=True, save=True)

        data = kb_overview_rows()
        eq_(True, data[0]['ready_for_l10n'])
コード例 #6
0
    def test_ready_for_l10n(self):
        d = DocumentFactory()
        r = RevisionFactory(document=d)
        d.current_revision = r
        d.save()

        data = kb_overview_rows()
        eq_(1, len(data))
        eq_(False, data[0]['ready_for_l10n'])

        ApprovedRevisionFactory(document=d, is_ready_for_localization=True)

        data = kb_overview_rows()
        eq_(True, data[0]['ready_for_l10n'])
コード例 #7
0
ファイル: test_readouts.py プロジェクト: chupahanks/kitsune
    def test_ready_for_l10n(self):
        d = DocumentFactory()
        r = RevisionFactory(document=d)
        d.current_revision = r
        d.save()

        data = kb_overview_rows()
        eq_(1, len(data))
        eq_(False, data[0]["ready_for_l10n"])

        ApprovedRevisionFactory(document=d, is_ready_for_localization=True)

        data = kb_overview_rows()
        eq_(True, data[0]["ready_for_l10n"])
コード例 #8
0
def contributors(request):
    """Render aggregate data about the articles in the default locale."""
    product = _get_product(request)
    category = _get_category(request)

    return render_readouts(
        request,
        CONTRIBUTOR_READOUTS,
        'contributors.html',
        locale=settings.WIKI_DEFAULT_LANGUAGE,
        product=product,
        extra_data={
            'overview_rows':
            kb_overview_rows(locale=request.LANGUAGE_CODE,
                             product=product,
                             mode=smart_int(request.GET.get('mode'), None),
                             max=smart_int(request.GET.get('max'), 10),
                             category=category),
            'overview_modes':
            PERIODS,
            'category':
            category,
            'categories':
            CATEGORIES,
        })
コード例 #9
0
def contributors_overview(request):
    product = _get_product(request)
    category = _get_category(request)

    return render(
        request, 'dashboards/contributors_overview.html', {
            'overview_rows':
            kb_overview_rows(locale=request.LANGUAGE_CODE,
                             product=product,
                             mode=smart_int(request.GET.get('mode'), None),
                             max=None,
                             category=category),
            'main_dash_view':
            'dashboards.contributors',
            'main_dash_title':
            _('Knowledge Base Dashboard'),
            'locale':
            request.LANGUAGE_CODE,
            'product':
            product,
            'products':
            Product.objects.filter(visible=True),
            'category':
            category,
            'categories':
            CATEGORIES
        })
コード例 #10
0
    def test_ready_for_l10n(self):
        d = document(save=True)
        r = revision(document=d, save=True)
        d.current_revision = r
        d.save()

        data = kb_overview_rows()
        eq_(1, len(data))
        eq_(False, data[0]['ready_for_l10n'])

        revision(document=d,
                 is_approved=True,
                 is_ready_for_localization=True,
                 save=True)

        data = kb_overview_rows()
        eq_(True, data[0]['ready_for_l10n'])
コード例 #11
0
ファイル: views.py プロジェクト: rivaxel/kitsune
def contributors_overview_rows(request):
    product = _get_product(request)

    overview_rows = kb_overview_rows(
        locale=request.LANGUAGE_CODE, product=product,
        mode=smart_int(request.GET.get('mode'), None),
        max=smart_int(request.GET.get('max'), 10))

    return render(request, 'dashboards/includes/kb_overview.html', {
        'overview_rows': overview_rows})
コード例 #12
0
ファイル: views.py プロジェクト: ziegeer/kitsune
def contributors_overview_rows(request):
    product = _get_product(request)

    overview_rows = kb_overview_rows(
        locale=request.LANGUAGE_CODE, product=product,
        mode=smart_int(request.GET.get('mode'), None),
        max=smart_int(request.GET.get('max'), 10))

    return render(request, 'dashboards/includes/kb_overview.html', {
        'overview_rows': overview_rows})
コード例 #13
0
ファイル: views.py プロジェクト: Archaeopteryx/kitsune
def contributors_overview(request):
    product = _get_product(request)

    return render(request, 'dashboards/contributors_overview.html', {
        'overview_rows': kb_overview_rows(
            locale=request.LANGUAGE_CODE, product=product,
            mode=smart_int(request.GET.get('mode'), None),
            max=None),
        'main_dash_view': 'dashboards.contributors',
        'main_dash_title': _('Knowledge Base Dashboard'),
        'locale': request.LANGUAGE_CODE,
        'product': product,
        'products': Product.objects.filter(visible=True)})
コード例 #14
0
def contributors_overview_rows(request):
    product = _get_product(request)

    overview_rows = kb_overview_rows(
        locale=request.LANGUAGE_CODE,
        product=product,
        mode=smart_int(request.GET.get("mode"), None),
        max=smart_int(request.GET.get("max"), 10),
    )

    return render(
        request, "dashboards/includes/kb_overview.html", {"overview_rows": overview_rows}
    )
コード例 #15
0
ファイル: views.py プロジェクト: Archaeopteryx/kitsune
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,
        extra_data={
            'overview_rows': kb_overview_rows(
                locale=request.LANGUAGE_CODE, product=product,
                mode=smart_int(request.GET.get('mode'), None),
                max=smart_int(request.GET.get('max'), 10)),
            'overview_modes': PERIODS
        })
コード例 #16
0
def contributors_overview(request):
    product = _get_product(request)
    category = _get_category(request)

    return render(
        request,
        "dashboards/contributors_overview.html",
        {
            "overview_rows": kb_overview_rows(
                locale=request.LANGUAGE_CODE,
                product=product,
                mode=smart_int(request.GET.get("mode"), None),
                max=None,
                category=category,
            ),
            "main_dash_view": "dashboards.contributors",
            "main_dash_title": _("Knowledge Base Dashboard"),
            "locale": request.LANGUAGE_CODE,
            "product": product,
            "products": Product.objects.filter(visible=True),
            "category": category,
            "categories": CATEGORIES,
        },
    )
コード例 #17
0
ファイル: test_readouts.py プロジェクト: chupahanks/kitsune
    def test_filter_by_category(self):
        RevisionFactory(document__category=CATEGORIES[1][0])

        eq_(1, len(kb_overview_rows()))
        eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0])))
        eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
コード例 #18
0
ファイル: test_readouts.py プロジェクト: chupahanks/kitsune
 def test_unapproved_articles(self):
     eq_(0, len(kb_overview_rows()))
     RevisionFactory()
     eq_(1, len(kb_overview_rows()))
コード例 #19
0
    def test_filter_by_category(self):
        RevisionFactory(document__category=CATEGORIES[1][0])

        eq_(1, len(kb_overview_rows()))
        eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0])))
        eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
コード例 #20
0
 def test_unapproved_articles(self):
     eq_(0, len(kb_overview_rows()))
     RevisionFactory()
     eq_(1, len(kb_overview_rows()))