예제 #1
0
class IBreadcrumbsPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)
예제 #2
0
class EditForm(z3cformhelper.EditForm):

    fields = field.Fields(IQueryPortlet)
    fields['query'].widgetFactory = QueryStringFieldWidget

    label = _(u"Edit Collection Portlet")
    description = _(u"This portlet displays a listing of items from a "
                    u"Collection.")
예제 #3
0
class AddForm(base.AddForm):

    schema = IBreadcrumbsPortlet
    label = _(u"Add Breadcrumbs Portlet")
    description = _(u"This portlet renders the Plone Breadcrumbs in context")

    def create(self, data):
        return Assignment(**data)
class AddForm(formhelper.AddForm):
    schema = ICollectionPortlet
    label = _(u"Add Collection Portlet")
    description = _(u"This portlet displays a listing of items from a "
                    u"Collection.")

    def create(self, data):
        return Assignment(**data)
예제 #5
0
class AddForm(formhelper.AddForm):
    schema = ISearchResultsPortlet
    label = _(u"Add Search Results Portlet")
    description = _(
        u"This portlet displays items from a search result based on a catalog "
        u"index.")

    def create(self, data):
        return Assignment(**data)
예제 #6
0
class AddForm(z3cformhelper.AddForm):

    fields = field.Fields(IQueryPortlet)
    fields['query'].widgetFactory = QueryStringFieldWidget

    label = _(u"Add Query Portlet")
    description = _(u"This portlet displays a listing of items from a "
                    u"Collection.")

    def create(self, data):
        return Assignment(**data)
예제 #7
0
class EditForm(base.EditForm):
    """Portlet edit form.
    
    This is registered with configure.zcml. The form_fields variable tells
    zope.formlib which fields to display.
    """

    form_fields = form.Fields(ICollectionPortlet)
    form_fields['target_collection'].custom_widget = UberSelectionWidget

    label = _(u"Edit Collection Portlet")
    description = _(
        u"This portlet display a listing of items from a Collection.")
예제 #8
0
class AddForm(base.AddForm):
    """Portlet add form.
    
    This is registered in configure.zcml. The form_fields variable tells
    zope.formlib which fields to display. The create() method actually
    constructs the assignment that is being added.
    """
    form_fields = form.Fields(ICollectionPortlet)
    form_fields['target_collection'].custom_widget = UberSelectionWidget

    label = _(u"Add Collection Portlet")
    description = _(
        u"This portlet display a listing of items from a Collection.")

    def create(self, data):
        return Assignment(**data)
예제 #9
0
class IQueryPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    query = schema.List(
        title=_(u'label_query', default=u'Search terms'),
        description=_(u"""Define the search terms for the items you want to
            list by choosing what to match on.
            The list of results will be dynamically updated"""),
        value_type=schema.Dict(value_type=schema.Field(),
                               key_type=schema.TextLine()),
        required=False)

    sort_on = schema.TextLine(
        title=_(u'label_sort_on', default=u'Sort on'),
        description=_(u"Sort the collection on this index"),
        required=False,
    )

    sort_reversed = schema.Bool(
        title=_(u'label_sort_reversed', default=u'Reversed order'),
        description=_(u'Sort the results in reversed order'),
        required=False,
    )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    more = schema.TextLine(
        title=_(u"Show more link"),
        description=_(
            u"Link to display in the footer, leave empty to hide it"),
        required=False)
예제 #10
0
class ICollectionPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    target_collection = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=True,
        source=SearchableTextSourceBinder(
            {'object_provides': IATTopic.__identifier__},
            default_query='path:'))

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(
            u"Specify the maximum number of items to show in the portlet. "
            "Leave this blank to show all items."),
        required=False)

    show_more = schema.Choice(
        title=_(u"Show more... link"),
        description=
        _(u"If enabled, a more... link will appear in the footer of the portlet. "
          "You can determine if it should link to the underlying Collection or show "
          "the Collection's contents in the current context."),
        required=False,
        vocabulary=SimpleVocabulary(
            terms=(SimpleTerm(value='', title='No'),
                   SimpleTerm(value='direct', title='Link to collection'),
                   SimpleTerm(value='context',
                              title='Show contents in context')), ),
        default='')

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=
        _(u"If enabled, effective dates will be shown underneath the items listed."
          ),
        required=True,
        default=False)

    show_rss = schema.Bool(
        title=_(u'Show RSS link'),
        description=
        _(u'If enabled, a link to the RSS representaion of the collection will we added at the bottom of the portlet.'
          ),
        required=True,
        default=False,
    )

    rss_explanation_path = schema.TextLine(
        title=_(u'RSS explanation path'),
        description=
        _(u'Enter a relative path to a page that gives general RSS information. This is optional.'
          ),
        required=False,
    )
class EditForm(formhelper.EditForm):
    schema = ICollectionPortlet
    label = _(u"Edit Collection Portlet")
    description = _(u"This portlet displays a listing of items from a "
                    u"Collection.")
