<commit_before>from django import forms
from django.utils.translation import ugettext_lazy as _
from fluent_pages.adminui import PageAdminForm
from fluent_pages.integration.fluent_contents.admin import FluentContentsPageAdmin
from icekit.admin import FluentLayoutsMixin

from . import models


class ArticleAdminForm(PageAdminForm):
    """
    Custom admin form for StoryPageAdmin.

    Change the status field to a hidden input and set as published by
    default.

    Change the parent field to a hidden input.
    """
    status = forms.CharField(
        widget=forms.HiddenInput,
        initial=models.ArticlePage.PUBLISHED
    )

    class Meta:
        model = models.ArticlePage
        exclude = []


class ArticlePageAdmin(FluentLayoutsMixin, FluentContentsPageAdmin):
    """
    Article Page Admin integration.
    """
    raw_id_fields = ['parent', ]
    # Change form templates that add ``content_type_id`` to the JS scope.
    change_form_template = [
        'admin/articlepage/change_form.html',
        FluentContentsPageAdmin.base_change_form_template
    ]

    base_form = ArticleAdminForm
<commit_msg>Apply missing publishing features to ArticlePage admin<commit_after>from django import forms
from django.utils.translation import ugettext_lazy as _
from fluent_pages.adminui import PageAdminForm
from fluent_pages.integration.fluent_contents.admin import FluentContentsPageAdmin
from icekit.admin import FluentLayoutsMixin
from icekit.publishing.admin import PublishingAdmin

from . import models


class ArticleAdminForm(PageAdminForm):
    """
    Custom admin form for StoryPageAdmin.

    Change the status field to a hidden input and set as published by
    default.

    Change the parent field to a hidden input.
    """
    status = forms.CharField(
        widget=forms.HiddenInput,
        initial=models.ArticlePage.PUBLISHED
    )

    class Meta:
        model = models.ArticlePage
        exclude = []


class ArticlePageAdmin(FluentLayoutsMixin, FluentContentsPageAdmin,
                       PublishingAdmin):
    """
    Article Page Admin integration.
    """
    raw_id_fields = ['parent', ]
    # Change form templates that add ``content_type_id`` to the JS scope.
    change_form_template = [
        'admin/articlepage/change_form.html',
        FluentContentsPageAdmin.base_change_form_template
    ]

    base_form = ArticleAdminForm

{'fraction_non_alphanumeric': 0.06247379454926625, 'fraction_numerical': 0.0, 'mean_word_length': 3.4267161410018554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3811432', 'n_tokens_mistral': 658, 'n_tokens_neox': 633, 'n_words': 183}