コード例 #1
0
ファイル: portlet.py プロジェクト: mohalfaki/bungeni-portal
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
ファイル: portlet.py プロジェクト: mohalfaki/bungeni-portal
 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'}),