<commit_before># Copyright (c) 2007-2011 gocept gmbh & co. kg
# See also LICENSE.txt

from zeit.cms.i18n import MessageFactory as _
import zeit.cms.content.field
import zeit.cms.content.sources
import zeit.cms.interfaces
import zeit.cms.repository.interfaces
import zeit.cms.tagging.interfaces
import zope.component.interfaces
import zope.i18nmessageid
import zope.interface
import zope.interface.interfaces
import zope.schema


# XXX There is too much, too unordered in here, clean this up.


# prevent circular import
from zeit.cms.content.contentsource import ICMSContentSource
from zeit.cms.content.contentsource import INamedCMSContentSource
from zeit.cms.content.contentsource import IAutocompleteSource


class IAuthorType(zeit.cms.interfaces.ICMSContentType):
    """Interface type for authors."""


class AuthorSource(zeit.cms.content.contentsource.CMSContentSource):

    zope.interface.implements(
        zeit.cms.content.contentsource.IAutocompleteSource)

    check_interfaces = IAuthorType
    name = 'authors'


authorSource = AuthorSource()


class ICommonMetadata(zope.interface.Interface):

    year = zope.schema.Int(
        title=_("Year"),
        min=1900,
        max=2100)

    volume = zope.schema.Int(
        title=_("Volume"),
        min=1,
        max=53,
        required=False)

    page = zope.schema.Int(
        title=_("Page"),
        readonly=True,
        required=False)

    ressort = zope.schema.Choice(
        title=_("Ressort"),
        source=zeit.cms.content.sources.NavigationSource())

    sub_ressort = zope.schema.Choice(
        title=_('Sub ressort'),
        source=zeit.cms.content.sources.SubNavigationSource(),
        required=False)

    printRessort = zope.schema.TextLine(
        title=_("Print ressort"),
        readonly=True,
        required=False,
        default=u'n/a')

    author_references = zope.schema.Tuple(
        title=_("Authors"),
        value_type=zope.schema.Choice(source=authorSource),
        default=(),
        required=False)

    author_references.value_type.setTaggedValue(
        'zeit.cms.addform.contextfree', 'zeit.content.author.add_contextfree')

    authors = zope.schema.Tuple(
        title=_("Authors (freetext)"),
        value_type=zope.schema.TextLine(),
        required=False,
        default=(u'',),
        description=_(u'overwritten if any non-freetext authors are set'))

    keywords = zope.schema.Tuple(
        title=_("Keywords"),
        required=False,
        default=(),
        value_type=zope.schema.Choice(
            source=zeit.cms.tagging.interfaces.TagsForContent()))

    serie = zope.schema.Choice(
        title=_("Serie"),
        source=zeit.cms.content.sources.SerieSource(),
        required=False)

    copyrights = zope.schema.TextLine(
        title=_("Copyright (c)"),
        description=_("Do not enter (c)."),
        required=False)

    supertitle = zope.schema.TextLine(
        title=_("Kicker"),
        description=_("Please take care of capitalisation."),
        required=False,
        max_length=70)

    byline = zope.schema.TextLine(
        title=_("By line"),
        required=False)

    title = zope.schema.Text(
        title=_("Title"),
        missing_value=u'',
        max_length=70)

    subtitle = zope.schema.Text(
        title=_("Subtitle"),
        missing_value=u'',
        required=False,
        max_length=170)

    teaserTitle = zope.schema.TextLine(
        title=_("Teaser title"),
        required=False,
        max_length=70)

    teaserText = zope.schema.Text(
        title=_("Teaser text"),
        required=False,
        max_length=170)

    teaserSupertitle = zope.schema.TextLine(
        title=_(u'Teaser kicker'),
        description=_(u'Please take care of capitalisation.'),
        required=False,
        max_length=70)

    vg_wort_id = zope.schema.TextLine(
        title=_('VG Wort Id'),
        required=False)

    dailyNewsletter = zope.schema.Bool(
        title=_("Daily newsletter"),
        description=_(
            "Should this article be listed in the daily newsletter?"),
        required=False,
        default=True)
<commit_msg>Fixes #11970: Remove restriction for subtitle, since those can be quite long (in print articles, for example)<commit_after># Copyright (c) 2007-2011 gocept gmbh & co. kg
# See also LICENSE.txt