예제 #12
0
class ICollectionPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    widget('uid',
           RelatedItemsFieldWidget,
           pattern_options={'selectableTypes': ['Collection']})
    uid = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=True,
        vocabulary='plone.app.vocabularies.Catalog',
    )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    show_more = schema.Bool(
        title=_(u"Show more... link"),
        description=_(u"If enabled, a more... link will appear in the footer "
                      u"of the portlet, linking to the underlying "
                      u"Collection."),
        required=True,
        default=True)

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=_(u"If enabled, effective dates will be shown underneath "
                      u"the items listed."),
        required=True,
        default=False)

    exclude_context = schema.Bool(
        title=_(u"Exclude the Current Context"),
        description=_(
            u"If enabled, the listing will not include the current item the "
            u"portlet is rendered for if it otherwise would be."),
        required=True,
        default=True)

    no_icons = schema.Bool(
        title=_(u"Suppress Icons"),
        description=_(
            u"If enabled, the portlet will not show document type icons."),
        required=True,
        default=False)

    thumb_scale = schema.TextLine(
        title=_(u"Override thumb scale"),
        description=_(
            u"Enter a valid scale name"
            u" (see 'Image Handling' control panel) to override"
            u" (e.g. icon, tile, thumb, mini, preview, ... )."
            u" Leave empty to use default (see 'Site' control panel)."),
        required=False,
        default=u'')

    no_thumbs = schema.Bool(
        title=_(u"Suppress thumbs"),
        description=_(u"If enabled, the portlet will not show thumbs."),
        required=True,
        default=False)
예제 #13
0
class ICollectionPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    target_collection = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=True,
        source=SearchableTextSourceBinder(
            {'object_provides': IATTopic.__identifier__},
            default_query='path:'))

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(
            u"Specify the maximum number of items to show in the portlet. "
            "Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(
            u"If enabled, items will be selected randomly from the collection, "
            "rather than based on its sort order."),
        required=True,
        default=False)

    show_more = schema.Bool(
        title=_(u"Show more... link"),
        description=_(
            u"If enabled, a more... link will appear in the footer of the portlet, "
            "linking to the underlying Collection."),
        required=True,
        default=True)

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=
        _(u"If enabled, effective dates will be shown underneath the items listed."
          ),
        required=True,
        default=False)
예제 #14
0
class EditForm(base.EditForm):
    schema = IBreadcrumbsPortlet
    label = _(u"Edit Breadcrumbs Portlet")
    description = _(u"This portlet renders the Plone Breadcrumbs in context")
예제 #15
0
class EditForm(formhelper.EditForm):
    schema = ISearchResultsPortlet
    label = _(u"Edit Search Results Portlet")
    description = _(
        u"This portlet displays items from a search result based on a catalog "
        u"index.")
예제 #16
0
class ISearchResultsPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(title=_(u"Portlet header"),
                             description=_(u"Title of the rendered portlet"),
                             required=True)

    widget('uid',
           RelatedItemsFieldWidget,
           pattern_options={'selectableTypes': ['Collection']})

    uid = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=False,
        vocabulary='plone.app.vocabularies.Catalog',
    )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    show_more = schema.Bool(
        title=_(u"Show more... link"),
        description=_(u"If enabled, a more... link will appear in the footer "
                      u"of the portlet, linking to the underlying "
                      u"Collection."),
        required=True,
        default=True)

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=_(u"If enabled, effective dates will be shown underneath "
                      u"the items listed."),
        required=True,
        default=False)

    exclude_context = schema.Bool(
        title=_(u"Exclude the Current Context"),
        description=_(
            u"If enabled, the listing will not include the current item the "
            u"portlet is rendered for if it otherwise would be."),
        required=True,
        default=True)
예제 #17
0
class IPortletFrontpage(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    header = schema.TextLine(
        title=_(u"Portlet header"),
        description=_(u"Title of the rendered portlet"),
        required=True)

    uid = schema.Choice(
        title=_(u"Target collection"),
        description=_(u"Find the collection which provides the items to list"),
        required=True,
        source=CatalogSource(portal_type=('Topic', 'Collection')),
        )

    limit = schema.Int(
        title=_(u"Limit"),
        description=_(u"Specify the maximum number of items to show in the "
                      u"portlet. Leave this blank to show all items."),
        required=False)

    random = schema.Bool(
        title=_(u"Select random items"),
        description=_(u"If enabled, items will be selected randomly from the "
                      u"collection, rather than based on its sort order."),
        required=True,
        default=False)

    show_more = schema.Bool(
        title=_(u"Show more... link"),
        description=_(u"If enabled, a more... link will appear in the footer "
                      u"of the portlet, linking to the underlying "
                      u"Collection."),
        required=True,
        default=True)

    show_dates = schema.Bool(
        title=_(u"Show dates"),
        description=_(u"If enabled, effective dates will be shown underneath "
                      u"the items listed."),
        required=True,
        default=False)

    exclude_context = schema.Bool(
        title=_(u"Exclude the Current Context"),
        description=_(
            u"If enabled, the listing will not include the current item the "
            u"portlet is rendered for if it otherwise would be."),
        required=True,
        default=True)

    style_class = schema.TextLine(
        title=_(u"Portlet css classes"),
        description=_(u"Classes for the portlet (top, bottom, left, right, small, big)"),
        required=True)

    more_text = schema.TextLine(
        title=_(u"Text for the more button"),
        description=_(u"Text for the more button"),
        required=False)