Пример #1
0
class AddForm(base.NullAddForm):
    """No add form, directly adds the portlet"""

    form_fields = form.Fields(IGlossaryPortlet)
    label = _(u"Add Glossary Portlet")
    description = _(u"This portlet shows the definitions of terms of actual page.")

    def create(self):
        return Assignment()
Пример #2
0
# PloneGlossary schema
PloneGlossarySchema = ATContentTypeSchema.copy()
PloneGlossarySchema['description'].schemata = 'default'

finalizeATCTSchema(PloneGlossarySchema, folderish=True)

# PloneGlossaryDefinition schema
PloneGlossaryDefinitionSchema = ATContentTypeSchema.copy() + Schema((
    StringField(
        'title',
        required=True,
        searchable=True,
        default='',
        accessor='Title',
        widget=StringWidget(
            label=_('label_glossary_term', default="Term"),
            description=_('help_glossary_term',
                          default="Enter the term to be defined."),
            visible={'view': 'invisible'}),
    ),
    LinesField(
        'variants',
        required=False,
        searchable=True,
        default=(),
        widget=LinesWidget(
            label=_('label_glossary_variants', default="Variants"),
            description=_(
                'help_glossary_variants',
                default="Enter the variants of the term, one per line."),
            visible={'view': 'invisible'}),
Пример #3
0
 def title(self):
     return _(u"Glossary")
Пример #4
0
# PloneGlossary schema
PloneGlossarySchema = ATContentTypeSchema.copy()
PloneGlossarySchema['description'].schemata = 'default'

finalizeATCTSchema(PloneGlossarySchema, folderish=True)

# PloneGlossaryDefinition schema
PloneGlossaryDefinitionSchema = ATContentTypeSchema.copy() + Schema((
    StringField(
        'title',
        required=True,
        searchable=True,
        default='',
        accessor='Title',
        widget=StringWidget(label=_(u'label_glossary_term', default=u"Term"),
                            description=_(
                                u'help_glossary_term',
                                default=u"Enter the term to be defined."),
                            visible={'view': 'invisible'}),
    ),
    LinesField(
        'variants',
        required=False,
        searchable=True,
        default=(),
        widget=LinesWidget(
            label=_(u'label_glossary_variants', default=u"Variants"),
            description=_(
                u'help_glossary_variants',
                default=u"Enter the variants of the term, one per line."),
Пример #5
0
 def title(self):
     return _(u"Glossary")
Пример #6
0
# PloneGlossary schema
PloneGlossarySchema = ATContentTypeSchema.copy()
PloneGlossarySchema['description'].schemata = 'default'

finalizeATCTSchema(PloneGlossarySchema, folderish=True)

# PloneGlossaryDefinition schema
PloneGlossaryDefinitionSchema = ATContentTypeSchema.copy() + Schema((
    StringField(
        'title',
        required=True,
        searchable=True,
        default='',
        accessor='Title',
        widget=StringWidget(
            label=_(u'label_glossary_term', default=u"Term"),
            description=_(u'help_glossary_term',
                          default=u"Enter the term to be defined."),
            visible={'view': 'invisible'}),
    ),
    LinesField(
        'variants',
        required=False,
        searchable=True,
        default=(),
        widget=LinesWidget(
            label=_(u'label_glossary_variants', default=u"Variants"),
            description=_(
                u'help_glossary_variants',
                default=u"Enter the variants of the term, one per line."),
            visible={'view': 'invisible'}),