from zeit.cms.i18n import MessageFactory as _
import zeit.cms.content.field
import zeit.cms.content.sources
import zeit.cms.interfaces
import zeit.cms.repository.interfaces
import zeit.cms.tagging.interfaces
import zope.component.interfaces
import zope.i18nmessageid
import zope.interface
import zope.interface.interfaces
import zope.schema


# XXX There is too much, too unordered in here, clean this up.


# prevent circular import
from zeit.cms.content.contentsource import ICMSContentSource
from zeit.cms.content.contentsource import INamedCMSContentSource
from zeit.cms.content.contentsource import IAutocompleteSource


class IAuthorType(zeit.cms.interfaces.ICMSContentType):
    """Interface type for authors."""


class AuthorSource(zeit.cms.content.contentsource.CMSContentSource):

    zope.interface.implements(
        zeit.cms.content.contentsource.IAutocompleteSource)

    check_interfaces = IAuthorType
    name = 'authors'


authorSource = AuthorSource()


class ICommonMetadata(zope.interface.Interface):

    year = zope.schema.Int(
        title=_("Year"),
        min=1900,
        max=2100)

    volume = zope.schema.Int(
        title=_("Volume"),
        min=1,
        max=53,
        required=False)

    page = zope.schema.Int(
        title=_("Page"),
        readonly=True,
        required=False)

    ressort = zope.schema.Choice(
        title=_("Ressort"),
        source=zeit.cms.content.sources.NavigationSource())

    sub_ressort = zope.schema.Choice(
        title=_('Sub ressort'),
        source=zeit.cms.content.sources.SubNavigationSource(),
        required=False)

    printRessort = zope.schema.TextLine(
        title=_("Print ressort"),
        readonly=True,
        required=False,
        default=u'n/a')

    author_references = zope.schema.Tuple(
        title=_("Authors"),
        value_type=zope.schema.Choice(source=authorSource),
        default=(),
        required=False)

    author_references.value_type.setTaggedValue(
        'zeit.cms.addform.contextfree', 'zeit.content.author.add_contextfree')

    authors = zope.schema.Tuple(
        title=_("Authors (freetext)"),
        value_type=zope.schema.TextLine(),
        required=False,
        default=(u'',),
        description=_(u'overwritten if any non-freetext authors are set'))

    keywords = zope.schema.Tuple(
        title=_("Keywords"),
        required=False,
        default=(),
        value_type=zope.schema.Choice(
            source=zeit.cms.tagging.interfaces.TagsForContent()))

    serie = zope.schema.Choice(
        title=_("Serie"),
        source=zeit.cms.content.sources.SerieSource(),
        required=False)

    copyrights = zope.schema.TextLine(
        title=_("Copyright (c)"),
        description=_("Do not enter (c)."),
        required=False)

    supertitle = zope.schema.TextLine(
        title=_("Kicker"),
        description=_("Please take care of capitalisation."),
        required=False,
        max_length=70)

    byline = zope.schema.TextLine(
        title=_("By line"),
        required=False)

    title = zope.schema.Text(
        title=_("Title"),
        missing_value=u'',
        max_length=70)

    subtitle = zope.schema.Text(
        title=_("Subtitle"),
        missing_value=u'',
        required=False)

    teaserTitle = zope.schema.TextLine(
        title=_("Teaser title"),
        required=False,
        max_length=70)

    teaserText = zope.schema.Text(
        title=_("Teaser text"),
        required=False,
        max_length=170)

    teaserSupertitle = zope.schema.TextLine(
        title=_(u'Teaser kicker'),
        description=_(u'Please take care of capitalisation.'),
        required=False,
        max_length=70)

    vg_wort_id = zope.schema.TextLine(
        title=_('VG Wort Id'),
        required=False)

    dailyNewsletter = zope.schema.Bool(
        title=_("Daily newsletter"),
        description=_(
            "Should this article be listed in the daily newsletter?"),
        required=False,
        default=True)

{'fraction_non_alphanumeric': 0.11590038314176246, 'fraction_numerical': 0.009099616858237548, 'mean_word_length': 2.796818181818182, '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': '346448', 'n_tokens_mistral': 2627, 'n_tokens_neox': 2502, 'n_words': 473}