Exemplo n.º 1
0
def ImportanceVocabulary(context):
    items =[
        (_(u"importance_highest", default=u"Highest importance"),'4'),
        (_(u"importance_high", default=u"High importance"),'3'),
        (_(u"importance_normal", default=u"Normal importance"),'2'),
        (_(u"importance_low", default=u"Low importance"),'1')]
    return SimpleVocabulary.fromItems(items)
Exemplo n.º 2
0
 def title(self):
     return self.header or _(u'portlet_teaser_title', default=u"Teaser")
Exemplo n.º 3
0
from collective.teaser.config import PROJECTNAME, DEFAULT_IMPORTANCE
from collective.teaser import MsgFact as _
from plone.app.imaging.utils import getAllowedSizes


allowed_sizes = getAllowedSizes()


type_schema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    atapi.ImageField('image',
        required=False,
        languageIndependent=True,
        sizes=allowed_sizes,
        widget=atapi.ImageWidget(
            label=_(u"label_image", default=u"Image"),
            description=_(u"help_image",
                          default=u"Image to display as teaser."),
        ),
    ),

    atapi.ReferenceField('link_internal',
        required=False,
        searchable=False,
        languageIndependent=True,
        multiValued=False,
        relationship='ref_link_internal',
        widget=ReferenceBrowserWidget(
            label=_(u"label_link_internal", default=u"Internal Link"),
            description=_(u"help_link_internal",
                          default=u"Link to internal content. For external " +\
Exemplo n.º 4
0
    def teasers(self):
        return get_teasers(self.context, self.data, self.request)


class AjaxTeaser(BrowserView):

    def __call__(self):
        return TeaserRenderer(self.context, self.data, self.request)()

    @property
    def data(self):
        return get_portlet_assingment(self.context, self.request.get('uid'))


display_columns = SimpleVocabulary([
    SimpleTerm(value=u'1', title=_(u'One')),
    SimpleTerm(value=u'2', title=_(u'Two'))])


class ITeaserPortlet(IPortletDataProvider):

    header = schema.TextLine(
        title=_(u"Portlet header"),
        description=_(u"Title of the rendered portlet"),
        required=False)
    
    display_columns = schema.Choice(
        title=_(u'portlet_label_display_columns', default=u'Number of columns'),
        description=_(u'portlet_help_display_columns',
                      default=u'Select number of columns to display'),
        vocabulary=display_columns,