예제 #1
0
class IHotThreads(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    header = schema.TextLine(title=_(u'Header'),
                             description=_(u"The header for the portlet. "
                                           "Leave empty for none."),
                             required=False)

    forum = schema.TextLine(title=_(u'Forum'),
                            description=_(u"Specify the forum you wish to "
                                          "obtain the hot threads from."),
                            required=True)

    max_results = schema.Int(title=_(u'Maximum results'),
                             description=_(u"The maximum results number."),
                             required=True,
                             default=5)

    pretty_date = schema.Bool(
        title=_(u'Pretty dates'),
        description=_(u"Show dates in a pretty format (ie. '4 hours ago')."),
        default=True,
        required=False)

    anonymous_only = schema.Bool(
        title=_(u'Anonymous only'),
        description=_(u"Display this portlet only for anonymous users."),
        default=True,
        required=False)
예제 #2
0
class EditForm(base.EditForm):

    form_fields = form.Fields(ILatestNITFPortlet)
    form_fields = form_fields.omit('target_collection')

    label = _(u"Add latest NITF Portlet")
    description = _(u"This portlet display a list of latest NITF from a "
                    u"Collection. It will select between different collections"
                    u"based on the current context.")
예제 #3
0
class AddForm(base.AddForm):

    form_fields = form.Fields(ILatestNITFPortlet)
    form_fields = form_fields.omit('target_collection')

    label = _(u"Add latest NITF Portlet")
    description = _(
        u"This portlet display a list of latest NITF from a "
        u"Collection. It will select between different collections "
        u"based on the current context.")

    def create(self, data):
        return Assignment(**data)
예제 #4
0
class IRecentVideos(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    tag = schema.TextLine(title=_(u'Tag'),
                          description=_(u"Tag to filter the videos "),
                          required=True)

    limit = schema.Int(title=_(u'Limit'),
                       description=_(u"The maximum results number."),
                       required=True,
                       default=5)
예제 #5
0
class ILatestNITFPortlet(IPortletDataProvider):
    """A portlet which renders the results of a collection object.
    """

    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."),
        default=10,
        required=False)

    pretty_date = schema.Bool(
        title=_(u'Pretty dates'),
        description=_(u"Show dates in a pretty format (ie. '4 hours ago')."),
        default=True,
        required=False)

    anonymous_only = schema.Bool(
        title=_(u'Anonymous only'),
        description=_(u"Display this portlet only for anonymous users."),
        default=True,
        required=False)
예제 #6
0
class ILatestPolls(IPortletDataProvider):
    """A portlet

    It inherits from IPortletDataProvider because for this portlet, the
    data that is being rendered and the portlet assignment itself are the
    same.
    """

    header = schema.TextLine(title=_(u'Header'),
                             description=_(u"The header for the portlet. "
                                           "Leave empty for none."),
                             required=False)

    max_results = schema.Int(title=_(u'Maximum results'),
                             description=_(u"The maximum results number."),
                             required=True,
                             default=5)

    anonymous_only = schema.Bool(
        title=_(u'Anonymous only'),
        description=_(u"Display this portlet only for anonymous users."),
        default=True,
        required=False)
예제 #7
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen. Here, we use the title that the user gave.
     """
     return _(u"Latest NITF")
예제 #8
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Hot Threads")
예제 #9
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Hot Threads")
예제 #10
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Recent videos")
예제 #11
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Latest polls")
예제 #12
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Latest polls")
예제 #13
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen. Here, we use the title that the user gave.
     """
     return _(u"Latest NITF")